tetris like game. help please on borders.

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

Comments

  • VolontaArtsVolontaArts Member Posts: 510
    bump thanks for the views
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    edited July 2013
    Hmm... that is a lot of views without a comment.

    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...
  • VolontaArtsVolontaArts Member Posts: 510
    Hmm... that is a lot of views without a comment.

    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 10x20 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?
  • VolontaArtsVolontaArts Member Posts: 510
    but i do see where tetris gets its blocky steady movement from now
  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2013
    What @RThurman suggested is definitely a good direction to go in - another would be to move the blocks down by a fixed amount.

    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.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    so let me get this straight. everything is already there just invisible? wouldnt it be easier to spawn random color actors/blocks?
    Yes!
    No!
  • VolontaArtsVolontaArts Member Posts: 510
    What @RThurman suggested is definitely a good direction to go in - another would be to move the blocks down by a fixed amount.

    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.
    thank you. you guys are always so helpful
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    @Socks -- That kind of mechanic will work for a bejeweled (or match 3) kind of game.

    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.
  • SocksSocks London, UK.Member Posts: 12,822
    @RThurman

    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. :)
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    @RThurman
    I advise anyone with 'Tynan's Hammer' to see their doctor. :)
    I have to admit it -- I have a bad case of 'Tynan's Hammer'. It lurks at the back of my mind -- always taunting me. Like a PTSD, it is always there just waiting for the most embarrassing moment to reveal itself.

    Have you found the cure for it yet? Do you know a doctor who can provide the answer?
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    To bring this discussion back to focus. I'd suggest making a game 'something like tetris' like this.

    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.)
  • HC_DKHC_DK Member Posts: 92
    Hi,

    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
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    @HC_DK -- Yep, that's what I was trying to say. (But you said it better!)

    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.
  • HC_DKHC_DK Member Posts: 92
    @RThurman - Not better but another explanation, which sometimes helps.
    And the info is just copied from "my" original tetris-thread :-) Lazy I am....
  • VolontaArtsVolontaArts Member Posts: 510
    @HC_DK
    @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?
  • HC_DKHC_DK Member Posts: 92
    Check out the free tutorial at gshelper.com for the swipe-control or maybe deepblueapps have something...
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    @Mpaula620 -- I'd say that super puzzle fighters has both aspects. But because it uses square (single actor) blocks, it would be easier to make it more like a bejeweled game. Here is an example that @Uptimistik is working that has some similarities:

    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
  • VolontaArtsVolontaArts Member Posts: 510
    thanks again.
  • SocksSocks London, UK.Member Posts: 12,822
    I have to admit it -- I have a bad case of 'Tynan's Hammer'. It lurks at the back of my mind -- always taunting me. Like a PTSD, it is always there just waiting for the most embarrassing moment to reveal itself.

    Have you found the cure for it yet? Do you know a doctor who can provide the answer?
    What's I've found works best it concealing it with loose clothing and then simply living in shame.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    @Mpaula620 -- No problem!

    @Socks -- LOL ohhh... the shame!
Sign In or Register to comment.