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

#1 2009-12-13 13:18:51

Ahippo
Scratcher
Registered: 2009-12-10
Posts: 3

How would one program a gun sprite to shoot?

I am in the process of making a TPS (Third Person Shooter) Game, and I am trying to make a semi-automatic gun, but I have hit a road block trying to program it. Any suggestions?

P.S. I have created a variable for the ammo, if that is any help.

P.P.S. The gun that I have in mind is one that has 15 shots in it.

Last edited by Ahippo (2009-12-13 13:59:04)

Offline

 

#2 2009-12-17 23:59:05

RyanBenLee
Scratcher
Registered: 2009-03-08
Posts: 47

Re: How would one program a gun sprite to shoot?

Do you want a gun that shoot multiple bullets at a time or one that shoots one by one. I only know the second suggestion.
Anyway here it is:
Gun sprite
<when green flag clicked><forever><point towards( mousepointer

bullet sprite:
<when green flag clicked><forever><if><mouse down?><go to[ gun<point towards( mousepointer<repeat( <touching[ edge<move( whatever )steps><go to[ gun                                                                                                                     

hope this helps

Offline

 

#3 2009-12-18 09:17:06

illusionist
Retired Community Moderator
Registered: 2008-07-02
Posts: 1000+

Re: How would one program a gun sprite to shoot?

Here is a project that should help:

http://scratch.mit.edu/static/projects/keroro645/593128_sm.png


http://i.imgur.com/8LX1NrV.png

Offline

 

Board footer