Author Topic: Color tetris  (Read 37054 times)

0 Members and 1 Guest are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Color tetris
« Reply #15 on: November 07, 2011, 08:57:16 pm »
Looks nice. As for the blocks, the lighter ones could probably have a darker color or a lighter outline thing to the top/left.

Offline AzNg0d1030

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 522
  • Rating: +45/-4
  • Hardcore anime watcher.
    • View Profile
Re: Color tetris
« Reply #16 on: November 07, 2011, 09:38:40 pm »
Looks nice. As for the blocks, the lighter ones could probably have a darker color or a lighter outline thing to the top/left.
True, it looks like a tiny triangle in the top right corner of the block, or top left in this case.  Whichever looks better here.
You just lost the game.



Offline ralphdspam

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 841
  • Rating: +38/-1
  • My name is actually Matt.
    • View Profile
Re: Color tetris
« Reply #17 on: November 08, 2011, 12:36:37 am »
Nice!  It doesn't necessarily need the fast down button, as I normally don't use it. 

I'd like the fast-down button; I use it more often than the soft-down button.  ;)
ld a, 0
ld a, a

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Color tetris
« Reply #18 on: November 08, 2011, 12:52:12 am »
i'll have a try on that button :) cause it's nice to have..

i also have a problem with the turning of the blocks it seems. i thought i only had to transpose the matrix, but in fact, it doesn't work, cause you only have two positions then. how can i fix this?

Offline AzNg0d1030

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 522
  • Rating: +45/-4
  • Hardcore anime watcher.
    • View Profile
Re: Color tetris
« Reply #19 on: November 08, 2011, 01:06:52 am »
i'll have a try on that button :) cause it's nice to have..

i also have a problem with the turning of the blocks it seems. i thought i only had to transpose the matrix, but in fact, it doesn't work, cause you only have two positions then. how can i fix this?
maybe the person who made nTris will know. Search it up on here. There is a thread for it. It's for nspire too (just not cx or something)
You just lost the game.



Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Color tetris
« Reply #20 on: November 08, 2011, 10:41:33 am »
and for the code, yeah it is to check if that blocks[][] (that's the matrix that includes the total field) is not 0, i've tried it with ~=0, but it didn't work properly, it wouldn't move anymore...
Well, it should work, so probably the problem is somewhere else.
You say that it only works with 1, while even with this setup it should work. This confirms the thing above even more.
So .. have fun with bug hunting, and don't hesitate to ask questions :)

I'm also Belgian, and there are quite some dutch speaking people over here. So if you really don't know how to explain something in English, don't be afraid to ask it in dutch :)

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Color tetris
« Reply #21 on: November 08, 2011, 11:02:25 am »
I just solved the problem, it all works nice, i have add the marathon function: every 5 lines you go a level up, and you get a higher score when erasing multiple lines at once.
I used 2*numberoflines if linescleared>1, so 1 line gives 1 point, 2 lines gives 3 points, 3 lines gives 7 points and so on...

Oh, and that's really nice to know, it might be very handy to know, merci om 't met andere woorden te zeggen :)
« Last Edit: November 08, 2011, 11:04:22 am by Nick »

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Color tetris
« Reply #22 on: November 08, 2011, 07:04:59 pm »
can somebody tell me what's wrong with the code below?
it has to erase the upper line of a tablematrix if all the entries on the first row are 0 and replace it with a {0,0,0,0} entry on the 4th place of the table...
transpon is the table that holds the values 1 and 0 like this: transpon = {{0,1,0,0},{1,1,1,0},{0,0,0,0},{0,0,0,0},..and yet some other stuff here}

Code: [Select]
count = 0
for i=1,4 do
if transpon[1][i]==0 then
count = count + 1
end
end
if count==4 then
table.remove(transpon[1])
table.insert(transpon,4,{0,0,0,0})
count = 0
end
« Last Edit: November 08, 2011, 07:06:13 pm by Nick »

Offline AzNg0d1030

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 522
  • Rating: +45/-4
  • Hardcore anime watcher.
    • View Profile
Re: Color tetris
« Reply #23 on: November 08, 2011, 09:32:58 pm »
I just solved the problem, it all works nice, i have add the marathon function: every 5 lines you go a level up, and you get a higher score when erasing multiple lines at once.
I used 2*numberoflines if linescleared>1, so 1 line gives 1 point, 2 lines gives 3 points, 3 lines gives 7 points and so on...

Oh, and that's really nice to know, it might be very handy to know, merci om 't met andere woorden te zeggen :)
Every 5 lines?  I went up to level 20 and saw how fast it was.  Are you sure 5 lines? :O  Or maybe it should be like steps, where level 1 is # of lines, then level 2 is # of lines + 1, level 3 # +2  or something.  Or else for some it might get too hard too fast...
You just lost the game.



Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Color tetris
« Reply #24 on: November 09, 2011, 04:23:54 am »
I think you are mixing transpon and transpon [1] :
Code: [Select]
table.remove(transpon[1])
table.insert(transpon,4,{0,0,0,0})

I think you need

Code: [Select]
table.remove(transpon, 1)
table.insert(transpon,4,{0,0,0,0})
« Last Edit: November 09, 2011, 04:25:43 am by jimbauwens »

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Color tetris
« Reply #25 on: November 09, 2011, 01:20:02 pm »
yeah, that's it, thanks, now everything works as it should be, the only problem is that if a block turns when it's next to a wall, they dissapear like half into it, so i'll just have to fix that and the first "official" beta edition of ColorTetris will be finished. The only challenge included now is marathon, but this will be my next adjustment...

btw, if you have a cool name for it, shoot! cause ColorrTetris doesn't sound that explosive or atractive or...so if you know one, tell me



and maybe only  one thing: what is the shortest code to execute for the calc (to gain speed):

Code: [Select]
gc:setColorRGB(R,G,B)
gc:fillRect(x,y,10,10)
gc:setColorRGB(R,G,B)
gc:fillRect(x,y,10,10)
gc:setColorRGB(R,G,B)
gc:fillRect(x,y,10,10)
or
Code: [Select]
gc:drawImage(image,x,y)
with image a picture of a block of 10x10 (same as fillrect)

Every 5 lines?  I went up to level 20 and saw how fast it was.  Are you sure 5 lines? :O  Or maybe it should be like steps, where level 1 is # of lines, then level 2 is # of lines + 1, level 3 # +2  or something.  Or else for some it might get too hard too fast...

are you being sarcastic or is it true that it goes quite fast?

--edit--
but it's like 3 time setcolorrgb and fillrect, is it still faster than one drawimage?
« Last Edit: November 09, 2011, 04:27:54 pm by Nick »

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Color tetris
« Reply #26 on: November 09, 2011, 04:22:16 pm »
fillRect is much faster than drawimage, so I suggest you to use that :)

Offline AzNg0d1030

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 522
  • Rating: +45/-4
  • Hardcore anime watcher.
    • View Profile
Re: Color tetris
« Reply #27 on: November 09, 2011, 04:42:06 pm »
Beta-version of the game coming up tomorrow!  (Yes, I know this stuff :P)
Oh, I lost the game due to that ^ (irrevelancy)
You just lost the game.



Offline AzNg0d1030

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 522
  • Rating: +45/-4
  • Hardcore anime watcher.
    • View Profile
Re: Color tetris
« Reply #28 on: November 09, 2011, 04:44:59 pm »

Every 5 lines?  I went up to level 20 and saw how fast it was.  Are you sure 5 lines? :O  Or maybe it should be like steps, where level 1 is # of lines, then level 2 is # of lines + 1, level 3 # +2  or something.  Or else for some it might get too hard too fast...

are you being sarcastic or is it true that it goes quite fast?
Yeah it does.  5 lines every level will be insane.  Level 5 already is sort of hard to get through.
Level 20 was absolutely insanity.  At least like every 10 lines.

Sorry for the double post guys...
« Last Edit: November 09, 2011, 04:45:24 pm by AzNg0d1030 »
You just lost the game.



Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Color tetris
« Reply #29 on: November 09, 2011, 04:48:27 pm »
dude, why you guys know the game too xp

Ok then, it's nice to hear that speed isn't a problem here :) and i might change that levelup condition if it's not only you who thinks it goes to fast :)
but if i change it, it will take loooong to finally reach level 20, but if you agree, i do too
« Last Edit: November 09, 2011, 04:49:19 pm by Nick »