require 'scripts.game.animation' game.motion = function(metaSprites, character, dt) game.animation(character.stand, dt) metaSprites.quad = character.stand[character.stand.currentFrame] if character.jump.higher > 0 and character.actionA == true then if character.jump.limitButtonJump == false then --[[ game.animation(character.jump, dt) metaSprites.quad = character.jump[character.jump.currentFrame] ]] character.jump.higher = character.jump.higher - dt character.jump.velocity = character.jump.velocity + character.jump.height * (dt / character.jump.higherMax) end end if character.actionLeft == true and character.actionRight == false then game.animation(character.walk, dt) metaSprites.quad = character.walk[character.walk.currentFrame] character.position.x = character.position.x - (character.velocity * dt) character.scale.x = -1 end if character.actionRight == true and character.actionLeft == false then game.animation(character.walk, dt) metaSprites.quad = character.walk[character.walk.currentFrame] character.position.x = character.position.x + (character.velocity * dt) character.scale.x = 1 end if character.actionLeft == true and character.actionRight == true then game.animation(character.stand, dt) metaSprites.quad = character.stand[character.stand.currentFrame] end if character.actionUp == true and character.actionDown == false then game.animation(character.walk, dt) metaSprites.quad = character.walk[character.walk.currentFrame] character.position.y = character.position.y - (character.velocity * dt) character.jump.ground = character.position.y end if character.actionDown == true and character.actionUp == false then game.animation(character.walk, dt) metaSprites.quad = character.walk[character.walk.currentFrame] character.position.y = character.position.y + (character.velocity * dt) character.jump.ground = character.position.y end if character.actionUp == true and character.actionDown == true then game.animation(character.stand, dt) metaSprites.quad = character.stand[character.stand.currentFrame] end end