New Game: (WIP) Make Like A Tree and Leaf

I have to start doing it!

1 Like

Hey @Freddicus just tried your game, and i have a bunch of blinks flashing. Can’t start the game. Am I doing something wrong?

1 Like

You are brave! I don’t have a dev kit, yet and I have been coding blindly! I appreciate you trying it out - you’re the first! I will take that knowledge and try to fix my code. Nothing should be blinking at the outset of the game :sob:

I mean, is not a blinking, is a slow fade in fade out :wink:

1 Like

Have you tried double-clicking one to turn it into soil? I attempt to explain the build process in the readme.

Yep, double click merged to some blinks, double click alone, triple click, wait 5 seconds, wait 10 seconds, nothing, just the slow fade on all blinks, any difference on them.

Want a video or gif? if it helps you i can do it :wink:

That’s super gracious. If it’s no trouble, then sure - I would definitely appreciate that. :slight_smile:

1 Like

Thanks for that. I’m wondering why my very first logic is not executing. I suspect that I should remove the isAlone() call. Maybe it doesn’t return true if there have never been any messages received on any of the faces…

I think I know where your code is failing:

You added TWO if (isAlone()) {

So only the lastone is happening!?? (Maybe, i’m not sure, but sounds ok for me)

I mean, you have inside gameStatePlaying() one isAlone() at the end BUT, then, the game jumps to the state NONE, once is doing the loop playingNone(), you end up with two isAlone() in your main loop, so im guessing the game is doing always the lastone (is the same case when you have two setColor(), only the lastone is applied).

Edit: WRONG!!!

Is because once you turn into SOIL, the code keeps working and turn again into NONE.

Copy paste of your code:
if (isAlone()) {
blinkState = BlinkState::NONE;
}

Perfect, NONE state.

Then DoubleClick
if (isAlone() && buttonDoubleClicked()) {
blinkState = BlinkState::SOIL;
soilTimer.set(SOIL_PLAY_TIME_MS);
return;
}

Perfect, SOIL state, BUT, then the:
if (isAlone()) {
blinkState = BlinkState::NONE;
}
Is acting again and go again into NONE state.

I think is that the problem…

1 Like

isALone() returns true if all the face timers are expired. And they start as expired so it should work ok even if the Blink never connected to any other Blink. Are you sure playingNone() is being called?

1 Like

This is correct. This is what happens when I code across 20+ after-midnight sessions. :sweat_smile: I need to come up with something else to reset the state or it might not be necessary to do so. I’m going to delete that block. Thanks!