Bullet objects escaping past solid objects

Discussion and feedback on Construct 2

Post » Tue Oct 23, 2012 11:59 am

Hello everyone!

I'm using Construct 2 in my IT classes and while playing around for a few new projects / assessments I stumbled across an odd behaviour.

I noticed this behaviour in two games. One game is a classic breakout / arkanoid clone, the other one a a simple "click on a moving square" game.

In both cases there is a sprite with bullet behaviour and "bounce of solids" enabled. It is contained by solid sprites so that it bounces of the walls.

What happens is that the sprite with bullet behaviour "escapes" and goes of the screen. This happens usually in the corners. The attached text.capx speeds up the sprite so that the behaviour can be observed quickly.

It happens in the breakout / arkanoid game as well, but you need to play quite some time.

Is there a better way of creating the layout for such games?


Posts: 23
Reputation: 1,038

Post » Tue Oct 23, 2012 2:54 pm

Games typically run at 60 FPS, and suppose your object is moving at 10,000 pixels per second by the time it hits the wall (since in your example it accelerates by a factor of 50% every tick, since you've disabled the condition on the first event). This means every frame it is jumping about 166 pixels. This is enough to step right over the 64x64 barriers.

You simply have to avoid moving objects at extreme speeds like this, because the engine can't collision test them accurately enough.
Scirra Founder
Posts: 22,949
Reputation: 178,544

Post » Tue Oct 23, 2012 10:51 pm

But it does happen at lower speeds. I saw it happen in my breakout / arkanoid game. It just takes a lot longer to happen. And it's always the corners where the ball escapes.

It never goes out the top, bottom or sides, always in the corners. I'll see if I can find a better way to replicate the issue.

EDIT: Having much larger collision sprites does resolve the issue :) So I will just do that. Mau1wurf19772012-10-23 23:59:12
Posts: 23
Reputation: 1,038

Return to Construct 2 General

Who is online

Users browsing this forum: shinichild and 19 guests