summaryrefslogtreecommitdiff
path: root/examples/platformer/main.lua
diff options
context:
space:
mode:
authorjussi2022-05-27 17:53:48 +0300
committerjussi2022-05-27 17:53:48 +0300
commit381adb3ba2e1c668bf29f95b8356ac8a859e0f3e (patch)
treed9be867383f7734a26582cbaadcd912d47f85a29 /examples/platformer/main.lua
parentacad17965dee43816200b889f98f04f6ff80a939 (diff)
downloadreilua-enhanced-381adb3ba2e1c668bf29f95b8356ac8a859e0f3e.tar.gz
reilua-enhanced-381adb3ba2e1c668bf29f95b8356ac8a859e0f3e.tar.bz2
reilua-enhanced-381adb3ba2e1c668bf29f95b8356ac8a859e0f3e.zip
Iqm test.
Diffstat (limited to 'examples/platformer/main.lua')
-rw-r--r--examples/platformer/main.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/platformer/main.lua b/examples/platformer/main.lua
index bc0023a..41254b7 100644
--- a/examples/platformer/main.lua
+++ b/examples/platformer/main.lua
@@ -9,7 +9,7 @@ local PLAYER_ACCELL = 5
local PLAYER_DEACCELL = 5
local GRAVITY = 6
local JUMP_STR = 3
-local WALK_ANIM_SPEED = 8
+local WALK_ANIM_SPEED = 12
local tex = RL_LoadTexture( RL_GetBasePath().."../resources/images/arcade_platformerV2.png" )
local res = Vec2:new( 160, 144 )
@@ -37,7 +37,7 @@ local player = {
onFloor = false,
frames = {
{ 6, 14, 20, 18 },
- { 39, 14, 20, 18 },
+ { 39, 13, 20, 19 },
{ 70, 14, 20, 18 },
{ 6, 45, 20, 18 },
{ 38, 45, 20, 18 },
@@ -269,7 +269,7 @@ local function drawPlayer()
if math.abs( player.vel.x ) < 0.1 then
player.curFrame = 1
else
- player.animPos = player.animPos + WALK_ANIM_SPEED * math.abs( player.vel.x ) * RL_GetFrameTime()
+ player.animPos = player.animPos + WALK_ANIM_SPEED * ( math.abs( player.vel.x ) / PLAYER_MAXSPEED ) * RL_GetFrameTime()
local frame = math.ceil( player.animPos )
if #player.walkAnimFrames < frame then