tank
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
Ground = {}
|
||||
class("Ground").extends(Graphics.sprite)
|
||||
|
||||
local groundImage = playdate.graphics.image.new("assets/sprites/groundFin")
|
||||
local groundImage = Graphics.image.new("assets/sprites/groundFin")
|
||||
|
||||
function Ground:init(x, y, player)
|
||||
Ground.super.init(self, groundImage)
|
||||
@@ -24,6 +24,12 @@ function Ground:setMoveSpeed(speed)
|
||||
end
|
||||
|
||||
function Ground:update()
|
||||
|
||||
-- Stop ground
|
||||
if Ground.moveSpeed == 0 then
|
||||
return
|
||||
end
|
||||
|
||||
-- Speedup when player is moving right
|
||||
if Ground.player.isMovingRight() == false then
|
||||
Ground.moveSpeed = 0.2
|
||||
|
||||
Reference in New Issue
Block a user