Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 the tetris game demo(or whada hell ever it's called =/)
Index -> Programming, Turing -> Turing Submissions
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Homer_simpson




PostPosted: Wed May 07, 2003 7:15 pm   Post subject: the tetris game demo(or whada hell ever it's called =/)

It took me an hour and a half to make it but it's still the demo


tertis.t
 Description:
Just updated the file

Download
 Filename:  tertis.t
 Filesize:  3.02 KB
 Downloaded:  483 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Homer_simpson




PostPosted: Wed May 07, 2003 7:20 pm   Post subject: (No subject)

try changing the value of level,wide and tall it'll effect the output
Catalyst




PostPosted: Wed May 07, 2003 7:26 pm   Post subject: (No subject)

get the actual tetris dimensions in there
and a drop button
otherwise, good so far Smile
Homer_simpson




PostPosted: Wed May 07, 2003 7:35 pm   Post subject: (No subject)

actual tetris dimention?
Tony




PostPosted: Wed May 07, 2003 7:47 pm   Post subject: (No subject)

he means original grid size. Its 10 cells wide and I donno how tall... Not that important, but you should keep it 10 cells wide.

Which you can actually edit in the game... just change width/height, but dont forget to adjust starting positios as well...

funny grid properties:
delay = 0
width = 1
hight = 2

just sit back and watch the points grow 8)
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Homer_simpson




PostPosted: Thu May 08, 2003 12:58 pm   Post subject: (No subject)

would u like some bits...?
well if you do solve my problem and i'll give u 200 bits!!!!!!!!!!!!
now here's my problem :
the part that should detect wheter the object has empty space under it to go down or not is giving me trouble... solve my problem and get 200 bits...



may screw tetris.t
 Description:
This is the file that you should consider

Download
 Filename:  may screw tetris.t
 Filesize:  4.18 KB
 Downloaded:  297 Time(s)

Tony




PostPosted: Thu May 08, 2003 3:50 pm   Post subject: (No subject)

wow, this is messed up...

here's how your code should work:

for i:1..4 %check each block

grid ( piece.x(i), piece.y(i)-1) = true %if cell below has something
AND check that that cell is not a part of falling block itself

then stopFall

...

something like that
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Homer_simpson




PostPosted: Thu May 08, 2003 6:38 pm   Post subject: (No subject)

Bwaaaaaahahahhaaaaa.... i'm afraid it's not that simple tony...
you see every peace is created in a 4x2 grid
for example













X
!


when it gets to check the peace block(2,1) that is marked by X in the picture it'll read the block under it which is marked by ! in the picture and think that it's full under it and wont move down....

So if you could solve that problem fr me i'll give250
BITS!!!!!!!!!!!!!!!!!!
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Thu May 08, 2003 6:44 pm   Post subject: (No subject)

i know... thats why I said
Quote:
AND check that that cell is not a part of falling block itself


sorry if I wasn't clear... I was refering to all the other blocks of the piece.

So if cell below is NOT a part of piece itself and is still occupied, then you hit something so stop.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Homer_simpson




PostPosted: Thu May 08, 2003 6:45 pm   Post subject: (No subject)

how does it know that... =/

Tony gimme the turing code to my problem and i'll donate all my bits to u...
Tony




PostPosted: Thu May 08, 2003 7:46 pm   Post subject: (No subject)

well you got your falling object set up in a weird way...

the way I programmed my tetris (i programmed a working tetris by the end of grade 10, unfortunatly I've lost the code) is that I kept my object as individual pieces located on the whole grid.

such as

objectX(1) = 5
objectY(1) = 10

so the cell @ 5,10 is taken up... same for other 3 parts...

now, the grid itself (background) is set to hold those pieces.

When it checks if it can fall down, I think it was something like this:

code:

var fall:boolean := true
for i:1..4
if grid(objectX(i),objectY(i)-1) = true AND objectY(i)-1 not= objectY(1) AND objectY(i)-1 not= objectY(2) AND objectY(i)-1 not= objectY(3) AND objectY(i)-1 not= objectY(4) then

fall := f alse

end if

end for


so basically if the cell 1 lower then any of the blocks is filled AND its not one of the 4 blocks, then you should stop the fall...

Also you got problems with moving your pieces side to side... they seem to fall appart.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Homer_simpson




PostPosted: Thu May 08, 2003 7:52 pm   Post subject: (No subject)

mving left or right is not a problem.... it works perfectly fine...
did u say that u made a workin tetris b4?if so could u spin the peaces in it?

well it didn't exactly help me make it work and since the lazy big ass of mine is effecting my mind i'll prolly just stop here..
but + 50 bits to u tony ,thx for the help...
Tony




PostPosted: Thu May 08, 2003 8:00 pm   Post subject: (No subject)

woot, more bits Laughing

and yes, they could spin...

though back then (remember... end of grade 10, just started programming... dont compare me to Catalyst) i did it the crapy way, manually writing a new position for each of 4 turns. Such as when you rotate, each piece moves to a new position. such as X+1, Y+2 for first piece, something else for 2nd...

now that I think of it, you could probly apply trig and rotate it around itself by 90 degrees...
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Homer_simpson




PostPosted: Thu May 08, 2003 8:05 pm   Post subject: (No subject)

bwahahahaha.... funny
yeah i was gonna make it spin 90 degrees but the lazy ass thing is kicking in again...
Tony




PostPosted: Thu May 08, 2003 8:13 pm   Post subject: (No subject)

maybe you're better of programming color tetris... also known as columns...

its that game like tetris, but instead blocks of three colors fall and you have to get three in a row instead of whole line. The only rotation there is the order of colors.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 27 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: