Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Shooting in direction
- TastyFish1234
-
6 posts
Shooting in direction
I'm trying to make it that when I press space it shoots, it works, but it only shoots in one direction, it doesn't shoot in whatever direction I am standing in
- Crimson19
-
1000+ posts
Shooting in direction
It has to point in the direction of the gun/character. Also, you have to make sure that if the gun and the character are one sprite, you set the costume center to the gun.
- deck26
-
1000+ posts
Shooting in direction
It's not necessary to set the costume centre to the gun and may not be best advice. If the gun is being held out to the side of the character this would give a flipping effect when the character turned. It has to point in the direction of the gun/character. Also, you have to make sure that if the gun and the character are one sprite, you set the costume center to the gun.
The main thing is that the bullets move along the line of the gun which is easiest if the gun is pointing in the direction the sprite is pointing. Then the bullet can go to the centre of the character, point in the right direction and move x steps while still hidden. The x steps bring it to the exit point of the gun. Normal firing movement takes over from there.
- deck26
-
1000+ posts
Shooting in direction
My feeling is that having studios or sub-groups of Scratchers helping out somewhere else confuses the issue. If someone needs help they can come here and will get help from anyone who is currently around. If they go to a studio it is potentially much more hit and miss which might discourage them from asking for help. Multiply that by the number of different people trying to help that way and you end up with too many places where help might be available.You Like helping peopleIt's not necessary to set the costume centre to the gun and may not be best advice. If the gun is being held out to the side of the character this would give a flipping effect when the character turned. It has to point in the direction of the gun/character. Also, you have to make sure that if the gun and the character are one sprite, you set the costume center to the gun.
The main thing is that the bullets move along the line of the gun which is easiest if the gun is pointing in the direction the sprite is pointing. Then the bullet can go to the centre of the character, point in the right direction and move x steps while still hidden. The x steps bring it to the exit point of the gun. Normal firing movement takes over from there.
Do You Want To join My Collab
For Studio
http://scratch.mit.edu/studios/993410/
For Recruiting
http://scratch.mit.edu/discuss/topic/94892/
So I appreciate the offer but would actually rather encourage you to help out here and not do it elsewhere.
Last edited by deck26 (March 3, 2015 11:11:17)
- TastyFish1234
-
6 posts
Shooting in direction
It does not have a weapon, it shoots from it's mouth It has to point in the direction of the gun/character. Also, you have to make sure that if the gun and the character are one sprite, you set the costume center to the gun.
- deck26
-
1000+ posts
Shooting in direction
That doesn't exactly make much difference to the overall idea of the advice you've received.It does not have a weapon, it shoots from it's mouth It has to point in the direction of the gun/character. Also, you have to make sure that if the gun and the character are one sprite, you set the costume center to the gun.
However looking at your original post you probably don't want the ‘go to Tera’ in the ‘repeat until’ - that may just be an error in your use of scratchblocks though.
Last edited by deck26 (March 4, 2015 11:37:41)
- TastyFish1234
-
6 posts
Shooting in direction
yes it was a mistakeThat doesn't exactly make much difference to the overall idea of the advice you've received.It does not have a weapon, it shoots from it's mouth It has to point in the direction of the gun/character. Also, you have to make sure that if the gun and the character are one sprite, you set the costume center to the gun.
However looking at your original post you probably don't want the ‘go to Tera’ in the ‘repeat until’ - that may just be an error in your use of scratchblocks though.
- 712343
-
3 posts
Shooting in direction
How do i make my sprite shoot i am making asteriods. Please help me!!
- dimitrip
-
500+ posts
Shooting in direction
Shooting is basically
- showing a bullet sprite (or creating a clone of a base, hidden one); then
- entering a loop that moves the bullet in some direction, until the bullet hits the target, the edge of the screen, or something else
- Then you let the bullet die by deleting the clone, or by hiding it.
Greetz.
Dimitri.
- showing a bullet sprite (or creating a clone of a base, hidden one); then
- entering a loop that moves the bullet in some direction, until the bullet hits the target, the edge of the screen, or something else
- Then you let the bullet die by deleting the clone, or by hiding it.
Greetz.
Dimitri.
- deck26
-
1000+ posts
Shooting in direction
Please start your own topic rather than necroposting on someone else's. How do i make my sprite shoot i am making asteriods. Please help me!!
- cwkneeti5154
-
7 posts
Shooting in direction
i am trying to make a ball shoot in one direction without anything making it. i tried

it doesn't work. help!

- deck26
-
1000+ posts
Shooting in direction
Please start your own topic rather than necroposting. You also need to give more details or share the project. What you have there will make the sprite go immediately to a location, not move in a way that you see it moving between the start and end points. i am trying to make a ball shoot in one direction without anything making it. i triedit doesn't work. help!
- neetivaidya
-
16 posts
Shooting in direction
also here is the link to my project
here is my profile link
thank you
here is my profile link
thank you
- neetivaidya
-
16 posts
Shooting in direction
don't understand.It's not necessary to set the costume centre to the gun and may not be best advice. If the gun is being held out to the side of the character this would give a flipping effect when the character turned. It has to point in the direction of the gun/character. Also, you have to make sure that if the gun and the character are one sprite, you set the costume center to the gun.
The main thing is that the bullets move along the line of the gun which is easiest if the gun is pointing in the direction the sprite is pointing. Then the bullet can go to the centre of the character, point in the right direction and move x steps while still hidden. The x steps bring it to the exit point of the gun. Normal firing movement takes over from there.
Last edited by neetivaidya (June 26, 2016 16:24:41)
- neetivaidya
-
16 posts
Shooting in direction
the links are not working
how do you do this if it does not go to the sprite? also i have the same problem as @cwkneeti5154 You can try this
- deck26
-
1000+ posts
Shooting in direction
Please start your own topic rather than necroposting and explain which bit you don't understand.don't understand.It's not necessary to set the costume centre to the gun and may not be best advice. If the gun is being held out to the side of the character this would give a flipping effect when the character turned. It has to point in the direction of the gun/character. Also, you have to make sure that if the gun and the character are one sprite, you set the costume center to the gun.
The main thing is that the bullets move along the line of the gun which is easiest if the gun is pointing in the direction the sprite is pointing. Then the bullet can go to the centre of the character, point in the right direction and move x steps while still hidden. The x steps bring it to the exit point of the gun. Normal firing movement takes over from there.
- vaylor109
-
1 post
Shooting in direction
i tried to shoot laser from my space ship but it doesnt shoot from the the space ship.
check on my game (space shooter part1)

- asivi
-
1000+ posts
Shooting in direction
bump
i tried to shoot laser from my space ship but it doesnt shoot from the the space ship. https://cdn2.scratch.mit.edu/get_image/project/144269107_100x80.pngcheck on my game (space shooter part1)
- Discussion Forums
- » Help with Scripts
-
» Shooting in direction