
-----------------------------------
Homer_simpson
Wed May 07, 2003 7:15 pm

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

-----------------------------------
Homer_simpson
Wed May 07, 2003 7:20 pm


-----------------------------------
try changing the value of level,wide and tall it'll effect the output

-----------------------------------
Catalyst
Wed May 07, 2003 7:26 pm


-----------------------------------
get the actual tetris dimensions in there
and a drop button
otherwise, good so far :)

-----------------------------------
Homer_simpson
Wed May 07, 2003 7:35 pm


-----------------------------------
actual tetris dimention?

-----------------------------------
Tony
Wed May 07, 2003 7:47 pm


-----------------------------------
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)

-----------------------------------
Homer_simpson
Thu May 08, 2003 12:58 pm


-----------------------------------
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...

-----------------------------------
Tony
Thu May 08, 2003 3:50 pm


-----------------------------------
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

-----------------------------------
Homer_simpson
Thu May 08, 2003 6:38 pm


-----------------------------------
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!!!!!!!!!!!!!!!!!!

-----------------------------------
Tony
Thu May 08, 2003 6:44 pm


-----------------------------------
i know... thats why I said 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.

-----------------------------------
Homer_simpson
Thu May 08, 2003 6:45 pm


-----------------------------------
how does it know that... =/

Tony gimme the turing code to my problem and i'll donate all my bits to u...

-----------------------------------
Tony
Thu May 08, 2003 7:46 pm


-----------------------------------
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:


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.

-----------------------------------
Homer_simpson
Thu May 08, 2003 7:52 pm


-----------------------------------
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
Thu May 08, 2003 8:00 pm


-----------------------------------
woot, more bits  :lol: 

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...

-----------------------------------
Homer_simpson
Thu May 08, 2003 8:05 pm


-----------------------------------
bwahahahaha.... funny 
yeah i was gonna make it spin 90 degrees but the lazy ass thing is kicking in again...

-----------------------------------
Tony
Thu May 08, 2003 8:13 pm


-----------------------------------
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.

-----------------------------------
Asok
Thu May 08, 2003 8:15 pm


-----------------------------------
Tony, that game is called Tetris 2 and it's available on the SNES. I strongly reccomend it to anyone actively searching bargain bins ;)

-----------------------------------
Andy
Wed May 28, 2003 6:03 pm


-----------------------------------
i made tettris, and its pretty simple, just use a 2d array, and store all the blocks here's my game

-----------------------------------
Homer_simpson
Wed May 28, 2003 6:52 pm


-----------------------------------
that's the same thing as i've done... :roll: 
y dont u send yer tetris code so we can all see how it works?

-----------------------------------
Andy
Wed May 28, 2003 8:09 pm


-----------------------------------
its attached isn't it?
i could've made it better if i used a 3d array instead of all those procs
just set the grid #s to 1 and copy the entire grid to the actualy grid
that didn't make much sense, but anyways, yea, too lazy to change it, wasn't even for my own, did it for a friend...

-----------------------------------
Catalyst
Wed May 28, 2003 8:11 pm


-----------------------------------
it good, except the blocks fall too fast

-----------------------------------
Andy
Wed May 28, 2003 8:17 pm


-----------------------------------
just increase the delays variable at the very beginning
note: posted revised version

-----------------------------------
Homer_simpson
Wed May 28, 2003 8:31 pm


-----------------------------------
hmmmm.... built in shapes...!!!!! now y didn't i think of that... =/

-----------------------------------
Andy
Wed May 28, 2003 8:43 pm


-----------------------------------
now how about the 200 bits? 
lol jk
but a couple of bits would be nice :wink:

-----------------------------------
Homer_simpson
Wed May 28, 2003 9:29 pm


-----------------------------------
well since it's my post i think it's my duty to give u bits... but u deserver it yer program is cool :D
+10 bits

-----------------------------------
Andy
Thu May 29, 2003 7:15 am


-----------------------------------
ahhhh, that's it? oh well, can't complain, better than nothing
thanx :wink:

-----------------------------------
Maverick
Sun Jan 11, 2004 3:45 pm


-----------------------------------
ManKickass game. GJ!

-----------------------------------
santabruzer
Sun Jan 11, 2004 6:56 pm


-----------------------------------
amazing design.. not too effiecient.. but it still works fine.. just a note.. if the third line gets filled, they don't get cleared... i dunnu.. what happened exactly but a line didn't get clear... mer...
