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

Username:   Password: 
 RegisterRegister   
 help for tetris plz
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
newatthis




PostPosted: Tue Jan 16, 2007 9:42 pm   Post subject: help for tetris plz

hey there, i took a computer science course at my school and i kind of regret it, anyways the final project is to make a game and i'm pretty retarded for making trying to make a game like tetris, but i did. I'm able to get my shapes to move, but i'm not 2 concerned with rotation at the minute. Right now i'm trying to do collision detections and stack the blocks. All i've really done is design my blocks and made them fall. I've tried to use a 2-d array (boolean type) and store the value at false. I dont really know how to correspond my playing grid with this array. It would be great if anyone could tell me how to correspond the array with my playing grid. Here is what i've done so far, the programming is pretty bad and messy. Also if there is another easier method to this, i'd be glad to hear it thnx


Tetris.t
 Description:
pretty bad lol

Download
 Filename:  Tetris.t
 Filesize:  8.99 KB
 Downloaded:  103 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
zedx_26




PostPosted: Sat Jan 20, 2007 10:54 pm   Post subject: Re: help for tetris plz

Firs I thnk you should test for colision before thinking about rotating it. Check if The blocks do not pass thorugh each other and do not exit the screen
agnivohneb




PostPosted: Sun Jan 21, 2007 12:24 am   Post subject: Re: help for tetris plz

I think you should create a grid so when you move your block left it will move over 5-10 px (not to sure what the actual is) and not 1 px. next create a 3d array (boolean type) so you can use it as your x and y. and have somthing like
code:

% declare taken spot
var takenspot : array 1 .. *, 1 .. * of boolean
for i : 1 .. *
  for j : 1 .. *
    takenspot (i,j) := false
  end for
end for

.........

if takenspot (whatever) = true then
  dont put block there
else
  put block there
end if


This code wont run tho but u get the idea.Idea

I just finished my game project (Tic Tac Toe) so i kinda know what u mean. Hit Wall
fishtastic




PostPosted: Thu Mar 22, 2007 3:30 pm   Post subject: RE:help for tetris plz

i am working on my tetris.
i use 1-d array for blocks
fishtastic




PostPosted: Fri Mar 23, 2007 9:13 pm   Post subject: RE:help for tetris plz

you tetris is too long. use 2d array will be helpful.

btw, mine is working perfectly and it's less than 300 lines .now i'm trying to make is shorter.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: