Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Make a shooter game
- Code_Weegee
-
100+ posts
Make a shooter game
try something like this:
when I receive [shoot v]
create clone of [Myself v]
when I start as a clone
go to [probably the player/weapon v]
point towards [something, probably the mouse cursor but idk v]
forever
move (whatever speed you want the projectile to move at) steps
if <touching [edge v] ?> then
delete this clone
end
if <touching [some sprite idk v] ?> then
delete this clone
end
end
- SunnyPanda86
-
3 posts
Make a shooter game
Real Helpful Bruh. Now my project will not be Trash

- borksonthesecond
-
61 posts
Make a shooter game
you should probably add something like this too try something like this:when I receive [shoot v]
create clone of [Myself v]
when I start as a clone
go to [probably the player/weapon v]
point towards [something, probably the mouse cursor but idk v]
forever
move (whatever speed you want the projectile to move at) steps
if <touching [edge v] ?> then
delete this clone
end
if <touching [some sprite idk v] ?> then
delete this clone
end
end
when [space v] key pressed
broadcast [shoot v]
- DrCode616
-
1 post
Make a shooter game
Tried this but it teleports through the floor at certain angles because it moves 20 steps at a time which is enough to avoid touching the floor sprite. I can lower the speed but for the game I'm working on I need it to travel relatively fast (preferably 30-50 steps). Any help will be appreciated. :3
- N8_D_GR8_1
-
1000+ posts
Make a shooter game
In the future, please create a new topic for any questions you have. Tried this but it teleports through the floor at certain angles because it moves 20 steps at a time which is enough to avoid touching the floor sprite. I can lower the speed but for the game I'm working on I need it to travel relatively fast (preferably 30-50 steps). Any help will be appreciated. :3
To answer your question, make a custom block called “move in steps (steps) steps”. Make it run without screen refresh.
define move in steps (steps) steps//when you create this block, you MUST check the "run without screen refresh" checkbox.
repeat (steps)
move [1] steps
if <touching (floor v)> then
delete this clone//or do whatever else you want to do when it hits the floor
end
end
Then, in your code, replace this block:
move (20) stepswith this block:
move in steps (20) steps::custom
- Discussion Forums
- » Help with Scripts
-
» Make a shooter game