Changing zoom of layout affects Set Angle Towards

Get help using Construct 2

Post » Sat Feb 23, 2013 7:38 am

.CAPX: https://www.sugarsync.com/pf/D6025908_4317202_6502596

I'm working on the top-down shooter tutorial made by @Ashley to see if I could figure out another issue I'm working out (a totally different game).

I started messing around with some features and discovered you could adjust the "zoom" level by changing the layer scale (in my .capx above, you press A to "zoom in" and D to "zoom out". The zooming works fine, but...

If you're familiar with Ashley's tutorial, you know that the Player (Hero in my .capx) sprite is supposed to set its angle toward the Mouse X/Y coordinates. When the layer scale (or "zoom") is 1, that works swell. However, changing the zoom levels (up or down) affects the sprite's ability to track the mouse properly...it's tracking, but, oddly. I don't understand why. At least, I have a notion but I can't explain it, let alone figure out a solution.

I'd definitely like to incorporate a zoom option in future games... Anyone have feedback on what's going on? If so, I may be able to figure out a work-around. Proposed solutions are welcome, of course.
THANK YOU!
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
113
S
20
G
8
Posts: 741
Reputation: 13,661

Post » Sat Feb 23, 2013 11:42 am

Use Mouse.X(0), Mouse.Y(0)
or Mouse.X("layername"), Mouse.Y("layername")
to get the mouse coordinates on the scaled layer.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Sun Feb 24, 2013 2:51 am

@ramones - You win the award for awesome-est helper of the day. Thank you, sir!
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
113
S
20
G
8
Posts: 741
Reputation: 13,661


Return to How do I....?

Who is online

Users browsing this forum: alextro, MarkStockley and 0 guests