Advertisement
Guest User

Untitled

a guest
Nov 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. whenSpaceIsPressed = fromEvent Event.KEYPRESSED on KEY.SPACE
  2.  
  3. whenBulletWasFired = whenSpaceIsPressed if cannonIsReady then fireBulletFromSpaceship
  4. whenBulletWasFired then startReloadingCannon wait 5s then finishReloading
  5.  
  6. cannonIsReady spaceship = spaceship.cannon.isReady
  7. fireBulletFromSpaceship = createBullet withVelocity ofSpeed 5 towardsNorth
  8. startReloadingCannon spaceship = set spaceship.cannon.isReady to False
  9. finishReloading spaceship = set spaceship.cannon.isReady to True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement