Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- whenSpaceIsPressed = fromEvent Event.KEYPRESSED on KEY.SPACE
- whenBulletWasFired = whenSpaceIsPressed if cannonIsReady then fireBulletFromSpaceship
- whenBulletWasFired then startReloadingCannon wait 5s then finishReloading
- cannonIsReady spaceship = spaceship.cannon.isReady
- fireBulletFromSpaceship = createBullet withVelocity ofSpeed 5 towardsNorth
- startReloadingCannon spaceship = set spaceship.cannon.isReady to False
- finishReloading spaceship = set spaceship.cannon.isReady to True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement