Help with sprite following mouse

Get help using Construct 2

Post » Thu Nov 21, 2013 12:54 am

I have a player sprite and a solid object sprite.

To make the player follow the mouse, I have:

Every tick
-> Set Angle Toward Mouse
-> Set Bullet Speed based on distance between sprite and mouse

The bullet behavior includes bouncing off solids, and the wall is a solid. The collision happens just fine, the issue is when the player approaches the wall at an angle such that he is nearly parallel to the wall, the sprite speeds up and slides along the wall much faster than normal.

My guess is there's just a better way to do it. What should I change or look into? I can't find any solutions other than this and using move forward instead of bullet (but then I don't know how to make it collide at all)
B
3
Posts: 2
Reputation: 179

Post » Thu Nov 21, 2013 1:20 am

Do you have a .capx file we could take a look at?
B
11
S
2
Posts: 87
Reputation: 1,112

Post » Thu Nov 21, 2013 1:34 am

I'm getting a message saying I'm not allowed to post URLs. How can I get this to you?

Edit: Here, maybe this will work: https[colon]//www.dropbox.com/sh/jthzfdbfpv9f3n8/F9O6S_uHY-rstevoa2013-11-21 01:36:53
B
3
Posts: 2
Reputation: 179

Post » Thu Nov 21, 2013 1:38 am

@rstevoa

I would guess we'd have to see the cap file to know for sure, but I'd check the settings on the bullet behavior, too. Is 'set angle' on/off? Try it with either and see what happens. Also, check your collision boxes in the sprites, as any overlap plays havoc with bullet behavior.

You can set to detect collisions manually, too, without any behavior. Try adding a 'On Collision' event without the bullet behavior and alter the angle on collision; the 'Move Forward' action moves it in accordance with the angle.
B
16
S
6
G
2
Posts: 152
Reputation: 3,764


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 14 guests