Update #11
Added Features
- added puzzle side menu
- added puzzle streak counter
- skip retry hint puzzle buttons
- sucess rate puzzle counter
- sound effect for hovering button
- puzzles are basically done
Fixed Bugs
- 3 fold occured in puzzle mode if you made the same wrong move 3 times
- same thing with 50 move rule as 3 fold
- puzzle would start with you instead of the computer
- swaps turn on failed move
- animations didn’t work in puzzles
- fixed you can select the opponent’s pieces in the puzzle during animation
- if you hit a frameperfect from the animation finishing on the puzzle screen and switch to the game screen it moves the piece in the game screen if there was a piece on the starting tile
- same bug with next puzzle button
- leaves sfx looped infinitely
Smart Bool
I added a new datatype to make my life easier called a smartbool, this is basically a boolean with a third state called NewTrue which is only true for the first cycle the boolean is updated to true. This boolean is useful for when you want to play a sound effect on hover but if you use a traditional boolean it will play every frame. you can use it like a normal boolean too like smartbool = true; or if (smartbool){}. But this new datatype makes the code easier to understand for me.
struct smartbool {
enum State {
False,
NewTrue,
True
};
State state = False;
void operator=(bool value) {this->set(value);}
operator bool() const {return state != False; }
bool is_new_true() const { return state == NewTrue; }
void set(bool value) {
if (value) {
if (state == False) state = NewTrue;
} else {
state = False;
}
}
void update() {
if (state == NewTrue) {
state = True;
}
}
};
Future Ideas
- clock
- bots
- variants
- more moving graphics/sfx
- randomize leaves on borders
- menu transitions (maybe)
- finish polishing puzzles (pretty much done)
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.