diff --git a/stages/tank.lua b/stages/tank.lua index 8986d3f..1087ef0 100644 --- a/stages/tank.lua +++ b/stages/tank.lua @@ -2,7 +2,6 @@ local myTypes = require("modules.types") local rollingBGTank local bgTankX = 200 local bgTankY = 50 -local bgTankRotate = 0 local watchtower, audience1, audience2, audience3, audience4, audience5, audience6 return { @@ -57,10 +56,9 @@ return { rollingBGTank = myTypes.Sprite("sprites/tank/tankRolling.png", "sprites/tank/tankRolling.json") rollingBGTank:PlayAnimation("BG tank w lighting instance 1", 24, true) - rollingBGTank.position = myTypes.Vector2(bgTankX, bgTankY) rollingBGTank.modifier = 0.5 rollingBGTank.layer = -3 - rollingBGTank.rotation = bgTankRotate + rollingBGTank.flipX = true local tankGround = myTypes.Image("images/tank/tankGround.png") tankGround.position = myTypes.Vector2(-420, -150) @@ -124,9 +122,11 @@ return { end, --zero fucking idea what im doing - onUpdate = function(dt) - bgTankX = math.sin(math.rad(1)) * 200 - bgTankY = math.cos(math.rad(1)) * 200 - bgTankRotate = bgTankRotate + 10 + onUpdate = function(dt, elapsed) + bgTankX = math.cos(math.rad(elapsed / 1000)) * 200 + bgTankY = math.sin(math.rad(elapsed / 1000)) * 200 + bgTankRotate = elapsed / (1000 * 20) + rollingBGTank.position = myTypes.Vector2(bgTankX, bgTankY) + rollingBGTank.rotation = -bgTankRotate end } \ No newline at end of file