How do I Keep angle on touch constant?

Get help using Construct 2

Post » Sat Dec 19, 2015 8:57 pm

Not sure if that is a good title but currently I am working on a rotational shooter where the player1 ship will set angle to the touch.x/touch.Y which works great, but when I release the ship goes back to the original angle. I would like the touch.x/touch.y to become the default angle until the screen is touched again and then moves to the next angle. I am not sure if this makes any sense and my terms a noobish, because I am just starting out. Any ideas on how I can get this to work.

Also I think I would like the ship to rotate to the angle(which I can get to work with a mouse) but seem to have problems getting it to work with touch.

Thanks,
Rich
B
9
S
2
Posts: 104
Reputation: 975

Post » Sun Dec 20, 2015 1:21 am

What logic are you using? On any touch start > set angle toward touch.x,touch.y should set the angle toward the touch point and keep it facing in that direction until next touch. If you're trying to do something other than this please post .capx or link to example of what your game is doing.
B
47
S
17
G
82
Posts: 2,231
Reputation: 48,609

Post » Sun Dec 20, 2015 11:13 pm

current I am using "Is in Touch" "Set angle toward touch.x, touch.y" because when I used "any touch start" the object did not rotate or work properly. But I can give it another try.
B
9
S
2
Posts: 104
Reputation: 975

Post » Sun Dec 20, 2015 11:17 pm

What kind of other rotating or angle setting events/behaviours do you use?

While in touch it rotates towards touch, but obviously there is something else affecting the angle when there is no touch..

Maybe remove the set angle inside the movement behaviour would solve your issue..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Dec 21, 2015 1:10 am

It should work fine like that, again if any problems just post a link to the project file.
B
47
S
17
G
82
Posts: 2,231
Reputation: 48,609

Post » Wed Dec 23, 2015 1:12 am

Re-enabled the any touch start > and it does the same thing where it go to the location on the screen I touch and then just goes back to a default location. I do have mouse controls in which I am removing and testing again - WORKS! I lost the nice rotation I had with mouse controls but one step closer. Thanks, Plinkie!


Might be harder than I thought to add that nice mouse rotation :)
B
9
S
2
Posts: 104
Reputation: 975


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 29 guests