tetris like game. help please on borders.
VolontaArts
Member Posts: 510
So im doing my backgrounds to my game. now im wondering, since its something like tetris, the cubes coming down have to stop at the bottom of the screen. do,or should i create a bordered line going around the screen as an actor so that i can write the rule for the tetris cube to collide with. or can i just draw the bordered line into my background. and tell the tetris block to not go passed a certain area?
thanks for your help and ideas
thanks for your help and ideas
Comments
You can do it both ways, and it will be just about as easy (or hard) either way.
But tetris is not built like that. The blocks don't actually move. Instead there is an array of blocks and they get turned on and off to give the illusion of movement.
Think of making a 10x30 grid of actors. Then make it so that four actors (which form the tetris piece) get turned a different color. To move down, actors just below the colored actors get turned on. And so on...
you just blew my mind! lol
so let me get this straight. everything is already there just invisible? wouldnt it be easier to spawn random color actors/blocks?
So if you have a 100x100 block, you could say every 1 second change this block's Y value to Y-100 . . . . then wrap this in a rule that says only do this if Y > than 20 (or whatever value your baseline is) - so your blocks will move down one step at a time until they stop at Y=20.
No!
But a game that is "something like tetris" is built with arrays. Its because there are really four pieces (actors) that form the 'tetris' piece. And the piece needs to move vertically and rotate and collide. And a really smart person on this forum named 'Tynan' once showed us that it is very, very difficult to get a four piece 'hammer' to collide correctly with all the other actors. Constraints and all don't work well with the physics engine.
Unless you can solve the conundrum of 'Tynan's Hammer' I'd advise not going down that route.
Very true, my route is more suited to a single block falling setup, rather than a Tertris style setup.
I advise anyone with 'Tynan's Hammer' to see their doctor.
Have you found the cure for it yet? Do you know a doctor who can provide the answer?
Make a grid of actors that go 10 across and 20 down. (That's 200 actors.)
Then make a table that is 10 across and 20 down. (That's 200 cells)
Constrain each actor into its corresponding table cell.
Do all the 'tetris' logic on the table itself. (Each actor just shows the state of its corresponding cell during game play.)
I dont know if you have allready seen this but I made this in gamesalad a while back:
Short version, I used 4 actors, 1 main block and 3 blocks constraining to Main block X,Y and rotation.
One table with 21 ROW's and 10 COL's for the gameboard (ROW 21 is used as the bottom of the board).
Then I constantly check each actors position in the table by "converting" their X and Y into ROW and COL. This I use to check if any Cell surrounding this actor is "filled" and "disable" left or right movement or saving the 4 actor positions in the table.
After the positions are saved I check if a ROW is "full" and then delete it and add a new ROW at the beginning of the table.
When that is done I "update gameboard" and move the Main Actor back to start position and the game can continue.
The gameboard is made from one actor per cell in the table, when cell value = 0 not visible and value = 1 visible.
I am not sure this is the best way but I did not think this through before I started making this which means I have added "functions" as I needed them.
HC
The only difference between our approaches seems to be that you create a separate tetris piece (using four actors) and move (and rotate) it around. Whereas I just light up the actors on the gameboard to display the location and rotation of the tetris piece. That way its all done with tables -- and no actual moving parts.
And the info is just copied from "my" original tetris-thread :-) Lazy I am....
@Rthurman
@socks
the game im actually making is more like super puzzle fighters. is your way still best Thurman?
and does game salad have swipe control instead of buttons?
http://forums.gamesalad.com/discussion/58100/epic-linkage-coming-soon-from-uptimistik#latest
Here is an template that might help you get started:
http://forums.gamesalad.com/discussion/48314/bejewelled-type-game-wip-multiple-passes-working/p1
@Socks -- LOL ohhh... the shame!