diff options
| author | Jakob L. Kreuze <jakob@memeware.net> | 2018-10-25 10:06:15 -0400 |
|---|---|---|
| committer | Jakob L. Kreuze <jakob@memeware.net> | 2018-10-25 10:06:15 -0400 |
| commit | c60fe418289e4eb3f058fd43bcfdd2ad17c5eac2 (patch) | |
| tree | 47bf6656488cce43aff9b4ec34a8c29dfcd65b1a /player.fnl | |
| parent | 0cb68be20bc265a2635725cace43a634fdb539da (diff) | |
Initial bounce and slimeball implementation
Diffstat (limited to 'player.fnl')
| -rw-r--r-- | player.fnl | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -71,6 +71,10 @@ (when (> 10 (math.abs (. player :y-vel))) (tset player :y-vel (- (. player :goal-y-vel))))) +(fn bounce [player x-normal y-normal] + (tset player :x-vel (- (* 8 x-normal) (. player :x-vel))) + (tset player :y-vel (- (math.abs (* 8 y-normal)) (. player :y-vel)))) + (local player-sheet {:img (love.graphics.newImage "art/swanky.png") :orientation-offset 128 @@ -159,6 +163,7 @@ :move-left move-left :stop-left stop-left :jump jump + :bounce bounce :draw draw-player :update update-player-animations}) |