Angle

Discuss scenes and videos made with Algodoo.

Angle

Postby icrls984 » Mon May 26, 2014 5:03 am

I'm making a scene with a box spawner, but I don't know how to spawn the boxes with angles pointing toward my mouse. Is there an easy way to do this?
.
User avatar
icrls984
 
Posts: 80
Joined: Thu Jun 13, 2013 6:33 am

Re: Angle

Postby Kilinich » Mon May 26, 2014 9:25 am

Yes, np.
app.mousePos - mouse coordinates
pos - your box spawn pos

angle := {a := pos - app.mousePos; math.atan(a(1) / a(0))}
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: Angle

Postby icrls984 » Tue May 27, 2014 2:14 am

Thank you!
.
User avatar
icrls984
 
Posts: 80
Joined: Thu Jun 13, 2013 6:33 am


Return to Scenes

Who is online

Users browsing this forum: No registered users and 1 guest

cron