summaryrefslogtreecommitdiff
path: root/player.fnl
diff options
context:
space:
mode:
authorJakob L. Kreuze <jakob@memeware.net>2018-10-25 10:43:46 -0400
committerJakob L. Kreuze <jakob@memeware.net>2018-10-25 10:43:46 -0400
commite5053056ad7a223466c8e56df7b63279458d2867 (patch)
tree33a5231c1d64b114136596aa75f16e8058b1927c /player.fnl
parentc60fe418289e4eb3f058fd43bcfdd2ad17c5eac2 (diff)
Majority of gameplay is implemented at this point
Diffstat (limited to 'player.fnl')
-rw-r--r--player.fnl14
1 files changed, 10 insertions, 4 deletions
diff --git a/player.fnl b/player.fnl
index 013000a..9b8509a 100644
--- a/player.fnl
+++ b/player.fnl
@@ -75,6 +75,12 @@
(tset player :x-vel (- (* 8 x-normal) (. player :x-vel)))
(tset player :y-vel (- (math.abs (* 8 y-normal)) (. player :y-vel))))
+(fn face-upwards [player]
+ (tset player :action :sliming-up true))
+
+(fn face-normal [player]
+ (tset player :action :sliming-up false))
+
(local player-sheet
{:img (love.graphics.newImage "art/swanky.png")
:orientation-offset 128
@@ -137,9 +143,6 @@
:x-vel 0
:y-vel 0
- :cur-health 5
- :max-health 5
-
:orientation :right
:animation-x-offset 0
:animation-y-offset 0
@@ -149,7 +152,8 @@
:action {:jump false
:right false
- :left false}
+ :left false
+ :sliming-up false}
:next-position next-position
:next-x-vel next-x-vel
@@ -164,6 +168,8 @@
:stop-left stop-left
:jump jump
:bounce bounce
+ :face-upwards face-upwards
+ :face-normal face-normal
:draw draw-player
:update update-player-animations})