TetWiis Update (part 8)

It works, it works, it works!!!!

Finally today after some serious debugging sessions, it now plays like Tetris should!  The blocks drop down into place, the rotate works as it should, and as a bonus, it even clears lines when they are full, keeping score whilst doing so, and detects when you hit the top of the screen and ends the game!

There’s still much to do, including

  • Improve Block Graphics
  • Increase level every ‘x’ number of blocks
  • With level increase, increase speed of drop
  • Factor scoring system so the higher the level the more score you get
  • Factor scoring system so you get more points for 1/2/3/tetris(4) lines at the same time!

Expect videos/screenshots soon!

TetWiis update (Part 7)

So tonight I fixed some of the bugs around checking whether the squares were empty or not.

First bug was the array dimensions that hold all the squares – stupid mistake really 🙄 !  Once I’d done this, and after drawing a grid on the screen, and writing to a debug log file to check, it all seems to be going pretty well, until I tried to rotate a block on the left, and it went outside the grid, then failed the isEmpty check and stopped half way up the screen! DOH!

So I now need to fix this in the isEmpty check.

Also realised I have a memory leak.  I’m still deciding what to do about it.  It exists because I create a block to move around the screen, and a block consists of 4 squares.  Once the block stops, I create a new one, and then redraw using the squares only.

I can’t decide if I delete the block before I create a new one, what this will do to the squares that belonged to that block.  In theory they should be destructed along with it, so I think I need to just keep a growing list (linked list) of all the blocks used during a game, and then delete/destruct them at game over!

Finally, I’ve added in an offset to move the gamefield over, and I’ve also put a background in place!


TetWiis Update (part 6)

I’ve finally run a test on the Wii now after the best part of a number of days solid coding (spread over a week)

Surprisingly, things aren’t too bad!

tetwiis-wip2

It seems to actually almost play like tetris.

I need to sort out the timer so that the blocks drop automatically, and I need to adjust the offset so it doesn’t start at o,0.  There also seems to be an issue with the redraw function.  I’m not sure what but I suspect it is to do with array counts/sizes.

I’ve had it crash once or twice whilst trying it, so it’s going to take some debugging to resolve all the issues, but hey – it actually works 🙂

TetWiis Update (part 5)

I’m finally working on the game loop/engine.

I believe all the code is done to move, rotate and drop blocks.  Drop only moves one line down and you have to hold it to make it drop, though I’d like to make up do an immediate drop – shouldn’t be difficult, just something on the todo list.

I’ve just started coding the game loop events, all of which seem to be going well so far.

I expect some pain when I come to test this!