How do I make better WASD + mouse movement

Get help using Construct 2

Post » Fri May 22, 2015 11:01 am

I made my own WASD + mouse movement:
- player looks in the direction of mouse pointer,
- W moves towards mouse pointer
- S moves backwards mouse pointer
- A and D moves sideways (strife)

Have a try (please open in new tab): https://dl.dropboxusercontent.com/u/17601731/forum/c2/wasd_movement/index.html

But there's 2 problems with this movement:

1. In situation like this:
Image
When pressed W - player (red arrow) goes towards mouse pointer (blue X). Green path shows direction.
When player collides with the wall (black rectangle) it stops. I'd like him to slide along the wall.

2.In situation like this:
Image
When I rotate my player:
Image
He gets stuck, because bounding boxes overlaps.

CAPX: https://dl.dropboxusercontent.com/u/17601731/forum/c2/wasd_movement.capx

How to modify this movement to fix those problems. Or maybe you know any plugin that would give me same functionality without those problems?
B
55
S
14
G
10
Posts: 287
Reputation: 7,677

Post » Fri May 22, 2015 11:21 am

Add the Solid behaviors to your walls. Use the 8Direction behavior for your "ship".
This should exactly do what you're looking to achieve.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
289
S
112
G
94
Posts: 7,333
Reputation: 69,293

Post » Fri May 22, 2015 5:54 pm

How to strafe (A and D) with 8Direction?
B
55
S
14
G
10
Posts: 287
Reputation: 7,677

Post » Fri May 22, 2015 6:42 pm

Set angle to no ?
Be sure to check the behavior's manual article.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
289
S
112
G
94
Posts: 7,333
Reputation: 69,293

Post » Fri May 22, 2015 6:56 pm

Im familiar with manual. Unfortunately it's not doable with 8Direction. Have you tried or are you only guessing?
Please note that player is moving at various directions (360 degrees), not only 8.
B
55
S
14
G
10
Posts: 287
Reputation: 7,677

Post » Sun May 24, 2015 5:25 pm

I'd like to ask if anyone has idea how to solve this?
B
55
S
14
G
10
Posts: 287
Reputation: 7,677

Post » Sun May 24, 2015 6:17 pm

If you used custom movement to recreate your movement you could use push out solid..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi, senecaa and 22 guests