playMaker

Author Topic: Trying to do some Tetris like Stacks!  (Read 147 times)

rizwanash

  • Junior Playmaker
  • **
  • Posts: 51
    • View Profile
Trying to do some Tetris like Stacks!
« on: July 28, 2019, 01:04:30 PM »
Hey Guys,

I have a game where there are part of blocks coming down like Tetris but not in a gridy way, Its more like using Translate/Tween movement. How to go for if a Line is complete, Its a 3D game not 2D, Do i need to understand Arrays for it ?

There will always be 3 or 4 blocks that will complete the line and then it will vanish. just like tetris. how can i calculate if line is complete in specific bar. i have researched on it and found Arraymaker/Arraylist is being suggested strongly.

Are there any close to the game genre tutorials i can find using Arrays with Playmaker ? Any Samples or Examples i can see or have. Are there any Game Kits for that ?

I am posting it here after some research and these things i cant find. I have never used Arrays before. Any help would be appreciated.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4615
    • View Profile
    • jinxtergames
Re: Trying to do some Tetris like Stacks!
« Reply #1 on: July 28, 2019, 05:41:37 PM »
Hi.
I have made a testris game before :
http://www.jinxtergames.com/web-games/tetris/

The blocks that are used are actually split into several squares.

in my game it moves before you can see it and then checks if something is hit (wall, other block) it will move back to the previous position.

the movement is always in transition steps of 1.

Then when it can't go further down, it will register to the array. using the x and y transition.

for this you will need to use array maker as it is a lot more flexible as it uses refrences.

for this i used 10 arrays with a length of 22 (the playfield size) and as reference name on the arrays i used 0,1,2,3,4,5,6,7,8,9
array 0 would be the most left vertical row and 9 to most left.

When a tile was dropped it will check the position of each block and use that to reference the array, and set an int value (0 = empty, 1 = color red, 2 is color blue and so on.

then i would check each index from each array to check if there is an empty spot.
index would be the horizontal line.

So for example i would check index 0 from each of the 10 arrays and if all are greater than 1 remove the line.

its quite complex to set this up.

using raycasts can be another option but even then you might need arrays.

Here is a video about arrays :