Jump to content


Photo

using alarms and steps


  • Please log in to reply
2 replies to this topic

#1 aaa111aaa11

aaa111aaa11

    GMC Member

  • New Member
  • 60 posts

Posted 01 January 2011 - 10:49 PM

well hi


i am using game maker lite and i made an object that looks like a hole in the ground where zombies come out. in that object i did:

Step Event


-with chance 1 out of 25 perform next

-create object obj_zombie

my problem is that i want it to perform that step event for only 2 minutes how??

please tell me witch event to put each code

thx
  • 0

#2 GameGeisha

GameGeisha

    GameGeisha

  • GMC Member
  • 3664 posts
  • Version:GM:Studio

Posted 01 January 2011 - 10:54 PM

In the creation event, set a variable named make_zombies to true and alarm 0 to 120*room_speed. Then in alarm 0, set the variable make_zombies to false. Surround what you have now in a block, then put a "check if expression is true" action before the block, setting the expression to make_zombies.

GameGeisha
  • 0

#3 Jakyl11

Jakyl11

    GMC Member

  • GMC Member
  • 3125 posts
  • Version:GM:Studio

Posted 01 January 2011 - 10:54 PM

set up a timer to stop it from spawning.

example:

create event:

go=1;//spawn enemies
alarm[0]=room_speed*120;//2 minutes change alrm to a different one if your using it already

alarm event:

go=0;

the spawning code you have add

if go=1
{
//your spawning code
}

then to make it start back just change go to 1 and reset alarm event.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users