Discuss Scratch

349049007
Scratcher
7 posts

Bullet

How do you make a bullet fire from a plane?
349049007
Scratcher
7 posts

Bullet

Also, how do you change the background(search up 349049007 and press on the game that says FIGHTER JETS)
Thanks!
:>
gor-dee_test
Scratcher
100+ posts

Bullet

In bullet sprite
when [space v] key pressed //or whatever you use to fire
show
go to x: ([x position v] of [Plane v]) y: ([y position v] of [Plane v]) //goes to plane
repeat until <<touching [Enemy v] ?> or <touching [edge v] ?>>
move (5) steps
end
hide

This is a simple way to do it but will only fire one bullet at a time. If you want multiple bullets you'll have to use clones which is a bit more complex
-ShadowOfTheFuture-
Scratcher
1000+ posts

Bullet

349049007 wrote:

Also, how do you change the background(search up 349049007 and press on the game that says FIGHTER JETS)
Thanks!
:>
Your project uses two sprites for a moving background, right?

Just give each sprite a new costume containing the other background image, and use “switch costume to ( v)” or “next costume” to switch between them.
349049007
Scratcher
7 posts

Bullet

THANK YOU!

Last edited by 349049007 (May 12, 2019 02:16:55)

349049007
Scratcher
7 posts

Bullet

Now I need help with using clones and bullets.(search up 349049007 and press on the game that says FIGHTER JETS)
mstone326
Scratcher
1000+ posts

Bullet

I just created this the other day to help someone on the forums. See if this clone script helps. Notice I create a clone of the projectile from the other sprite. Once you get the hang of clones you would want the projectile to be a costume of your sprite. See if this helps.

https://scratch.mit.edu/projects/307419158/
349049007
Scratcher
7 posts

Bullet

-ShadowOfTheFuture- wrote:

349049007 wrote:

Also, how do you change the background(search up 349049007 and press on the game that says FIGHTER JETS)
Thanks!
:>
Your project uses two sprites for a moving background, right?

Just give each sprite a new costume containing the other background image, and use “switch costume to ( v)” or “next costume” to switch between them.
I don't really get what you mean, my job is to crate a button that changes the background.
-ShadowOfTheFuture-
Scratcher
1000+ posts

Bullet

Nevermind.

Last edited by -ShadowOfTheFuture- (May 16, 2019 00:01:03)

349049007
Scratcher
7 posts

Bullet

-ShadowOfTheFuture- wrote:

349049007 wrote:

-ShadowOfTheFuture- wrote:

349049007 wrote:

Also, how do you change the background(search up 349049007 and press on the game that says FIGHTER JETS)
Thanks!
:>
Your project uses two sprites for a moving background, right?

Just give each sprite a new costume containing the other background image, and use “switch costume to ( v)” or “next costume” to switch between them.
I don't really get what you mean, my job is to crate a button that changes the background,next one
.
when this sprite clicked // in button sprite
switch costume to [ v]
-ShadowOfTheFuture-
Scratcher
1000+ posts

Bullet

-ShadowOfTheFuture- wrote:

when this sprite clicked // in button sprite
switch costume to [ v]
Actually, scratch that. I was wrong.

when this sprite clicked // in button sprite
broadcast [message1 v]
when I receive [message1 v] // in background sprite(s)
switch costume to [ v]
349049007
Scratcher
7 posts

Bullet

Okay I'm done that part but now I need to make the enemy appear randomly and got towards the plane.(Go to 349049007 and click on the project FIGHTER JETS)

Last edited by 349049007 (May 21, 2019 21:32:49)

Kraken_Games
Scratcher
100+ posts

Bullet

349049007 wrote:

Okay I'm done that part but now I need to make the enemy appear randomly and got towards the plane.(Go to 349049007 and click on the project FIGHTER JETS)
when green flag clicked
forever
wait (pick random (1) to (5)) secs // can be changed
create clone of [Enemy v]
end

when I start as a clone // in enemy sprite
go to x: (240) y: (pick random (-180) to (180))
show
repeat until <<[-235] > (x position)> or <touching [Player v] ?>>
change x by (-5)
end

Is a good base for enemies that start from the right and travel leftwards

Powered by DjangoBB