use enterFrame(again)

The following function determines the angle between the bodies:

function dubrLibrary.getAngle (a,b)

return math.atan2(a.y - b.y, a.x - b.x) / math.pi * 180;

end

The following function moves the object according to the obtained direction:

function dubrLibrary.MoveAngle (a,angle)

    a.dx=math.cos(math.rad(angle));

    a.dy = math.sin(math.rad(angle));

    a.x =a.x + a.dx/2;

    a.y =a.y + a.dy/2;

    

end

here is the code:

local dubrLibrary = require “dubrLibrary”;

local player = display.newRect( w/2, h/2, 15, 15 )

local function Move (event)

local touch = {x = event.x,y = event.y};

if event.phase == “began” then

player.rotation = dubrLibrary.getAngle(player,touch)                                     here is the very lack of understanding (ignorance or otherwise)

dubrLibrary.MoveAngle(player,dubrLibrary.getAngle(player,touch))

end

end

Runtime:addEventListener(“touch”,Move)

how to use the “enterFrame” in MoveAngle in Move?

instead of the smiley angle 

Hi @super.dub20157

Our forum rules ask that you only ask your question once. This is basically the same post as:

https://forums.coronalabs.com/topic/68422-use-enterframe/

If you’re not getting the answers you expect on your original post, you can “bump” your post (re ask for help) no more than once per day to bring the post back to the top.  In your original post, you used code formatting which was good. In this one you did not, we encourage you to always use code formatting.

I’m going to lock this thread. Anyone wanting to respond, please do so on the other thread:

https://forums.coronalabs.com/topic/68422-use-enterframe/

Rob

instead of the smiley angle 

Hi @super.dub20157

Our forum rules ask that you only ask your question once. This is basically the same post as:

https://forums.coronalabs.com/topic/68422-use-enterframe/

If you’re not getting the answers you expect on your original post, you can “bump” your post (re ask for help) no more than once per day to bring the post back to the top.  In your original post, you used code formatting which was good. In this one you did not, we encourage you to always use code formatting.

I’m going to lock this thread. Anyone wanting to respond, please do so on the other thread:

https://forums.coronalabs.com/topic/68422-use-enterframe/

Rob