Discuss Scratch

IryRasmo
Scratcher
46 posts

How do I make powerups?

So, i have this spaceship game i'm working on and i want to add a shield powerup, that when you get it you can't take damage for ten seconds, but i don't know how to code it. plz help

here's a link to the game Space Wars
Th3_C0d3r
Scratcher
100+ posts

How do I make powerups?

I recommend making a variable call Shields. When it equals 0 that means no shield. However when it equal 1, that mean the power-up is in use. So with that said you can use something like this.

when green flag clicked
forever
Other parts of script
if <<touching [Enemy Laser v] ?> and <(Shields) = [0]>> then//Getting hit by enemy fire and no shields then
change [Health v] by (-1) //Take damage
end
end

You can have another script that controls the power-up so

when I receive [Active shield v]
set [Shields v] to [1]
wait (10) secs
set [Shields v] to [0]

-Merry Christmas!

Last edited by Th3_C0d3r (Dec. 24, 2016 19:51:26)

IryRasmo
Scratcher
46 posts

How do I make powerups?

Ok thanks this really helped !!
neilryan40
Scratcher
3 posts

How do I make powerups?

hi
neilryan40
Scratcher
3 posts

How do I make powerups?

move () steps
neilryan40
Scratcher
3 posts

How do I make powerups?

sorry just new to posting. IDK what that these do.
BrainGamer1234
Scratcher
100+ posts

How do I make powerups?

neilryan40 wrote:

sorry just new to posting. IDK what that these do.

Please do not necropost. As you can see, this post was from 2016. But because you “necroposted” on it, it was bumped to the top of the forums. Please only comment in new posts to keep relevant things at the top of the forum.

Powered by DjangoBB