Problem with Platformer aiming toward mouse angle

Get help using Construct 2

Post » Tue Feb 05, 2013 3:06 am

Hi there,
I just started to learn Construct 2 and having a problem
I create a platform sprite and I want it to aim toward mouse angle, but limited (not 360 degree)...and I want it to mirrored instead of rotated if I aim the mouse behind the character

Well maybe it's difficult to understand what I write so I put the capx here, hopefully there's someone can help me with this

http://dl.dropbox.com/u/106980005/aimingPlatformer.capx

Thanks before r4dicaldreamer2013-02-05 03:10:40
B
12
S
3
G
4
Posts: 56
Reputation: 3,235

Post » Tue Feb 05, 2013 8:48 pm

@r4dicaldreamer - here you go, i left some notes in the capx. tag me with @wretchedshark if you need any more help

aiming platformer capx (r117)
B
14
S
6
G
2
Posts: 136
Reputation: 3,210

Post » Wed Feb 06, 2013 4:04 am

thanks a lot @wretchedshark
I'll check it out once I got home
B
12
S
3
G
4
Posts: 56
Reputation: 3,235

Post » Thu Feb 07, 2013 3:53 am

@wretchedshark - it's working, thanks for your help :)
but there's some glitch on mirroring the head and gun, it will start pointing the opposite direction before back to normal...I wonder how to fix this :\
B
12
S
3
G
4
Posts: 56
Reputation: 3,235

Post » Thu Feb 07, 2013 10:01 am

@r4dicaldreamer - when does this occur? right when you look left or right, or when the mouse is near the center point of the player or?
B
14
S
6
G
2
Posts: 136
Reputation: 3,210

Post » Fri Feb 08, 2013 3:30 am

@wretchedshark - it occurs when the head n gun mirrored by mouse aim

so let's say I'm aiming to the top left of the screen, and I drag the mouse from there to top right, slowly. The glitch occurs when the character reach the limit angle and then mirroring...try it
B
12
S
3
G
4
Posts: 56
Reputation: 3,235

Post » Fri Feb 08, 2013 11:16 am

@r4dicaldreamer - i believe it is due to the way the range is set up, if you're past the range when you switch over to the other side is just mirrors that angle.
B
14
S
6
G
2
Posts: 136
Reputation: 3,210

Post » Fri Feb 08, 2013 12:59 pm

@wretchedshark - oh I see...so I can't aim my mouse too far from the object? It's kinda problem though, because the object moves freely and you can't control your mouse to always near it. Is it any way to deal with this? I'll also try to fix this though, just in case you find the solution first :)
thanks by the way
B
12
S
3
G
4
Posts: 56
Reputation: 3,235

Post » Fri Feb 08, 2013 6:50 pm

@r4dicaldreamer - i haven't really thought of one yet, try disabling the lines that limit the range and see if that fixes it. if so you could try adding more lines for when the mouse is out of range and have it just set the angle while it's doing that and i will have a look later
B
14
S
6
G
2
Posts: 136
Reputation: 3,210

Post » Tue Feb 19, 2013 6:25 am

@wretchedshark - I've tried to make the angle fixed when the debugAngle is beyond the rotation limit, but still didn't work
I got an idea to make the new sprite for head and gun that already mirrored, so maybe if I just call the other sprite instead of mirroring the original one, there will be no glitch
or I can put it in the animation on the sprite, an call it to replace the mirror action
I'll let you know about this and upload the capx later...I forgot to save the last experiment I did, with fixed angle :(
B
12
S
3
G
4
Posts: 56
Reputation: 3,235

Next

Return to How do I....?

Who is online

Users browsing this forum: Megavolt, selaus and 0 guests