Simple BreakOut game - destroying brick isn't working

For questions about using Classic.

Post » Sun Jan 18, 2009 7:18 pm

You could also give the ball an invisible hitbox that's slightly bigger than the ball itself. You'd have to set the position of the hitbox to the position of the ball in an always event. But then you could trigger on collisions between the hitbox and bricks. (Basically this would be like using a detector.) Maybe that's less of a detour or maybe it's more.
B
3
S
2
G
4
Posts: 271
Reputation: 2,017

Post » Sun Jan 18, 2009 9:17 pm

There are problems with both offset and invisible detectors in this case... using offset would require several conditions to check all sides of the ball, which means extra code.

And using an offset in that manner, as well as using a detector sprite, would mean that the detection area could overlap more than one brick at once, thus destroying two bricks with one hit, which would look strange.

I agree that each movement-type behavior that interacts with solids should have some sort of collision condition built into it that you could use instead of the regular "On collision" condition. Either that, or be able to utilize the regular "On collision" somehow.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Jan 19, 2009 7:19 am

I think you can destroy two bricks at once in the real breakout. Of course you have to hit right between them. So anyway I guess I'm saying I would go with a detector that extends on or two pixels beyond the ball in all directions.

Good point about the offset ... I guess I didn't really think that one through enough.
B
3
S
2
G
4
Posts: 271
Reputation: 2,017

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests