Candli community forum

Bouncing off deleted objects

I have tried to create a brick-breaking game (arkanoid-style), but objects are deleted before colliders bounce off them - this means that my ball will go straight through the wall on first contact rather than bouncing off layer by layer. Is there any way to sequence the deletion to happen after the bounce?

Thanks a lot for your support!!

Deal Helger,

It is a great idea to do an arkanoid game indeed! Indeed Candli does delete objects before collisions that would trigger a deletion, as otherwise it is very hard to have a character collecting elements for example.

For the brick-breaking game, this is a problem. It could be solved by having variables in object instances. This is not supported yet, but I think it is a very useful feature so I’ll work on it right now. I’ll keep you informed of the progress.

Thanks for helping us to make Candli better!

Stéphane

Dear Helger,

Candli now supports variables through two blocks:

  • checking the value of a variable
  • setting or modifying the value of a variable

They are building on the score blocks.

With these, you can just create a variable “block needs to be destroyed” (make a drawing for it ;-)). Specifically, create the following two rules (in that order):

  • When var = 1, destroy block.
  • When colliding with ball, set var to 1.

This works because Candli evaluates the rules from top to bottom.