![]() ![]() Now, we can shoot, giving a limit on how often he can use fireball, every 5 seconds. This should all be programmed into the player, aka the mage. This will cause the fireball to move in the direction you're facing. Finally, we will create a moving instance of object fireball at 0, 0 relative, at direction 'direction'. ![]() When this alarm triggers, we are going to set var_fireball equal to 1, so the player can use fireball again. Then, we are going to make an alarm for 150 steps, equivalent to 5 seconds. Next, what we are going to do is the event "Press space" we are going to say "if var_fireball" is equal to 1, then we will set it equal to 0, (making it go on "cooldown"). ![]() This is saying that you can shoot when he is created. So, first, we make a "when this mage is created" command, and in it, we put "set var_fireball to 1". Essentially, this gives the block a cooldown, saying: you can't shoot unless it is not on cooldown. What we're going to do here is to make the fireball shoot, but only when the cdActive block is showing. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |