Whether you want to launch plasma, magic or fruit, a projectile algorithm is what you are looking for. It might sound simple enough but when you start to break it down and think it through it is quite an involved process. Not necessarily complicated, just a lot of little things to keep track of.
Phew! This might seem like the toughest of all 12 lessons but most of it involves code you've already used. You don't have to understand it all at once and the important parts you will understand.


| NEW CODE is BOLD. |
Include "functions8.bb" |
; Add projectile Type projectile_sprite = LoadSprite( "heart.bmp" ) |
. . . Function CreateProjectile.Projectile( source ) Function UpdateProjectile( P.Projectile ) Function CreateExplosion.Explosion( P.Projectile ) Function UpdateExplosion( E.Explosion ) |
. . . |
; Add projectile Type projectile_sprite = LoadSprite( "heart.bmp" ) |
. . . |
Function UpdateProjectiles() |
Function CreateProjectile.Projectile( source ) |
Function UpdateProjectile( P.Projectile ) |
Function CreateExplosion.Explosion( P.Projectile ) |
Function UpdateExplosion( E.Explosion ) |
| EXPERIMENT ! |
| asdasd |
| THE CHALLENGE!!! |
| Add sdfsdfsdsdf |