new cool backgroud
This commit is contained in:
@@ -2,7 +2,7 @@ Tank = {}
|
||||
|
||||
class("Tank").extends(Graphics.sprite)
|
||||
|
||||
function Tank:init(x, y, player, ground)
|
||||
function Tank:init(x, y, ground)
|
||||
self.tankImage = Graphics.image.new("assets/sprites/tank")
|
||||
self.tankImageD = Graphics.image.new("assets/sprites/tankD")
|
||||
Tank.super.init(self)
|
||||
@@ -26,8 +26,6 @@ function Tank:init(x, y, player, ground)
|
||||
})
|
||||
|
||||
-- Main properties
|
||||
Tank.moveSpeed = 2
|
||||
Tank.player = player
|
||||
Tank.ground = ground
|
||||
|
||||
self:fadein()
|
||||
@@ -49,12 +47,5 @@ function Tank:update()
|
||||
return
|
||||
end
|
||||
|
||||
-- Speedup when player is moving right
|
||||
if Tank.player.isMovingRight() == false then
|
||||
Tank.moveSpeed = 0.2
|
||||
else
|
||||
Tank.moveSpeed = 1
|
||||
end
|
||||
|
||||
self:moveTo(self.x - Tank.moveSpeed, self.y)
|
||||
self:moveTo(self.x - Tank.ground.moveSpeed, self.y)
|
||||
end
|
||||
|
Reference in New Issue
Block a user