This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-02-01 15:09:42

B-Man2400
Scratcher
Registered: 2009-06-29
Posts: 3

Need Help!!!!

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

 

#2 2012-02-01 21:25:42

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Need Help!!!!

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.


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#3 2012-02-01 22:08:38

mr_fish_fish
Scratcher
Registered: 2009-11-12
Posts: 52

Re: Need Help!!!!

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
end
Add 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.

I hope this helps!

Last edited by mr_fish_fish (2012-02-01 22:11:51)


/\/\ ® _ |= 1 § |-| _ |= 1 § |-|

Offline

 

#4 2012-02-02 03:17:14

JVCaptain
New Scratcher
Registered: 2012-02-02
Posts: 3

Re: Need Help!!!!

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

 

#5 2012-02-03 11:46:08

rabbit1131
Scratcher
Registered: 2009-10-16
Posts: 1000+

Re: Need Help!!!!

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)


The Intergalactic Adventures of Revesilia! I hope you will partake in this gigantic undertaking, to build the sequel to the hit map The Adventures of Revesilia! The Intergalactic Adventures of Revesilia Map Builders Application thread! http://internetometer.com/image/35004.png

Offline

 

#6 2012-02-03 12:45:28

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Need Help!!!!

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  wink


Why

Offline

 

Board footer