How do I Make a wall, my cursor cant pass

Get help using Construct 2

Post » Sat Dec 13, 2014 1:28 am

How do i make a wall that my cursorsprite can not pass, Like this game: Http: // www . cursors . io


I can make the cursor stop, but its inside the wall, so i have no way of getting it again..

Image
B
5
Posts: 15
Reputation: 259

Post » Sat Dec 13, 2014 3:19 am

test the collision before you reach the wall , maybe it's a stupid idea , but give it a try , make invisible object before the wall and test collision on it not the actual wall
B
12
S
6
Posts: 118
Reputation: 1,466

Post » Sat Dec 13, 2014 4:07 am

warville wrote:test the collision before you reach the wall , maybe it's a stupid idea , but give it a try , make invisible object before the wall and test collision on it not the actual wall


Ive tried, it works for moving the mouse slowly, but when your moving it fast, you clip through the wall, cause construct cant test it fast enough
B
5
Posts: 15
Reputation: 259

Post » Sat Dec 13, 2014 4:19 pm

If cursor hits wall stop
if cursor is beyond wall move cursor back to the wall and stop
if mouse movement direction is away from wall then release cursor to move
B
21
S
5
Posts: 196
Reputation: 1,984

Post » Sat Dec 13, 2014 6:47 pm

You cant move the actual cursor in construct from what i can tell, and how do i know what direction the cursor is coming from :/
B
5
Posts: 15
Reputation: 259

Post » Sat Dec 13, 2014 7:54 pm

Try to make object and attache cursor on him and them to cursor (if that possible), always. And that object have collision enabled... Not sure...
B
6
S
1
Posts: 34
Reputation: 474

Post » Sat Dec 13, 2014 8:11 pm

I think its a problem with how the cursor moves, is there any way to make a quick responsive cursor, that can not pass through solids? ive tried, custom movement, pathfinding, setting x/y to mouse.x/y, It just wont react to the solids, in a very responsive way...
B
5
Posts: 15
Reputation: 259

Post » Sat Dec 13, 2014 9:04 pm

Well, you could do this w/ my mouse lock plugin. Keep in mind: this only works in Firefox and Chrome; IE support is coming for IE12.

The most recent version is 0.5. DL v0.3 too; it has a test capx and documentation:

viewtopic.php?f=153&t=102112&p=772527#p772527
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Sat Dec 13, 2014 9:14 pm

ive tried, being the noobie i am, i did not understand most of it, this is what ive got right now.. but it still clips through the wall if your going fast enough with the cursor..

Image

Image
B
5
Posts: 15
Reputation: 259

Post » Sat Dec 13, 2014 9:50 pm

It doesn't look like you are binding the mouse, just turning it invisible. Is that the approach you prefer? It's actually quite clever, since it will work in any browser.

Mouse-lock would work better, but won't work in IE until IE12. You could try to integrate a mouse lock approach, and defer to your original solution where mouse lock isn't supported (you can test that w/ my plugin).
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests