Hi, I have a set of bullet looking sprites which move to different parts of the screen, they curretly point up but Id like it so they point towards where they are going, here’s my code, also I would like the speed to remain as the x,y params below:
x = math.random(-100,100) y = math.random(-100,100) smile = display.newImageRect("Button.png", 45, 45); smile.x = display.contentCenterX smile.y = display.contentCenterY physics.addBody( smile, "dynamic" ) smile:setLinearVelocity( x, y , x,y )
The sprite would be something like the link below, so ideally if it went up itd face up, same for down, left, right, other angles etc.
http://images.clipartpanda.com/chevron-clipart-68041_119_w1-8_s_lg.gif
Another way I’m looking at it is by getting the linearvelocity and then trying to conver that into degrees
Any ideas?