Movement weird when scrolling

Get help using Construct 2

Post » Sun Apr 29, 2012 4:28 am

I want to control a character with WASD and when you press the sword, you aim and slash with your mouse. Everything worked until I added a scrolling function and my sword aiming just went bonkers.

So, basically when you press the sword the arrow should always point to the mouse cursor. Because of the scrolling, it doesn't behave like that and I can't figure out why that is.

Anyone have a clue to what's going on here?

http://dl.dropbox.com/u/4898391/zig_03.capx

Thanks:)Julmust2012-04-29 04:33:04
B
16
S
6
G
6
Posts: 100
Reputation: 4,840

Post » Sun Apr 29, 2012 4:33 am

I had a look and didnt really see what you meant, the sword attack seems to work ok for me. One thing i noticed though was that your sword (the sword you click to unsheath and then you have the ability to attack) needs to be on a UI layer (so it doesnt move when the scroll screens and instead is on the screen wherever the player walks).

How to make a UI layer is covered in the early tutes.
ImageImage
B
73
S
16
G
6
Posts: 1,038
Reputation: 10,473

Post » Sun Apr 29, 2012 4:35 am

Heh yeah sorry. I'm a bit loopy after beating at it all day.

So, when you "unsheathe", I want the arrow to always point to the mouse pointer. As if the character is strafing around the mouse pointer. It works great when the screen scrolling is not there.

Thanks for the GUI tip, been trying to figure out how to do that :)Julmust2012-04-29 04:35:50
B
16
S
6
G
6
Posts: 100
Reputation: 4,840

Post » Sun Apr 29, 2012 4:55 am

Ahh i see what you mean now, no worries.

In the part where you set your arrow :

it needs to be "angle(player.X,player.Y,mouse.X,mouse.Y)"

instead of "angle(player.X,player.Y,mouse.AbsoluteX,mouse.AbsoluteY)"
ImageImage
B
73
S
16
G
6
Posts: 1,038
Reputation: 10,473

Post » Sun Apr 29, 2012 4:57 am

Oh scheisse! :)

Thanks man!
B
16
S
6
G
6
Posts: 100
Reputation: 4,840

Post » Sun Apr 29, 2012 4:58 am

Haha, no worries :)
ImageImage
B
73
S
16
G
6
Posts: 1,038
Reputation: 10,473


Return to How do I....?

Who is online

Users browsing this forum: Artpunk, NRABrazil, PixelatedTrip and 27 guests