Re: Blockski+ , like Klotski but with a board editor.
Posted: Thursday 7th March 2024 8:52pm
Added another little side game, a bit of Tetris if yr bored
Made a number of fixes since adding the multi-select. :-/
Some internal stuff...
I added a String[][] array to the board that's a grid reference to all the blocks, each String is a list of blocks occupying that space.
This speeds thing up slightly as now i am only referencing simple strings not complete block objects.
Checking if a block exists is now all done via the map array.
This allowed for a trick that i have used for the Tetris board. the board paint method can just paint a single block tile if a string exists at any grid part, ignoring blocks on the board.
So after a block has fallen and settled it is removed without removing the reference from the grid map.
so there is only ever one block on the board , the falling one. and when a line is filled i can simply delete the String[][] array line and add a new one to the top. The block on the board match the array.
Well it's been a fun adventure.
I have not used the klotski board editor much but it's getting there slowly with regards to the mess i made when adding multi-selection.
use it carefully, (mostly just don't rely on the undo feature yet)
Made a number of fixes since adding the multi-select. :-/
Some internal stuff...
I added a String[][] array to the board that's a grid reference to all the blocks, each String is a list of blocks occupying that space.
This speeds thing up slightly as now i am only referencing simple strings not complete block objects.
Checking if a block exists is now all done via the map array.
This allowed for a trick that i have used for the Tetris board. the board paint method can just paint a single block tile if a string exists at any grid part, ignoring blocks on the board.
So after a block has fallen and settled it is removed without removing the reference from the grid map.
so there is only ever one block on the board , the falling one. and when a line is filled i can simply delete the String[][] array line and add a new one to the top. The block on the board match the array.
Well it's been a fun adventure.
I have not used the klotski board editor much but it's getting there slowly with regards to the mess i made when adding multi-selection.
use it carefully, (mostly just don't rely on the undo feature yet)