Unbounded mouse

Get help using Construct 2

Post » Thu Jul 03, 2014 9:24 pm

Hi everyone.

I'm trying to implement a view where the entire layer rotates around the player when I move the mouse (think of it as a top-down first person shooter). I'm running into problems whenever I've rotated too much to one side and the mouse hits the border of the viewport. Whenever that happens, I can't keep rotating to that side because the engine doesn't register the mouse X position to be any greater. Is there some way of removing the boundaries on the cursor or resetting its position when it reaches the border?

This is how I'm rotating the layer, and it works (even movement works)

Image

As you see, at some point Mouse.X will reach the end of the layout (or viewport if I use AbsoluteX) and then I simply can't keep rotating in that direction. I'm wondering how other engines handle this sort of camera scheme, since first person shooters let you spin all you want in the same direction.

Cheers
B
6
S
2
Posts: 79
Reputation: 608

Post » Thu Jul 03, 2014 9:48 pm

I'm not sure what is the behavior you're trying to achieve here. Have a capx?
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
19
S
5
G
2
Posts: 544
Reputation: 3,255

Post » Thu Jul 03, 2014 9:58 pm

Does the distance to the mouse cursor matter, or just the angle? If it's just the angle, it shouldn't matter should it? The angle to the mouse will still be the same, if it just moves around the edges of the screen?
B
25
S
5
G
3
Posts: 446
Reputation: 5,633

Post » Thu Jul 03, 2014 10:03 pm

Here's a capx of the rotation only.

If you move the mouse around you'll see that the layer rotates but the player doesn't. My intent is to later only move the player in the direction he's facing (like a first person shooter). The problem is that when the mouse reaches the limit of the screen, rotation stops. I want to allow the player to rotate the layer indefinitely in the same direction and don't know how to accomplish that.
You do not have the required permissions to view the files attached to this post.
B
6
S
2
Posts: 79
Reputation: 608

Post » Thu Jul 03, 2014 10:13 pm

If I could somehow override the cursor position manually I could make it appear at the opposite edge of the window whenever it goes out of bounds, fixing the problem. Bur afaik there's no way to do that in Construct 2
B
6
S
2
Posts: 79
Reputation: 608

Post » Thu Jul 03, 2014 11:19 pm

Ah yes, the problem as you say is that when the mouse leaves the window, it's no longer tracked at all in C2 (if you track Mouse.X and Mouse.Y for example, they just 'stick' if you leave the window). There might be a solution to this, but I'd consider a different control method as it's too confusing. Or at least have the mouse cursor really prominent so it's very clear to the player that it's being used as the focal point. All I can think of, sorry.
B
25
S
5
G
3
Posts: 446
Reputation: 5,633

Post » Thu Jul 03, 2014 11:22 pm

@monitz87 You can try a different movement method, like farflamex suggested. Try out my modified version html
You do not have the required permissions to view the files attached to this post.
B
81
S
21
G
23
Posts: 515
Reputation: 18,702


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, dand, tinhofiel, Yahoo [Bot] and 29 guests