Bullet objects escaping past solid objects

0 favourites
  • 3 posts
From the Asset Store
This pack contains 10 types of bullet effects, with different shapes and colors.
  • 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?

    Phil

    dl.dropbox.com/u/93868285/test.capx

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)