examples rpg

Get help using Construct 2

Post » Mon May 06, 2013 7:36 am

@TL22 but you only want it when they click, you don't want it to follow the mouse unless the mouse click is hit or held down.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,428

Post » Mon May 06, 2013 3:08 pm

@BluePhaze there's no need for more than the player object and the mouse coordinates no matter how you do it.

Say you have 8direction behavior.

[code]+ Mouse Left Button Down
++ Mouse.X > Player.X
--> Simulate Control Right
++ Mouse.X < Player.X
--> Simulate Control Left
++ Mouse.Y > Player.Y
--> Simulate Control Down
++ Mouse.Y < Player.Y
--> Simulate Control Up[/code]

Bullet Behavior and Custom Movement are even simpler:
[code]+ Mouse Left Button Down
-> Set Angle of Motion: angle(Player.X, Player.Y, Mouse.X, Mouse.Y)
-> Set Speed: Player.Speed[/code]

Of course you can get more complex with the movements, or find other ways of doing it. But you don't ever need more than the Mouse.X or Mouse.Y for mouse based movement.
B
58
S
20
G
7
Posts: 305
Reputation: 8,804

Post » Mon May 06, 2013 4:03 pm

Good point, that is more efficient. Then if you needed that data to persist for any reason you could just drop the last X,Y coordinates into a variable and store them
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,428

Post » Mon May 06, 2013 5:24 pm

finding a way for me so far has slozhno.esli explanatory tutorial I would posmotrel.a at the expense of mouse clicks I figured, thank you, but I have 8 directions, and I did not get a sprite animation in 8 directions, how to do it? if I make the motion on the keyboard then everything works, but when you click neraboaet, there may be a formula that would be needed when the sprite has been rotated 45 degrees to play a certain animatsiya.aot what my problem is.
B
15
S
6
G
1
Posts: 46
Reputation: 2,753

Post » Mon May 06, 2013 7:41 pm

Thank you TL22! as at 8 direction movement make animatsiya0ved each sprite position to play one of 8 animatsiy.umenya not work.
B
15
S
6
G
1
Posts: 46
Reputation: 2,753

Post » Wed May 08, 2013 4:19 am

Thank you all for your help! I found a great example on the forum, he said silvereonGame.esli interesno.Personazh who go to where the mouse clicked and plays the desired animatsiya.vse very simple turns out to)))
B
15
S
6
G
1
Posts: 46
Reputation: 2,753

Previous

Return to How do I....?

Who is online

Users browsing this forum: fredriksthlm, MPPlantOfficial and 25 guests