Jump to content


Photo

How to set a time limit?


  • Please log in to reply
4 replies to this topic

#1 CANTODENGHKY

CANTODENGHKY

    GMC Member

  • New Member
  • 2 posts
  • Version:Mac

Posted 30 August 2012 - 10:25 AM

In the game that I am currently creating, one of the characters eat a fruit and then become invincible. I have reached the invincibility part, but I don't know how to make it so that it loses invincibility after around twenty seconds.

Please help?
  • 0

#2 FAAAEBS

FAAAEBS

    GMC Member

  • GMC Member
  • 157 posts
  • Version:GM8

Posted 30 August 2012 - 10:51 AM

when the player becomes invincible, set an alarm to 600 (if your game works at 30 fps), and in that alarm event stop the invincibility.
  • 0

#3 CANTODENGHKY

CANTODENGHKY

    GMC Member

  • New Member
  • 2 posts
  • Version:Mac

Posted 30 August 2012 - 11:39 AM

Yea, I'm sorry, but I'm really new to Game Maker, started using it in only the last week, so could you please give step by step instruction?
Thank You.
  • 0

#4 sp202

sp202

    Wannabe Indie

  • GMC Member
  • 306 posts
  • Version:Unknown

Posted 30 August 2012 - 11:59 AM

In the main2 tab..I think, there's a DnD icon with a clock on it. This is an alarm, set it to 600, this is about 20 seconds if your room speed is 30. In the event alarm0 set invincible to false. Hope I helped.
  • 0

#5 Debels

Debels

    GMC Member

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

Posted 02 September 2012 - 05:36 AM

I find the above information incomplete, since they just say the number, but what about when you want to change it?

The alarm is based on the room_speed for example, If you want it to be 20 seconds then you could add the alarm time this way:

alarm[0]=room_speed*20;//By just replacing the 20 you can select any number like for example change it with 5 for 5 seconds and such.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users