Revision as of 01:45, 3 September 2019 by Bigpuppy (talk | contribs) (Bigpuppy moved page Projectile engine to Projectile Engine without leaving a redirect: Title case.)

Example

Projectiles are used in a wide variety of games, such as shooters, and are not very complicated to make. You will only need 35 blocks.

when gf clicked
forever
hide
set rotation style [all around v]//rotation mode
go to (player1 v)//go to sprite currently shooting
point towards (mouse pointer v)//to aim your projectile
if <mouse down?> then
if <<(direction) < (120)> and <(direction) > (-120)>> then//to stop unwanted glitches
if <(direction) < (0)> then
show
repeat until <<touching (edge v)?> or<touching (player2 v)?>>//repeat until collision
move [10] steps//move forward
turn left [2] degrees//constantly dip downwards
end
move [10] steps//continue colliding with object after initial collision
hide
else
show
repeat until <<touching (edge v)?> or<touching (player2 v)?>>//repeat until collision
move [10] steps//move forward
turn right [2] degrees//constantly dip downwards
end
move [10] steps//continue colliding with object after initial collision
hide
end
end
end
end

The most important part to this is that the projectile is in the center of its costume, otherwise, the projectile will not travel smoothly in the air.