player box collision issue

Get help using Construct 2

Post » Fri Jun 02, 2017 9:10 am

Hi guys, I have a problem with the collision of a sprite used as a "player box".
When I go to the walls, not always the collision is perfect. Most often stops at a few pixels from the edge, and just holding down the direction against the wall, or trying to detach me and go back to the wall, it resolves with a perfect collision. This is giving me so much trouble, is there a way to overcome the problem? I point out that the box is a perfect square with "bounding box" collision and NOT "polygon", and the walls too are perfectly square with the "solid" behavior activated.
Every help would be highly appreciated
this is a link to download a sample capx with the issue
https://drive.google.com/open?id=0BwNG7 ... DhhemZGZWs
Image
Last edited by NN81 on Fri Jun 02, 2017 5:01 pm, edited 2 times in total.
B
11
S
6
G
2
Posts: 210
Reputation: 2,560

Post » Fri Jun 02, 2017 11:21 am

What exactly you want to do? Make the player touch the wall perfectly, or make the player stay a few pixel's away from the wall?
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,357

Post » Fri Jun 02, 2017 11:41 am

imhotep22 wrote:What exactly you want to do? Make the player touch the wall perfectly, or make the player stay a few pixel's away from the wall?

i want a perfect always 100% guaranteed collision between the box and the wall edge.
B
11
S
6
G
2
Posts: 210
Reputation: 2,560

Post » Fri Jun 02, 2017 12:38 pm

I do not know how you planed your events, but if you use sprite for the player, try reducing the collision polygons a bit, until the sprite perfectly snaps in the background.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,357

Post » Fri Jun 02, 2017 1:01 pm

imhotep22 wrote:I do not know how you planed your events, but if you use sprite for the player, try reducing the collision polygons a bit, until the sprite perfectly snaps in the background.


The question is simple, and has nothing to do with how I put 2 simple events, it is a perfect square sprite that collides with other perfectly square sprites and occasionally occurs the problem of the attached photo above.
I think it's probably a bug of the tool on the collision management, but maybe someone knows a way to fix it..

@imhotep22 try the capx, no events.
https://drive.google.com/open?id=0BwNG7 ... DhhemZGZWs
B
11
S
6
G
2
Posts: 210
Reputation: 2,560

Post » Fri Jun 02, 2017 3:34 pm

any help about this prob?
B
11
S
6
G
2
Posts: 210
Reputation: 2,560

Post » Fri Jun 02, 2017 3:50 pm

NN81 wrote:any help about this prob?

There is a verry simple solution. Open the collision box of the box. And subtract or add to every Point about 3. So the collision is a Little bit smaller than it should be. Worked fine.
I hope i helped you
Cryttexx
(We are so near to the Prototype Realess ;) )
My Project at this time: robottory-2d-platformer-devlog_t190807



(Sorry for my english. I know it is not the best)
B
12
S
7
G
4
Posts: 102
Reputation: 3,046

Post » Fri Jun 02, 2017 4:15 pm

Cryttexx wrote:
NN81 wrote:any help about this prob?

There is a verry simple solution. Open the collision box of the box. And subtract or add to every Point about 3. So the collision is a Little bit smaller than it should be.


My friend is not as easy as it seems, the problem is not for a graphic aspect, in fact the player box puts it invisible to sketch the Player's graphics above. The problem is in the mechanical logic of the collision, because instead of detecting collision ON and stop, the tool detects collision ON, then OFF, then ON / OFF etc., you can see if you put an event that when the BOX collides with the wall adds 1 to a variable X. If you do it you will realize that when you go with the BOX against the wall the value of the variabe does not rise by one and then it stops but it also rises by 3/4 units if I hold down the key to send the box to the bottom :|
B
11
S
6
G
2
Posts: 210
Reputation: 2,560

Post » Fri Jun 02, 2017 4:39 pm

I dont understand what your problem is. There is a logical mistake. Ok. But is this as important for your game? I think no. So your first problem that the box is not direct at the wall is solved. So your problem is that there is just a logical mistake. I would play around with it, but i dont have the time. Sorry
Cryttexx
My Project at this time: robottory-2d-platformer-devlog_t190807



(Sorry for my english. I know it is not the best)
B
12
S
7
G
4
Posts: 102
Reputation: 3,046

Post » Fri Jun 02, 2017 4:54 pm

the problem in my game is strictly related to this collision issue, I have preferred to go to the source of the problem so that it does not give rise to misunderstanding or evasive reasoning about it.
once it resolves this the rest I can fix it by myself ^^
B
11
S
6
G
2
Posts: 210
Reputation: 2,560

Next

Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 1 guest