Original Post
I already posted this one in the "beginners" forum but there is no response there as of yet
so that''s why I post it again here, because I''m really desperate
i''m good stuck in this game
I already have a random block that I can move in my playfield
now when I hit the floor (or another block) it should be placed on my playfield at that place
My playfield is a 20x10 array
Playfield [20] [10]
and my blocks are also put in an array like this
blocks = 6 ; // 7 blocks
rotation = 3 ; // 4 rotations a block
block [Blocks] [rotation] [4] [4]
those [4] [4] are my blocks, like this by example
0000 0100 0110
0010 0100 0110
0111 0100 0110
0000 0100 0000
a 1 is for a red block, 2 purple, .....
now when I place that block in my playfield (array)
I go to my function BlockInArray()
and now it places that block on 3 positions in my array?!?
everytime 10 blocks between
and my function is only runned once (I used a timer to check)
here''s my function :
void BlockInArray()
{
x = ((Pos_X/16)-19) ; // calculate x/y
y = ((Pos_Y/16)-9) ; // position in playfield
for (i=0; i<4; i++)
{
for (j=0; j<4; j++)
{
if (blocks [block] [rotation] [j]) // check if there is a cube in that array
{
// if so position it beginning at x & y
PlayField [x+i] [y+j] = blocks [block] [rotation] [j] ;
} ; // end of if
} ; // end of for j
} ; // end of for i
Pos_X = PlayfieldX+48 ; // position new block in the
Pos_Y = PlayfieldY ; // middle top of playfield
RandomPiece() ;
} // end of BlockInArray()
I''m really desperade, I''ve been breaking my head over this problem now for 2 weeks :/
Big thanx in advance if any one can help me
(if you want me to send the complete code to you then send an email to s_noppe@hotmail.com or contact me on MSN or icq 3347831)