Discuss Scratch

DanielSocia
Scratcher
73 posts

Shooting games

You know how in shooting games you shoot, and the bullet goes strait in front of you, well I do not know how to do that, here is the project http://scratch.mit.edu/projects/41427774/#editor
deck26
Scratcher
1000+ posts

Shooting games

Project isn't shared
DanielSocia
Scratcher
73 posts

Shooting games

deck26 wrote:

Project isn't shared
Oh sorry.
DanielSocia
Scratcher
73 posts

Shooting games

DanielSocia wrote:

deck26 wrote:

Project isn't shared
Oh sorry.
Now it should be.
deck26
Scratcher
1000+ posts

Shooting games

So when you broadcast Bullet the second sprite needs a script to respond to the broadcast. It probably stays hidden initially, then when fired goes to the first sprite, is shown and then moves in whatever direction you want it to move.

Simple example

whenclickedhidewhenIreceiveBulletgotosprite1pointindirectionshowrepeatmove5stepshide
digthebone
Scratcher
500+ posts

Shooting games

make sure the bullet points in the direction of the shooting sprite
pointindirectiondirectionofsprite1
and make the bullet go to the shooting sprite
gotosprite1

Last edited by digthebone (Dec. 30, 2014 20:54:54)

DanielSocia
Scratcher
73 posts

Shooting games

digthebone wrote:

make sure the bullet points in the direction of the shooting sprite
pointindirectiondirectionofsprite1
and make the bullet go to the shooting sprite
gotosprite1
I just wanted to say that when I shoot, it does not go in the direction in front of the shooter. If this is the best everyone can do, nice job trying to help me, but maybe coding is not my thing.
deck26
Scratcher
1000+ posts

Shooting games

DanielSocia wrote:

digthebone wrote:

make sure the bullet points in the direction of the shooting sprite
pointindirectiondirectionofsprite1
and make the bullet go to the shooting sprite
gotosprite1
I just wanted to say that when I shoot, it does not go in the direction in front of the shooter. If this is the best everyone can do, nice job trying to help me, but maybe coding is not my thing.
Don't give up, it just takes a bit of practice. To start with you could just tell the bullet to go in one direction - put 270 in the script I gave you (in the point in direction block) and it will go left for example.

Let me do a quick remix
DanielSocia
Scratcher
73 posts

Shooting games

deck26 wrote:

DanielSocia wrote:

digthebone wrote:

make sure the bullet points in the direction of the shooting sprite
pointindirectiondirectionofsprite1
and make the bullet go to the shooting sprite
gotosprite1
I just wanted to say that when I shoot, it does not go in the direction in front of the shooter. If this is the best everyone can do, nice job trying to help me, but maybe coding is not my thing.
Don't give up, it just takes a bit of practice. To start with you could just tell the bullet to go in one direction - put 270 in the script I gave you (in the point in direction block) and it will go left for example.

Let me do a quick remix
Ok
deck26
Scratcher
1000+ posts

Shooting games

http://scratch.mit.edu/projects/41451920/ will hopefully help you a bit.

Powered by DjangoBB