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

#1 2012-04-08 11:47:19

THAWKK
New Scratcher
Registered: 2012-02-27
Posts: 37

Need Help with Shooter!

1). How do you script the player sprite to fire its gun?

I also need help with just some of the script in general.  For instance, how would you make the player lose health if they're touching an enemy?  I'm new, so please don't hate over me.

Offline

 

#2 2012-04-08 12:20:33

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Need Help with Shooter!

This community is really supportive.  Nobody should hate on you  smile

You'll probably need to make a "bullet" sprite, with a script like this:

When I Receive
shoot
go to
player
point towards
mouse-pointer
repeat until
touching
edge
?
or
touching
enemy
?
move
5
steps
if
touching
enemy
?
broadcast
kill enemy

To shoot, just do something like this

when clicked
forever
if
mouse down?
broadcast
shoot
and wait

To lose health, put this in the enemy:

when clicked
forever if
touching
player
?
change
player's health
by
-.25

Last edited by MoreGamesNow (2012-04-08 12:23:13)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#3 2012-04-08 13:23:32

SOScratch
Scratcher
Registered: 2010-02-01
Posts: 100+

Re: Need Help with Shooter!

And then for the enemy once it has been shot:
(Put this script on the enemy sprite)

when I receive
kill enemy
hide

And do not worry.
Everyone has to start from somewhere.
Nobody will hate you  smile


-SOScratch
Scratch On!

Offline

 

Board footer