So I'm working on this scratch project of a school assignment but the script isn't working properly. My IT teacher advised me that I should ask for help on the forums. I don't know how to link the game into this so I'll tell you that the title is Retake the Base on my page. Basically the background is meant to switch once you kill 4 aliens and the code is set so that aliens killed is a variable (works fine). The background won't switch however and the aliens don't respawn, only one of them at random. It's a pain and I really need to fix these problems. Can anybody help?
Offline
dracae wrote:
Here, I fixed it!
http://scratch.mit.edu/projects/dracae/3315165
(To post the link, copy and paste it in your post)
Now you can click it
Offline
change background:
with the blocks that control when the aliens die (in the aliens' scripts), put
if <(Aliens Killed) = [4]> broadcast [next level v] endthen, in the stage scripts, put
when i receive [next level v] next backgroundrespawn:
wait [1] secs
go to x:[0] y:[0]
pick random [1] to [10]
show
hidewait is in the Control drawer, go to in Motion, pick random in Operators and show and hide are both in Looks. Depending on if you want to make it take time for the aliens to respawn or not, wait can help with that. Go to will put the alien at the coordinates you tell it and for a random respawn, put pick random blocks in for the x and y coordinates of your go to block. the screen goes from -240 to +240 for x (the horizontal) and from -180 to 180 for y (the vertical).
Offline