diff --git a/sonic-boost.love/scenes/subgame/sonic-boost/actors/character.lua b/sonic-boost.love/scenes/subgame/sonic-boost/actors/character.lua index 82b8565..7b78afa 100644 --- a/sonic-boost.love/scenes/subgame/sonic-boost/actors/character.lua +++ b/sonic-boost.love/scenes/subgame/sonic-boost/actors/character.lua @@ -23,7 +23,7 @@ local Character = Entity:extend() function Character:new(charcontroller, rail, character, id) self.charcontroller = charcontroller - local world = self.charcontroller.controller.world + local world = self.charcontroller.controller.world local rail = rail or 2 @@ -46,8 +46,8 @@ function Character:new(charcontroller, rail, character, id) self.isInAction = false self.canAction = true - self.dash = false - self.dashCam = false + self.dash = false + self.dashCam = false self:setDebugColor(0, 255, 0) @@ -65,16 +65,16 @@ function Character:new(charcontroller, rail, character, id) self.life = 3 - self.startx = self.x - self.starty = self.y + self.startx = self.x + self.starty = self.y self.view = {} self.view.x = self.x self.view.y = self.y self.view.dx = 0 - self.relx = 0 - self.relxspeed= 0 + self.relx = 0 + self.relxspeed = 0 self.grind = false @@ -130,10 +130,10 @@ function Character:sideSteps() else if (self.keys["up"].isDown) then self.yspeed = - 1 * 60 * phys.side - self.ymove = true + self.ymove = true elseif (self.keys["down"].isDown) then self.yspeed = 60 * phys.side - self.ymove = true + self.ymove = true else self.ymove = false end @@ -152,16 +152,16 @@ end function Character:jumpAction() if self.data.stats.jumpaction == "doublejump" then if (self.keys["A"].isPressed) and (self.isJumping) and (self.canAerialAction) then - self.zspeed = 60 * self.data.stats.jumpaction_power + self.zspeed = 60 * self.data.stats.jumpaction_power self.isInAerialAction = true - self.canAerialAction = false + self.canAerialAction = false end elseif self.data.stats.jumpaction == "jumpdash" then if (self.keys["A"].isPressed) and (self.isJumping) and (self.canAerialAction) then - self.zspeed = 60 * 1 - self.xspeed = math.max(self.xspeed, self.data.stats.spd * 60 * 1.2) + self.zspeed = 60 * 1 + self.xspeed = math.max(self.xspeed, self.data.stats.spd * 60 * 1.2) self.isInAerialAction = true - self.canAerialAction = false + self.canAerialAction = false self.dashCam = true self:addTimer("dashCam", .5) end @@ -171,12 +171,12 @@ end function Character:normalAction() if self.data.stats.action == "spinattack" then if (self.keys["B"].isPressed) and (self.onGround) and (self.canAction) and (self.grind == false) then - self.xspeed = math.max(self.xspeed, self.data.stats.spd * 60 * 1.5) + self.xspeed = math.max(self.xspeed, self.data.stats.spd * 60 * 1.5) self.isInAction = true - self.canAction = false + self.canAction = false + self.dashCam = true self:addTimer("action", .5) self:addTimer("action_cooldown", 1) - self.dashCam = true self:addTimer("dashCam", .5) end end @@ -377,10 +377,10 @@ function Character:snaptoRails(dt) local newyrail = math.floor((centery + self.yspeed*dt - 10) / 20) if (newyrail < 0) and (self.yspeed < 0) then - centery = 10 + centery = 10 self.yspeed = 0 elseif (newyrail >= 4) and (self.yspeed > 0) then - centery = 90 + centery = 90 self.yspeed = 0 else if (self.ymove == false) and (yrail ~= newyrail) then @@ -509,14 +509,14 @@ function Character:die() if self.life == 0 then self.charcontroller:die() else - self.life = self.life - 1 - self.view.x = self.startx - self.relx = 0 - self.dash = false - self.dashCam= false - self.y = self.starty - self.z = 0 - self.rings = 0 + self.life = self.life - 1 + self.view.x = self.startx + self.relx = 0 + self.dash = false + self.dashCam = false + self.y = self.starty + self.z = 0 + self.rings = 0 end end