Self Rotating Ship To Touch Point After Release [SOLVED]

Just started using Construct 2? Post your questions here

Post » Fri May 05, 2017 7:57 pm

Hey, guys.

Trying to add one last mechanic to the game for now, so far unsuccessfully.

http://www.darksunpictures.com/public/S ... g_Ship.zip

Basically, after touch, I would like the square (ship) to keep rotating to that angle set by the touch/mouse click.

So far you have to be In Touch for it to reach that angle.

Thought it would be more fun if the ship kept rotating on its own after touch to that touch point.
Last edited by AmpedRobot on Sat May 06, 2017 4:06 pm, edited 1 time in total.
B
37
S
20
G
18
Posts: 259
Reputation: 12,922

Post » Fri May 05, 2017 8:50 pm

Here: https://www.dropbox.com/s/sv84k4w9ra3yr ... .capx?dl=0

edit:
btw, I noticed you used anglelerp in your example. Yeah I agree it's much smoother than the 'rotate to position' which I used but the concept is the same. Just use anglelerp to the position of the beacon.
Last edited by MPPlantOfficial on Fri May 05, 2017 8:56 pm, edited 1 time in total.
Image Image Image
B
31
S
11
G
27
Posts: 748
Reputation: 17,093


Post » Fri May 05, 2017 8:57 pm

AmpedRobot wrote:Wow, thank you. Amazing.

No idea why this works, but it's great.

I'll credit you in game!!!

btw, I noticed you used anglelerp in your example. Yeah I agree it's much smoother than the 'rotate to position' which I used but the concept is the same. Just use anglelerp to the position of the beacon.
Image Image Image
B
31
S
11
G
27
Posts: 748
Reputation: 17,093

Post » Sun May 07, 2017 10:23 pm

That came from Newt, another poster :D.

Yeah, the beacons are super useful. I just used them for a zillion other things.

I think I might not have been able to solve a lot of other challenges without them. I worked out the code for the game years ago in about a month, when I switched to asset creation, but it turned out that code wasn't that great. Or maybe I just got better over the years with the learning. Works great now.

Someone once said that invisible sprites are the answer to almost everything, but at the time I had no idea it could extend that far.

The beacons should be some sort of super sticky, if they aren't already.

Thnx again!
B
37
S
20
G
18
Posts: 259
Reputation: 12,922


Return to Beginner's Questions

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest