Control Angle via Mouse

Get help using Construct 2

Post » Thu May 31, 2012 7:13 pm

Hello again

does anyone of you have an idea, how to control the angle of a player directly with the left / right movement of the mouse? (like in ego-shooters)

I dont want the player just look towards the mouse position.

Thanks and best regards
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Thu May 31, 2012 10:24 pm

Not sure what you mean, no idea what an ego-shooter is!
Some sort of example image or something would be nice.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Thu May 31, 2012 10:29 pm

hey sqiddster

sorry for my english.

if the player moves the mouse left, he should turn left. same to the right. both directly. u did never play an ego shooter? the view is 2d from up.

greets

B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Fri Jun 01, 2012 3:14 am

Does ego shooter mean a 1st person shooter?

Anyway, this example the player angles toward and follows the mouse and goes faster the the farther from the mouse, etc.

butterflyFollow.capx
B
29
S
11
G
12
Posts: 281
Reputation: 11,868

Post » Fri Jun 01, 2012 9:28 am

Thanks, kittiewan.

Yes, it is a 1st person shooter with view from top.

Your solution does not help me solving this. I'll try to fit the left / right movement of the mouse directly to the angle. The problem is, how to capture the data of x-distance while moving the mouse.
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Fri Jun 01, 2012 2:04 pm

Top Down shooter then :D
A first person POV is through the eyes of the character isn't it?

Do you have a game example of what you want to do?Yann2012-06-01 14:05:09
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Sat Jun 02, 2012 7:05 pm

Hey Yann,

Yes, simple WSAD movement.
I already did the first part...angle now "follows" the change of X of a pixel, which is moved by the mouse. Just didnt find another solution yet.



But other problems keep occuring:

- the aiming stops when the mouse reached the borders of the screen.
- the aiming sometimes does not work anymore when moving the mouse outside the layout

any ideas welcome
B
15
S
3
G
5
Posts: 396
Reputation: 4,977


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, MChiz, plinkie, Radulepy and 0 guests