Arduino Tetris

I just this Tetris working with TVout.

Short video of me loosing:

It uses a modified version of simple tetris clone TVout: Arduino Tetris - YouTube The only modifications are some quick datatype changes (ints to chars ect) to fit with the memory constraints. This could also be easily used with a Tellymate shield if one desires with no extra effort.

I will release post the sketch when I fix a small bug that kills the input randomly.

Nice, I might have to take this and modify it slightly for my hackvision.

It was kinda on my list to do. Glad you got there first! :smiley:

Mowcius

actually this is written for a hackvision atm but changing it to work for the video game shield would be easy (i have both). The only thing is this requires the latest TVout as it uses TVouts version of millis() and the new bitmap function which is a very recent addition. All the other changes would be simple to get working on the version of TVout that nootropic has posted for the hackvision.

The simple tetris clone is a great bit of code it takes care of all the computation you are just left to code the input and output.

actually this is written for a hackvision atm but changing it to work for the video game shield would be easy

Oh righty ho :slight_smile:

I can't watch the video from here so I suppose I shouldn't assume things :stuck_out_tongue:

This is awesome, mdmetzle. After you fix the bug, I'd love to show a video and make this available for download on the Hackvision site's game page.

Some clarity on a confusing issue: the only reason I used a particular version of TVout for Hackvision is that the preloaded games (Space Invaders/Pong) takes up a lot of SRAM, and the older version of TVout I used was a little slimmer. The current/newest builds of TVout certainly work on the Hackvision hardware (which is what mdmetzle did I think).

Yes the newest version of TVout work on the hackvision as is and I am currently working on its memory usage back down so your current examples will work as is. I have freed up about 10 extra bytes and know how to free up another 10.

What i was trying to say is this needs the newer TVout so that it has access to a reliable millis() function which the version you used to write your games did not have yet.

On a side note I think that your examples could be made to work with the newest version of TVout by the encapsulating pong and space invaders data members inside a struct and then dynamically allocating the memory depending on which is chosen, much the way the simple-tetris-clone library does.

The only problem is I dont have any clue why the input bug is happening. What happens is will randomly think that the left button is being pressed repeatedly and render the game unplayable. Its probably something very simple if anyone wants to take a look as is just let me know and ill upload it somewhere as It may be a while before I can look at it again.

mdmetzle, you can send me the code and I'll take a look. It could be a sticky button, too. (unless you tested using a plain arduino and some buttons).

mdmetzle, if you send it my way I can change the controller stuff over to work with the Video Game Shield, and look for the input bug as well.

I found the input bug and sent mdmetzle the fix. Great implementation of tetris!

Mowcius will have to have a play with it soon.

Mowcius

mdmetzle has finished the game and it's available on the Hackvision games page. This is a really great Tetris implementation.

I notice the Hackvision supports a Wii Nunchuck.. Does this game?

While I didn't write nunchuck support into it specifically adding nunchuck support would be trivial. Include the one of the libraries that can be used for the nunchuck instead of the hackvision controller/nunchuck library and modify platformReadInput().

I have posted the latest version of the game on TVout google code page. This game requires the beta. I am not sure if I made a few minor changes vs the version posted on the hackvision site but I may have.

I do know that the guys behind the video game shield where planning on adding nunchuck support however I don't know what has happened to that.

We've got a version that works with all the hackvision stuff, as well as the nunchuck and the classic controller. As soon as we get back up to speed after our vacation we'll post source and videos and stuff. Expect something by the end of the week!

Nice!

We added music and Nunchuck support, so it now supports both the Nunchuck and the Classic Controller.

Source, pic and video are available at Arduino Tetris on the Video Game Shield | Wayne and Layne