Discuss Scratch

brain39143
Scratcher
40 posts

How to make a gun fire a bullet?

I know that there are lots of topics about this but none of them are working for this game I'm working on. It is about tanks firing bullets from it's turret here's the link https://scratch.mit.edu/projects/97762775/#editor
haileys126
Scratcher
2 posts

How to make a gun fire a bullet?

I need help! I heard that when you have an account on Scratch that you have a book bag. How do I use it? Please reply ASAP!!!
brain39143
Scratcher
40 posts

How to make a gun fire a bullet?

haileys126 wrote:

I need help! I heard that when you have an account on Scratch that you have a book bag. How do I use it? Please reply ASAP!!!
Please do not start another question on this form, start another
asivi
Scratcher
1000+ posts

How to make a gun fire a bullet?

haileys126 wrote:

I need help! I heard that when you have an account on Scratch that you have a book bag. How do I use it? Please reply ASAP!!!
This topic doesn't belong to you, please, create your own.
Regards.
asivi
Scratcher
1000+ posts

How to make a gun fire a bullet?

Hi brain39143, https://scratch.mit.edu/projects/97772350/
this is a your project' remix, i've made some changes to the bullet' costumes pointting it to right and moving its position a little.
I've added a new space key in tank1 for fire the bullet, and create a clone for it.
Greets.
Edit: i've changed some things under the space key pressed and created a new local variable for the clone of bullet in order to identify it.

Last edited by asivi (Feb. 13, 2016 15:05:55)

scrooch2005
Scratcher
33 posts

How to make a gun fire a bullet?

brain39143 wrote:

I know that there are lots of topics about this but none of them are working for this game I'm working on. It is about tanks firing bullets from it's turret here's the link https://scratch.mit.edu/projects/97762775/#editor
First: create 2 sprites: the bullet, the gun. And create 2 variables: gun X, gun Y
Second: Click the gun and put in these scripts:
when(any you want)keypressedbroadcastShoot
whenclickedforeversetgun Xtoxpositionsetgun Ytoyposition

Third: Click the bullet and insert these scripts:
whenIreceiveShootgotox:gunXy:gunYrepeatuntilyposition=280changeyby5hide

You can try that, I hope it works for you.
Scratch on!

Last edited by scrooch2005 (Feb. 13, 2016 07:35:02)

brain39143
Scratcher
40 posts

How to make a gun fire a bullet?

Thank you asivi and scrooch2005 for your help!
asivi
Scratcher
1000+ posts

How to make a gun fire a bullet?

I'm glad if i've helped you.Now i'm going to delete the remix.
Greetings.
brain39143
Scratcher
40 posts

How to make a gun fire a bullet?

OK thanks again
brain39143
Scratcher
40 posts

How to make a gun fire a bullet?

I've found another glitch in the game, whenever I press space for the green tank a bullet comes out of the red tank
Lolmander
Scratcher
100+ posts

How to make a gun fire a bullet?

thanks I might need to use this
asivi
Scratcher
1000+ posts

How to make a gun fire a bullet?

Lolmander wrote:

thanks I might need to use this
I've shared it again https://scratch.mit.edu/projects/97772350/
Greets.

Last edited by asivi (Feb. 13, 2016 20:40:46)

brain39143
Scratcher
40 posts

How to make a gun fire a bullet?

asivi wrote:

Lolmander wrote:

thanks I might need to use this
I've shared it again https://scratch.mit.edu/projects/97772350/
Greets.
asivi
Scratcher
1000+ posts

How to make a gun fire a bullet?

brain39143 wrote:

asivi wrote:

Lolmander wrote:

thanks I might need to use this
I've shared it again https://scratch.mit.edu/projects/97772350/
Greets.
I've made some changes, take a look. If you don't need the bullet for other sprite than the tank1 then the bulletID for the clone isn't necessary.
Greets.
brain39143
Scratcher
40 posts

How to make a gun fire a bullet?

asivi wrote:

brain39143 wrote:

asivi wrote:

Lolmander wrote:

thanks I might need to use this
I've shared it again https://scratch.mit.edu/projects/97772350/
Greets.
I've made some changes, take a look. If you don't need the bullet for other sprite than the tank1 then the bulletID for the clone isn't necessary.
Greets.
No, I'm trying to make one CPU and one player but I can't make a CPU
deck26
Scratcher
1000+ posts

How to make a gun fire a bullet?

brain39143 wrote:

asivi wrote:

brain39143 wrote:

asivi wrote:

Lolmander wrote:

thanks I might need to use this
I've shared it again https://scratch.mit.edu/projects/97772350/
Greets.
I've made some changes, take a look. If you don't need the bullet for other sprite than the tank1 then the bulletID for the clone isn't necessary.
Greets.
No, I'm trying to make one CPU and one player but I can't make a CPU
Why not? It just needs to fire automatically rather than react to a key press. Perhaps when the player's tank is within a certain distance it should point it's turret at the tank and fire repeatedly with a delay.
asivi
Scratcher
1000+ posts

How to make a gun fire a bullet?

Well, @brain39143 has created a topic for the CPU AI, https://scratch.mit.edu/discuss/topic/183276/ .
Regards to all forum.
jellyisawsome2
Scratcher
3 posts

How to make a gun fire a bullet?

You can try this link https://scratch.mit.edu/projects/1478660/

Last edited by jellyisawsome2 (April 14, 2018 23:03:27)

lwell72
Scratcher
100+ posts

How to make a gun fire a bullet?

haileys126 wrote:

I need help! I heard that when you have an account on Scratch that you have a book bag. How do I use it? Please reply ASAP!!!
When ur in your project there is a little arrow it the bottom middle of your screen. You can put stuff in it and Transfer scrips, music and sprites from project to project. If this diner help look at a video on how to find it.
deck26
Scratcher
1000+ posts

How to make a gun fire a bullet?

Please don't necropost.

Powered by DjangoBB