Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
26 May, 2013, 09:10:39 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1] 2 3 ... 6   Go Down
  Print  
Author Topic: Color tetris -  (Read 5092 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: Yesterday at 15:20:51
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1179


Topic starter
Total Post Ratings: +158

View Profile WWW
« on: 07 November, 2011, 22:55:48 »
0

hello

i'm quite new to Lua programming (about 1 month, since i had to buy a TI-Nspire CX CAS for school Smiley ) and i'm making a Tetris game in color. I've already finished the general gameplay, but i want to know if someone has some special ideas to put into it. It might be nice if it wasn't just a standard tetris, but i haven't got the inspiration yet Smiley

so if someone likes to help: you're welcome!

and can somebody please tell me how to put a picture in this forum, cause i don't really get it xs thanks
Logged

thepenguin77
z80 Assembly Master
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Yesterday at 22:00:35
Date Registered: 14 December, 2009, 04:21:52
Location: Purdue
Posts: 1484


Total Post Ratings: +778

View Profile
« Reply #1 on: 07 November, 2011, 22:57:14 »
0

If you copy this, you will be in good shape. http://www.tetrisfriends.com/

I'd say Marathon would be the one you'd want try to resemble most, but, any of the other modes are cool too.
Logged

zStart v1.3.011 4-29-2013  zStart fully works on 83+BE's (except custom font)
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112
Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: Yesterday at 15:20:51
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1179


Topic starter
Total Post Ratings: +158

View Profile WWW
« Reply #2 on: 07 November, 2011, 23:01:33 »
0

the purpose is to clear 5 lines in the first level, and then 6 and.. is it right?

yeah, but i've seen it al quite a lot, and that's what i'm trying to avoid, but i'll certainly put it into it, it's a standard to tetris, so it would be a lack in the game, thanks...
Logged

Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 23:59:07
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1733


Total Post Ratings: +180

View Profile WWW
« Reply #3 on: 07 November, 2011, 23:07:34 »
0

Well, its great that you already have programmed the basic game Cheesy

If you have problems implanting certain stuff, you could always ask for some help here, as there are quite some Lua coders around Cheesy
Logged

DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 07:37:00
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50238


Total Post Ratings: +2615

View Profile WWW
« Reply #4 on: 07 November, 2011, 23:08:57 »
0

Heya Nick, welcome to the forums. Cheesy I unfortunately cannot help as I never made a Tetris game, but I think there should at least be the two modes from the NES, where you either move one level up every 10 lines or so (and it falls faster and faster) and the other mode where you must get 25 lines without anything remaining. Also have different modes such as a difficulty setting that disables the ability to drop blocks faster and make them fall instantly and maybe even a mode that gets rid of the vertical block.

As for picture upload, you cannot do so until you get 5 posts I think (anti-spambot adult material upload protection), but you can use http://img.removedfromgame.com then use [img]image url[/img] to link to your post. Smiley
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: Yesterday at 15:20:51
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1179


Topic starter
Total Post Ratings: +158

View Profile WWW
« Reply #5 on: 07 November, 2011, 23:13:41 »
0

thanks, i think it will be necessary, wuase it's only my second game..

well, while you're about it, i have a problem, but it might be fised fast. It's in the detection of the obstacles.
Every piece has a different color, and i store them in a table (with subtables so you get a kind of matrix), but when i fill 1 in if it's full (that means a piece is on that place) everything goes well, but when i fill in a number of 1 to 7, each number for a different color, it doesn't work anymore. The code below is for that 1-7 colorcheck...
on.checkleft checks if the left side of the block is free to move to the left


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function on.checkLeft()
for i=1,fallingblock[9] do
for j=1,4 do
for k=1,7 do
if blocks[i+1+fallingblock[6]-fallingblock[9]+1*(fallingblock[9]-2)][j+fallingblock[5]-2]==k then
stopleft = true
end
end
end
end
if stopleft then
return 0
else
return 1
end
stopleft = false
end
Logged

Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: Yesterday at 15:20:51
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1179


Topic starter
Total Post Ratings: +158

View Profile WWW
« Reply #6 on: 07 November, 2011, 23:16:56 »
0

voila, and here's a screenshot, thanks to DJ_O

« Last Edit: 07 November, 2011, 23:22:20 by Nick » Logged

Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 23:59:07
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1733


Total Post Ratings: +180

View Profile WWW
« Reply #7 on: 07 November, 2011, 23:21:57 »
0

Nick, that screenshot looks really nice Smiley

Now about your code, is

1
2
3
4
5
6
for k=1,7 do
if blocks[i+1+fallingblock[6]-fallingblock[9]+1*(fallingblock[9]-2)][j+fallingblock[5]-2]==k then
stopleft = true
end
end
only to check if its between 1-7?
If so, its over complicated ^^
 
I'm now a bit too tired too explain more, but will do so tomorrow.

(Btw, are you Dutch/Belgian?)
« Last Edit: 07 November, 2011, 23:22:38 by jimbauwens » Logged

DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 07:37:00
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50238


Total Post Ratings: +2615

View Profile WWW
« Reply #8 on: 07 November, 2011, 23:24:02 »
0

Looks nice so far. In the future are you planning to add textures to the blocks that looks like the originals, to make them look more 3D? It might also make it look better on older TI-Nspires that have no color.
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
adriweb
Editor
LV9 Veteran (Next: 1337)
*
Offline Offline

Gender: Male
Last Login: 23 May, 2013, 12:02:44
Date Registered: 13 April, 2011, 18:42:59
Location: South of France
Posts: 1197


Total Post Ratings: +185

View Profile WWW
« Reply #9 on: 07 November, 2011, 23:24:48 »
0

Yep, looks very cool Cheesy

You could also use textures if calc is not CX ... ?
Logged


TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation
Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: Yesterday at 15:20:51
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1179


Topic starter
Total Post Ratings: +158

View Profile WWW
« Reply #10 on: 07 November, 2011, 23:27:39 »
0

yeah, i'm belgian.. i didn't even notice that you could see it on the screenshot Smiley

thanks, well it's the purpose to make it that way, but it just the beginning to make everything work, and then the lay-out will follow...

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...
« Last Edit: 07 November, 2011, 23:33:48 by Nick » Logged

Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: Yesterday at 15:20:51
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1179


Topic starter
Total Post Ratings: +158

View Profile WWW
« Reply #11 on: 08 November, 2011, 01:35:24 »
+1

i finally got it working..and in the meanwhile, i changed the graphics a little bit, now there is a little 3D-piece effect like the real tetris Smiley

here's a screenshot, but never mind the numbers on the left side, they are only to know some values to debug it.

Logged

AzNg0d1030
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 19 May, 2013, 23:04:34
Date Registered: 26 October, 2011, 04:43:09
Location: Over the rainbow
Posts: 488


Total Post Ratings: +37

View Profile
« Reply #12 on: 08 November, 2011, 01:49:26 »
0

So it does get progressively faster? Also is there going to be a score and line counter? Also another nice thing would be to add in a screen that let's you choose from level 1-9 or something, so you can start easy or hard.
Make sure it fast enough on the calc. Some games on the cx are fast on comp but not on the calc itself. Make sure there is a button to instant drop and like a a down button that if held, speeds up drop. Use the number keys to move etc since the pad is clunky...

Just some (a lot srry) suggestions. 
Logged

What? WHAT? WHATTTT?Huh??

You just lost the game.

Suck it up.
Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: Yesterday at 15:20:51
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1179


Topic starter
Total Post Ratings: +158

View Profile WWW
« Reply #13 on: 08 November, 2011, 02:04:13 »
+1

they're really nice, like the keypad usage could be very useful Smiley
Well, the dropdown button might need a bit of time, cause i don't know directly how to implement it, but i'll certainly have a look at it.

untill now, you can speedup with + and -, it doesn't go atuomatically, but it can go to level 20 with a really nice speed, the block is totally down in about 3 seconds, so... Smiley

and i've also implemented that it checks if the calc has a colorscreen, if not, it uses white and black as background colors, otherwise pink and grey

« Last Edit: 08 November, 2011, 02:04:38 by Nick » Logged

AzNg0d1030
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 19 May, 2013, 23:04:34
Date Registered: 26 October, 2011, 04:43:09
Location: Over the rainbow
Posts: 488


Total Post Ratings: +37

View Profile
« Reply #14 on: 08 November, 2011, 02:55:06 »
0

they're really nice, like the keypad usage could be very useful Smiley
Well, the dropdown button might need a bit of time, cause i don't know directly how to implement it, but i'll certainly have a look at it.

untill now, you can speedup with + and -, it doesn't go atuomatically, but it can go to level 20 with a really nice speed, the block is totally down in about 3 seconds, so... Smiley

and i've also implemented that it checks if the calc has a colorscreen, if not, it uses white and black as background colors, otherwise pink and grey

Nice!  It doesn't necessarily need the fast down button, as I normally don't use it.  I don't know about others though.  No automatic leveling?  Aw shucks.  Oh, also, is there a system that gives you more points if you get 2 lines, even more points if you get 3 lines, and also more points for a tetris? Plus you get points for using the instant down? If possible, a highscore list with names too Cheesy

Lol I'm naming quite some stuff...
You don't have to do all this.  I'm just going crazy since it's tetris!

EDIT: There is a thread in the Lua Language forum that is about storing highscores for Lua programs
« Last Edit: 08 November, 2011, 03:09:55 by AzNg0d1030 » Logged

What? WHAT? WHATTTT?Huh??

You just lost the game.

Suck it up.
Pages: [1] 2 3 ... 6   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.313 seconds with 30 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.