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

#1 2011-12-09 12:34:14

xAIRGUITARISTx
New Scratcher
Registered: 2011-12-05
Posts: 6

Shooting in an adventure game

I'm trying to make a game where my character moves around.  How do I make it so when the character has moved in a certain direction? Eg: If the character moves right and stops, the bullet will still fire right, as well as while it's moving.

Offline

 

#2 2011-12-09 12:57:48

aliasCorey
Scratcher
Registered: 2009-04-19
Posts: 100+

Re: Shooting in an adventure game

You should make a several sprite for the bullet, so the bullet can't be influenced by the characters movements. Just hide the bullet, and as soon as you shoot (by using space or so) make it go to the avatar and move in the direction the avatar is headed (you can work with the direction by using the "--- of Object" block under sensing)


Let me translate for you (German, English, French)

Offline

 

#3 2011-12-09 15:31:06

xAIRGUITARISTx
New Scratcher
Registered: 2011-12-05
Posts: 6

Re: Shooting in an adventure game

But there may be more than one enemy in the level at one time

Offline

 

#4 2011-12-09 16:09:50

Venazard
Scratcher
Registered: 2009-12-15
Posts: 100+

Re: Shooting in an adventure game

First-person or third-person? I am currently making a first-person game right now and could render some assistance if you need it.


http://nitrostudios.weebly.com/uploads/6/8/1/2/6812574/1323469851.png

Offline

 

#5 2011-12-09 17:19:45

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: Shooting in an adventure game

Use multiple bullets, I suppose. (and multiple variables, if required) Also, I'm pretty sure this belongs in All About Scratch.


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#6 2011-12-09 17:29:40

flashgocrazy
Scratcher
Registered: 2011-01-12
Posts: 500+

Re: Shooting in an adventure game

xAIRGUITARISTx wrote:

I'm trying to make a game where my character moves around.  How do I make it so when the character has moved in a certain direction? Eg: If the character moves right and stops, the bullet will still fire right, as well as while it's moving.

yea, thats about it (hold on, making shooting demo to use for u)


◕‿◕

Offline

 

#7 2011-12-09 18:17:56

flashgocrazy
Scratcher
Registered: 2011-01-12
Posts: 500+

Re: Shooting in an adventure game

OK, I made it here

I uploaded it with my test account
happy Machine gun platformer making http://scratch.mit.edu/forums/img/smilies/tongue.png

Last edited by flashgocrazy (2011-12-10 21:28:45)


◕‿◕

Offline

 

#8 2011-12-10 18:29:37

xAIRGUITARISTx
New Scratcher
Registered: 2011-12-05
Posts: 6

Re: Shooting in an adventure game

It's a platformer

Offline

 

Board footer