Hi, i need help. I'm making a project called turrets and tanks. I want the enemies to disappear after you shoot them but come back when all of them are shot. I also want the enemies to stop shooting at you when you kill them. Here's what i already have.
when i recive <turret> show forever set size to <260>% switch to costume<tank> repeat until<touching [ammmo v]> repeat (50) move (5) steps turn cw (pick random form (-5) to (5)) if on edge bounce end point towards [player v] broadcast [fire 1] wait (.50 sec end wait until <(enemies left) = (0)> end
Offline
Well for one thing you need to be testing if it's touching the ammo all the time...so that repeat 50 will have to have something added into it...such as an if else block, or change it to a repeat until and use an or block and an iterating variable.
Offline
Try this:
when I receive [turret v] show forever set size to (260)% switch to costume [tank v] repeat until <touching [ammmo v]?> move (5) steps turn cw (pick random (-5) to (5)) degrees if on edge, bounce change [variable v] by (1) //the variable is to count the amount of times without \ if <(variable) = (50)> //using the repeat block point towards [player v] broadcast [fire 1 v] wait (#) secs set [variable v] to (0) end endAdd other blocks as you need. This method does not include the repeat(50) block, so when this tank is shot, it will instantly disappear, instead of waiting until those 50 are done.
Last edited by mr_fish_fish (2012-02-01 22:11:51)
Offline
Have a few questions about putting an mp3 sound fie into the game i am making. Any help would be appreciated.
Do I need to compress my mp3 file so that i can add it into scratch?
Will putting an mp3 make the game run slower? How can I avoid this?
Thanks
Offline
JVCaptain wrote:
Have a few questions about putting an mp3 sound fie into the game i am making. Any help would be appreciated.
Do I need to compress my mp3 file so that i can add it into scratch?
Will putting an mp3 make the game run slower? How can I avoid this?
Thanks
Normally when you have a question, you should post a new topic about it. But I can answer it here.
You can just click on the sound tab, and click on import. You do not need to compress it. To play it you need to do
when gf clicked forever play sound [Song v] until done end
Last edited by rabbit1131 (2012-02-03 11:46:42)
Offline
JVCaptain wrote:
Have a few questions about putting an mp3 sound fie into the game i am making. Any help would be appreciated.
Do I need to compress my mp3 file so that i can add it into scratch?
Will putting an mp3 make the game run slower? How can I avoid this?
Thanks
You'd be better off creating a new thread to ask that; you'll get more responses that way
Offline