I've been working on our Tetris clone a bit today. Struggling with C, but trying to learn :|
GitHub or it didn't happen. *runs*
If you need help, contact me. Also read the n2DLib documentation. It helps. A lot.
There's a GitHub: https://github.com/Streetwalrus/tetris It's not up-to-date with my source, though, because I can't push yet (I'm not a member of the github so I can only do pull requests (I think??))
Also, thanks for the advice :) I'll poke you when I'm stuck.
By the way, what are your plans for the graphics? Do you plan to stick with single color blocks or will you use textured blocks like in original Tetris games?
I dunno, maybe we'll ship it with multiple graphics packs ^^
We made a very interesting design choice: The game is going to be played sidewards, so you have more height to use :D The controls are going to be mapped to the letter pad.
Also, I'm struggling with this code. It freezes and I have no idea why...
int bag_piece()
{
int i;
if ( in_bag > 0 )
{
in_bag--;
i = bag[in_bag];
bag[in_bag] = -1;
return i;
}
while( in_bag < 7 )
{
i = rand()%7;
int z = 0;
int j;
for( j = 0; j < 7; j++)
{
if( i == bag[j] ) z++;
}
if( z == 0 )
{
bag[in_bag] = i;
in_bag++;
}
}
bag[--in_bag] = -1;
return i;
}
bag[] is the numbers 0-6 in a random order.
If in_bag > 0 it should return the piece bag[in_bag] and set bag[in_bag] to -1.
if in_bag = 0 then it should fill the bag with 0-6 in a random order and return bag[6] and set bag[6] to -1.
Any ideas? (except me learning to code better -.-)
Aw, I tend to not like sideways controls because when you hold the calc it tends to tilt by itself on one side, especially bulky models like the ClickPad Nspire. D: Your choice, though.
As for graphics I was wondering since IMHO it would make no sense to release a Tetris game with Atari 2600 graphics when many other alternatives with actual sprites (like Nick's Tetris and the emulator ones) are available. Not to mention it would defeat the point of using Ndless :P
Quote from: DJ Omnimaga on November 17, 2014, 02:27:25 AM
By the way, what are your plans for the graphics? Do you plan to stick with single color blocks or will you use textured blocks like in original Tetris games?
The game uses sprites, it's really easy to swap them out. :P
As for the algorithm, do it this way :
-put consecutive 1-7 numbers in a table and set a count (n) to 7
-pick a random 0-6 number (m)
-grab the mth non-0 number from the table and put it minus 1 in your bag
-0 that number and decrement n
-go back to step 2 until n is 0
That should do the trick.
Quote from: DJ Omnimaga on November 17, 2014, 05:45:52 PM
Aw, I tend to not like sideways controls because when you hold the calc it tends to tilt by itself on one side, especially bulky models like the ClickPad Nspire. D: Your choice, though.
We plan to make it optional.
Quote from: DJ Omnimaga on November 17, 2014, 05:45:52 PM
As for graphics I was wondering since IMHO it would make no sense to release a Tetris game with Atari 2600 graphics when many other alternatives with actual sprites (like Nick's Tetris and the emulator ones) are available. Not to mention it would defeat the point of using Ndless :P
Welp, this is our first project to mess around with Ndless, plus we had a pretty epic idea that required the speed in order not to make the game lag like mad when we generated pieces. >:D
Ah ok lol I thought you just used shapes like in every HP Prime Tetris clone :P
int bag_piece()
{
int i;
if (!(in_bag > 0))
{
while( in_bag < 7 )
{
i = rand()%7;
int z = 0;
int j;
for( j = 0; j < 7; j++)
{
if(i == bag[j])
{
z = 1;
in_bag--;
break;
}
}
bag[in_bag - 1] = i;
in_bag++;
}
}
in_bag--;
i = bag[in_bag - 1];
return i;
}
This should do the trick. I have to get lunch, so I'll explain it later.
pimath: erm, the code does work, it just doesn't do what it's expected to do. I got two line pieces in a row at like the third piece already. That shouldn't happen.
Street: that sounds like a really good idea, I'll try to implement that.
okay. I'll debug it later, because I'm still at school.
Apparently aeTIos just got my solution working so yay. :D
Edit : Well, almost. :P
Got Streetwalrus' solution working, but I came up with an algorithm of my own that I'll also try to implement. For now, I pushed my implementation of streetwalrus' solution to GitHub.
By the way, do you think animated backgrounds (like Tetris for the GBC) would be possible?
Yup, definitely. It would just need the backgrounds to be done. :P
I guess backgrounds from Supersonic Ball or perhaps other ones I made could be modified then re-used. Also I tried this game when it was posted secretly and it's quite cool so far. :) How do you make blocks fall down instantly, though?
Animated backgrounds are definitely possible.I have been thinking about a scoring mechanism, nad I came up with the following:
There's a base line score of current_level*2. If you fill multiple lines at once, you get a +1x multiplier on this base score per line. e.g. if you are level 9 and make a tetris, you get a whopping 18+36+54+72=180 points :0 On top of that if you keep cleaning lines in subsequent turns your base line score goes up by (current_level-1)/3+1 points per turn (current level / 3 rounded up). If you make a tetris, you get a permanent score multiplier bonus of +0.2. Clearing the screen gives you +0.1 score multiplier. Insta-dropping will award you 0.5x the distance dropped in score.
Thoughts? Suggestions?
Quote from: DJ Omnimaga on November 18, 2014, 03:15:17 AM
I guess backgrounds from Supersonic Ball or perhaps other ones I made could be modified then re-used. Also I tried this game when it was posted secretly and it's quite cool so far. :) How do you make blocks fall down instantly, though?
You don't. It's currently unimplemented. :P
Quote from: aeTIos on November 18, 2014, 12:18:59 PM
Animated backgrounds are definitely possible.I have been thinking about a scoring mechanism, nad I came up with the following:
There's a base line score of current_level*2. If you fill multiple lines at once, you get a +1x multiplier on this base score per line. e.g. if you are level 9 and make a tetris, you get a whopping 18+36+54+72=180 points :0 On top of that if you keep cleaning lines in subsequent turns your base line score goes up by (current_level-1)/3+1 points per turn (current level / 3 rounded up). If you make a tetris, you get a permanent score multiplier bonus of +0.2. Clearing the screen gives you +0.1 score multiplier. Insta-dropping will award you 0.5x the distance dropped in score.
Thoughts? Suggestions?
Sounds good to me. :)
I'd make clearing the screen more rewarding though since it's way harder than doing a tetris lol.
How does one clear the entire screen instantly, though? O.O
I like the ideas otherwise, though. Just make sure that above level 9 you don't get like 300000 pts for each Tetris or something like in the NES tool-assisted speed-run.
Well, there's copying stuff to the screen and actually drawing. The latter requires a lot of calculations, especially with transparency where you need to test every pixel.
Oh I meant clearing the entire screen as in clearing lines during gameplay. I was confused because you can't clear the entire screen instantly with just 1 vertical block. It takes like 4 or 5 :P
Does it have mode B? (Clearing a certain amt of lines with a screen filled with random blocks at the beginning)
No, because there's no mode select screen yet :P I plan to add it, though. It's quite a classic. Anyways I made quite a bit of progress yesterday: I added a scoring system :D It's not quite finished yet (I still have to add certain situation checks) but it's already very playable.
Download beta 0.0.1 here: https://dl.dropboxusercontent.com/u/64788231/tetris001.tns The version numbers after this will be determined using a 1d4+2d10 dice roll :P
I tried last night copy and the score leaves traces behind digits when updated.
Yeah, that's because the screen isn't wiped on update. It only re-draws the tilemap :)
Quote from: aeTIos on November 19, 2014, 06:57:48 AM
The version numbers after this will be determined using a 1d4+2d10 dice roll :P
Haha yes do that. I'm sure you'll beat Firefox/Chrome version numbers really fast. :P
By the way, you should really implement Next block feature so we know what block is about to appear, like in other Tetris games :P
I think it's already implemented but not sure. In the code I mean, no visual output yet.
Quote from: Streetwalrus on November 19, 2014, 11:42:49 PM
I think it's already implemented but not sure. In the code I mean, no visual output yet.
This is not entirely true. Sure I can know what block is next up, but I will have to generate 2 bags at a time because eventually I want to give a next 5 blocks preview. I also want to add the ability to put a piece on hold, and I want to add a drop shadow (this will make insta-dropping a lot easier)
Wow that sounds ambitious. At first we were trying to recreate the gameboy classic lol.
Ooh 5 blocks preview and drop shadow would be nice. I think that's what ThePenguin77's Tetris did, right? Or maybe it was another Tetris game?
Being able to put a piece on hold should probably be a game mode, though, for people who want to go with a full challenge with the original rules. But it's up to you I guess.
Quote from: DJ Omnimaga on November 22, 2014, 12:12:24 AM
Ooh 5 blocks preview and drop shadow would be nice. I think that's what ThePenguin77's Tetris did, right? Or maybe it was another Tetris game?
Being able to put a piece on hold should probably be a game mode, though, for people who want to go with a full challenge with the original rules. But it's up to you I guess.
Yep, and he on his part recreated Tetris Marathon which is still one of the best tetrises made so far IMO.
Yeah I like that game mode.
On a side note, in your game, I notice that the starting speed is very high compared to the NES version. Is this intentional?
I made it that way because I wanted it to be fast for testing. :P The engine allows for adjustable speed thankfully so yeah. ;)
Ah ok good lol. Because I felt for novice players they will find this version much harder than other versions if the speed remains like this. :P That said, the Windows 3.1 Tetris was like this too, IIRC, in addition to lacking the ability to make blocks fall line by line (you could only make them fall instantly)
I don't know for features but I'd like to see three of them implemented :
- instant fall with a button (with UP)
- Holding a piece
- Having a cooldown before then piece blocks itself when it touches the other blocks. (In Tetris DS the cool down reset each team you rotate)
Yeah I came ffrom Tetris DS and it was my favorite port. I destroy its marathon in no time! :p
The first two are planned, the last one is easy enough to do with three lines of code. :P
actually I wanted to implement #3 too but I don't want to reset it. Instead I wanted to add a bit to the timer every time you rotate :)
Don't expect too much progress on this for the rest of the week. I have a test coming up and I have to study like mad because I wanna get a good score.
Good luck in your test aeTIos!
Have fun! And if you're bored in the test, heh, you have tour Tetris! ;)
Good luck with your test but don't tire yourself out. :)
Quote from: Eiyeron on November 27, 2014, 07:01:55 AM
Have fun! And if you're bored in the test, heh, you have your Tetris! ;)
Eh, I can't use my Nspire :P Thanks everyone :)
That's not a calculator, it's a game console
Quote from: Eiyeron on November 28, 2014, 07:18:43 AM
That's not a calculator, it's a game console
I definitely agree.
Bah. Not true, I use my CX for lab data analysis all the time :) It's a really good machine, you just have to use it for what it's intended for - which is data gathering and analysis. I might do a post about how to actually use the Nspire the way it's intended.
Anyways I have my test tonight. Thanks for all thesupport already, I hope it all goes well ^^'
Quote from: aeTIos on December 01, 2014, 04:31:00 PM
Bah. Not true, I use my CX for lab data analysis all the time :) It's a really good machine, you just have to use it for what it's intended for - which is data gathering and analysis. I might do a post about how to actually use the Nspire the way it's intended.
Anyways I have my test tonight. Thanks for all thesupport already, I hope it all goes well ^^'
How to use your nspire when not playing nDoom on it. :blah:
Haha. Anyway let's get back on topic. I passed my test with an 80% score so that'll be all right. Been really busy with school and all that stuff lately, that's why I haven't made much progress on this :|
/me pats aeTIos in the back
I hope you can do stuff this week.
Also you should change your avatar.
Agreed, when I'm not thinking about Rick, I think you're Rune 112. ><"
Nice grade you got there! Hope that will alleviate you from some stress!
Quote from: aeTIos on December 06, 2014, 07:52:24 AM
Haha. Anyway let's get back on topic. I passed my test with an 80% score so that'll be all right. Been really busy with school and all that stuff lately, that's why I haven't made much progress on this :|
I thought your test was finished a few days ago O.O
Good job though :)
Also what about a walrii-themed Tetris? :P
Waltriis ? :P
I was more thinking of WalriiTris or something like that, or Tetris Walrii Edition :P
Sounds fun anyway. :P Maybe have the pieces look like weird lobsters and when you destroy a row, have Walrii eat it as the animation. :P
Oh I like the latter idea. :D for the first good luck making such Tetris game look good, though :P
Yeah lol it would probably look really weird. :P
I'M thinking that maybe it should still use blocks in such case, but on the blocks, there would be lobster claws or legs drawn on them.
You could do something like Puyo Puyo, making same color blocks merge!
Bug report:
The game doesn't run in Nspire_emu, no matter what version of Ndless you use. It will just say This document format is not supported.
Quote from: DJ Omnimaga on December 31, 2014, 02:01:21 AM
Bug report:
The game doesn't run in Nspire_emu, no matter what version of Ndless you use. It will just say This document format is not supported.
Huh, that's weird. I never tested on emulators, though, so I can't really give support x.x I remember seeing pimath play Testris (pun intended) on an emulator, though, somewhere in november on HCWP. I should get things going but I'm kinda stuck on where to continue work on this :\
Well the other night, I was trying both nKaruga and Tetris with both the Ndless build I had and the latest. nKaruga would run perfectly in both, while Tetris would say the format is not supported. Are you sure you didn't compile it only for one specific version of Ndless? I know the old version I had on emulator was not the same as on my calc (my calc is still a few versions behind, yet it ran both games fine). Anyway I hope you continue working on this. It would be nice to see a full-fledged C Tetris clone for the Nspire that isn't an emulator game.
I did some work on this last weekend, and I added support for piece previewing. Haven't tested the latest build yet, though.
Cool to hear. :D you shoukd make a screenshot when you have a chance, since I can't run the game in nspire_emu. (It only works on the real calc)
Yeah I'd like to see a screenshot of the latest version as well. When was the last time we had a preview of this game? A year ago or so? :trollface:
I think it was in May, but you posted some versions after CodeWalrus got a forum.
Also I just realized I forgot to include the game in the CW Youtube video D: (although maybe it would have looked out of place with the animated screenshots, since Tetris was filmed with a camera.)
I'm going to take a look at this this weekend. Is the source on github up to date ?
The github sauce is up to date. This game is progressing slowly but I'm still adding features :)
Glad you are still working of this. I was sad to see Illusiat and Pokespire die simultaneously D:
Quote from: DJ Omnimaga on January 19, 2015, 03:04:11 PM
Glad you are still working of this. I was sad to see Illusiat and Pokespire die simultaneously D:
We might still do something with illusiat, but probably not on calc.
Oh i meant that this particular calc project is still one. I would like to see a non-c remake of Illusiat 11 for the PC in SNES style