Pages: [1] 2   Go Down
Author Topic: Arduino Tetris  (Read 4033 times)
0 Members and 1 Guest are viewing this topic.
Michigan, US
Offline Offline
Full Member
***
Karma: 3
Posts: 148
Go Huskies
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just this Tetris working with TVout.

Short video of me loosing:
[media]http://www.youtube.com/watch?v=Bawl3-wNE7Q[/media]

It uses a modified version of simple tetris clone 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.
Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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-grin

Mowcius
Logged

Michigan, US
Offline Offline
Full Member
***
Karma: 3
Posts: 148
Go Huskies
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: November 18, 2010, 07:33:28 am by mdmetzle » Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

I can't watch the video from here so I suppose I shouldn't assume things smiley-razz
Logged

Minneapolis, MN USA
Offline Offline
Full Member
***
Karma: 2
Posts: 162
Never catch a falling soldering iron...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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).
Logged

Michigan, US
Offline Offline
Full Member
***
Karma: 3
Posts: 148
Go Huskies
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Minneapolis, MN USA
Offline Offline
Full Member
***
Karma: 2
Posts: 162
Never catch a falling soldering iron...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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).
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Minneapolis, MN USA
Offline Offline
Full Member
***
Karma: 2
Posts: 162
Never catch a falling soldering iron...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Mowcius will have to have a play with it soon.

Mowcius
Logged

Minneapolis, MN USA
Offline Offline
Full Member
***
Karma: 2
Posts: 162
Never catch a falling soldering iron...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

mdmetzle has finished the game and it's available on the Hackvision games page.  This is a really great Tetris implementation.
« Last Edit: November 20, 2010, 09:58:34 am by mkrumpus » Logged

Tacoma, WA
Offline Offline
Full Member
***
Karma: 4
Posts: 192
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Brian from Tacoma, WA
Arduino evangelist - since Dec, 2010.

Michigan, US
Offline Offline
Full Member
***
Karma: 3
Posts: 148
Go Huskies
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

India
Offline Offline
Full Member
***
Karma: 1
Posts: 131
The Tech Gamer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Nice!
Logged

|I love Technology|

Pages: [1] 2   Go Up
Jump to: