diff options
| author | Jakob L. Kreuze <jakob@memeware.net> | 2018-10-25 19:54:35 -0400 |
|---|---|---|
| committer | Jakob L. Kreuze <jakob@memeware.net> | 2018-10-25 19:54:35 -0400 |
| commit | b14e85d7f8851fbdeb27bf6438f21a327c03e840 (patch) | |
| tree | 59e98643fba250e80f8e627d469547da49d19296 /player.fnl | |
| parent | dfe364b8501838cd41bc8681ddd4af0a1781346b (diff) | |
Implement sound effects and music
Diffstat (limited to 'player.fnl')
| -rw-r--r-- | player.fnl | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -20,6 +20,7 @@ (local draw (require :draw)) (local gravity 128) +(local jump-sfx (love.audio.newSource "sound/jump.wav" "static")) ;; Returns a pair, (x, y) that represents the player's next position, assuming ;; that it did /not/ collide with anything. The role of collision detection, and @@ -69,6 +70,7 @@ (fn jump [player] (tset player :action :jump true) (when (> 10 (math.abs (. player :y-vel))) + (: jump-sfx :play) (tset player :y-vel (- (. player :goal-y-vel))))) (fn bounce [player x-normal y-normal] |