m (Bigpuppy moved page Projectile engine to Projectile Engine without leaving a redirect: Title case.)
m (Categorized, added STUB, fixed SB)
 
Line 1: Line 1:
 +
{{stub|date=October 2019}}
 
==Example==
 
==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.
 
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.
Line 5: Line 6:
 
forever
 
forever
 
hide
 
hide
set rotation style [all around v]//rotation mode
+
set rotation style [all around v ] // rotation mode
go to (player1 v)//go to sprite currently shooting
+
go to (player1 v) // go to sprite currently shooting
point towards (mouse pointer v)//to aim your projectile
+
point towards (mouse pointer v) // to aim your projectile
 
if <mouse down?> then
 
if <mouse down?> then
if <<(direction) < (120)> and <(direction) > (-120)>> then//to stop unwanted glitches
+
if <<(direction) < (120)> and <(direction) > (-120)>> then // to stop unwanted glitches
 
if <(direction) < (0)> then
 
if <(direction) < (0)> then
 
show
 
show
repeat until <<touching (edge v)?> or<touching (player2 v)?>>//repeat until collision
+
repeat until <<touching (edge v)?> or<touching (player2 v)?>> // repeat until collision
move [10] steps//move forward
+
move [10] steps // move forward
turn left [2] degrees//constantly dip downwards
+
turn left [2] degrees // constantly dip downwards
 
end
 
end
move [10] steps//continue colliding with object after initial collision
+
move [10] steps // continue colliding with object after initial collision
 
hide
 
hide
 
else
 
else
 
show
 
show
repeat until <<touching (edge v)?> or<touching (player2 v)?>>//repeat until collision
+
repeat until <<touching (edge v)?> or<touching (player2 v)?>> // repeat until collision
move [10] steps//move forward
+
move [10] steps // move forward
turn right [2] degrees//constantly dip downwards
+
turn right [2] degrees // constantly dip downwards
 
end
 
end
move [10] steps//continue colliding with object after initial collision
+
move [10] steps // continue colliding with object after initial collision
 
hide
 
hide
 
end
 
end
Line 32: Line 33:
 
</scratchblocks>
 
</scratchblocks>
 
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.
 
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.
 +
 +
[[Category:Game Design Tutorials]]

Latest revision as of 05:01, 18 October 2019

Document stub.png This article is a stub. It may be incomplete, unfinished, or have missing parts/sections. If the article can be expanded, please do so! There may be suggestions on its talk page. (October 2019)

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.