I think I have the right idea, just my calculation is wrong .. or I am fully wrong.
playerangle is the angle the player is at ;)
I thought I could transfer the angle of the player to a gradient, hasn't worked.
1 2 3 4 5 6 | local bullet = display.newCircle(player.x+10,player.y, 10) physics.addBody(bullet, {filter = bulletFilter}) bullet:setFillColor(255,0,0) bullet:setLinearVelocity( math.tan(playerangle), 1 ) transition.to(bullet, {time = 1000, onComplete = function(self) self.parent:remove(self); self = nil; end }) |