Candli community forum

How to the game with a given number of points?

I added an object 9 times. Everytime the object is touched by the player, it gets deleted and adds one point. At 9 points the game should end.
But the game over screen doesn’t appear, when it is at 9 points, while all 9 objects are deleted.

The issue could be solved by adding a 10th object (outside of player view).

Is it intended, that the code isn’t working, when there is no object in the game anymore?

Is it intended, that the code isn’t working, when there is no object in the game anymore?

Yes, the code is attached to objects. We are considering having a permanent “world object” for such cases, but it is just an idea at the moment.

I think that the problem in your case is that, for each object instance, all conditions are evaluated, then all actions are executed. So it is not possible to “detect” that the points reached 9 because at the next execution the object does not exist any more. However, you could work around that problem by using both the touch condition and a “point = 8” condition to trigger the end screen.

I am moving the issue to “Help” and updating the title as Candli works as intended here.

Ok, that’s good to know.