On a recent ticalc.org news article about Tetris for the TI-Nspire graphing calculator, the top commenter lamented, "Tetris, in COLOR! Woot! I love all of these color games coming out - I just wish that Lua wasn't so slow." As Cemetech has repeatedly and vociferously expressed its support for the Casio Prizm over the TI-Nspire for powerful color-screen graphing calculators, in no small part for its completely open development environment compared to the TI-Nspire's locked-down capabilities, I was immediately inspired (heh) to attempt a Tetris clone for the Nspire. Since my current schoolwork and other endeavors are using the vast majority of my waking hours, I contacted my fellow Cemetech administrator and good friend tifreak8x, since he's currently learning C, to ask if he'd like to join me. Roughly four hours of coding and a bit of spriting later, I have the following to show for my efforts; I'm afraid I got a little carried away, as I'm wont to do. The background is carefully constructed to take much less memory than a full-screen image, pieces can be moved and placed and rotated, pieces can be dropped, and lines can be cleared. More features are missing than present thus far, such as sideways movement collisions, rotation into place, scoring, level/score display, and modes.

Work on this shall continue only as tifreak8x's schedule and my own time commitments permit, but with the speed and power of C development, I don't anticipate it taking that long. Please let us know in particular what sort of modes you'd like the game to have, any criticisms or feedback about the current game, from what you can see in the screenshots, and of course feel free to continue the C vs. Lua debate.

This looks very, very nice, Kerm Smile I had a feeling you and tifreak were working on a tetris clone lately. I very much like the sprites, especially for the blocks. As for modes, one that'd be cool to include would be speed/invisible tetris Cool

EDIT: Kind of like this, where the block doesn't slowly drop, but stays at the top and falls straight down pretty quickly:

A great mode would be survival mode (you keep going till you hit the top), IMO.
Wow, that screenshot looks absolutely beautiful. I look forward to playing this!
JosJuice, many thanks, I look forward to delivering it to the community to play. Smile
Adamac, aye, that's the main mode we plan on including. I've heard it alternately called survival and marathon.
Ashbad, whoa, that looks stupendously ridiculous. From that bit at the very end, it seems to me that he (?) isn't even looking at the board, therefore, just keeping it in his head. I don't know if we can be hardcore enough to add that mode. Wink
Very nice work! Any thoughts about multiplayer? That always made Tetris more fun, in my opinion.

Quote:
Work on this shall continue only as tifreak8x's schedule and my own time commitments permit, but with the speed and power of C development, I don't anticipate it taking that long.

C may generally be fast to run, but fast to write? In comparison to what? Wink
Well, in comparison to z80 ASM, for starters. Smile And I honestly don't find it to be markedly slower than higher-level languages, especially for something with (thus far) as straightforward game logic as Tetris.
This looks epic Very Happy
I need moar cool games on my Prizm...
Can it be as much like the Super Nintendo version as possible? It is my favorite.
benryves wrote:
C may generally be fast to run, but fast to write? In comparison to what? Wink


If you are well versed in C, code can come along quite quickly. I've recently been using Game Maker, and I find that production is a bit slower than when I'm using C, although quite a bit of the slowdown admittedly comes from the fact that GML doesn't support much in terms of data storage, so straight forward ideas such as structs can become quite difficult to mimic. Also, C supports much nicer scoping capabilities than GML does, so I needn't be as careful in C.

On-topic: This game looks quite nice. I hope all goes well Smile
Kaslai, thanks very much, I hope so too. And I agree.
Caleb: Could you be a bit more specific about what you mean by that?
Sarah: Thanks! Cemetech Contest #8 should help with that too!

I'm adding scoring, gotta find out how that's done...
*bump* Proper piece rotation! Working line clearing! Score and level and piece preview display! Proper horizontal piece moving! Better but still broken key debouncing! A video tomorrow, I hope.
I'd like to make clear that the Lua tetris game runs at a very good speed, without any speed issues Wink

But of course Lua is slower than C and ASM, as its interpreted.
Just don't make it worse than it is, as that is the image I'm getting the last weeks.

Back on topic, it looks great Smile

Jim
Good job Smile
Jimbauwens, as you know, I don't have an Nspire of my own, since I've been boycotting TI's bad decision-making on locking out third-party native code. I believe I heard that graphics in particular are slow, doing things like image swatches or sprites? Is that inaccurate?

Lionel, thanks!

I quickly threw together this WiP video this morning; I still would love some mode suggestions, plus I wouldn't mind some ideas on how this could be improved, perhaps more visual effects, all that sort of thing.
Looks awesome Kerm!

You'll have this completed long before I learn enough prizm c to be of any help lol

Looks like there needs to be some delaying of key pressing.
Yeah, I've been wrestling with trying to get key-debouncing done properly. Among other issues, the the PRGM_getkey() function runs much much faster if a key is pressed than if it's not, which means adjustments need to be made. Actually, why am I not using the RTC?
RTC? Don't even know what that is to offer any reasonings why you're not using it :p
tifreak8x wrote:
RTC? Don't even know what that is to offer any reasonings why you're not using it :p
Real Time Clock. Right now I set a counter and count it down, moving the piece that's falling one row down when the counter gets to zero, and filling up the counter again for the next tick. With the getkey making loops in which keys are pressed go faster, though, it doesn't work out to be the same amount of real time in between the piece advancing downwards, hence my self-suggestion of exploiting the RTC.
KermMartian wrote:
Jimbauwens, as you know, I don't have an Nspire of my own, since I've been boycotting TI's bad decision-making on locking out third-party native code. I believe I heard that graphics in particular are slow, doing things like image swatches or sprites? Is that inaccurate?


It is true that its slow if you redraw the entire screen full with images every frame. But it is still (really) fast enough to create scrolling games like blockman and Block Breaker (work in progress, maybe I should post a screen animation to demostrate the speed). Just games like mario aren't so possible.
Also, this is normally going to improve in future updates Smile
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 4
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement