How do I set up a height limit like tetris? (Help)

Well I have this game & its basically stacking stuff but I want it to have a height limit like tetris. You know if the things get stacked so high that it starts to get out of the screen you lose the game.. How would I set something up like this? I have no idea where to even start with a setup like this or if its possible at all... thanks for any help in advance :)

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited January 2015

    In your block actor, you'll need an attribute that changes value when the block is placed or has come to a stop. You might decide this by velocity=0 or touch is released or some other method. You'll then need a rule that says If attribute self.Placed is true AND attribute self.Position.Y>500 then Change Scene [game over scene]. Use whatever value you prefer in place of 500.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • http_gamesaladhttp_gamesalad Member Posts: 1,340

    @tatiang I don't have blocks, I have balls.. also they have a downward direction of 270at speed of 300.. & they bounce.. will it still work with all these factors?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    I don't know but it's worth trying.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • http_gamesaladhttp_gamesalad Member Posts: 1,340

    Okay @tatiang I'm having a problem understanding what you mean by "In your block actor, you'll need an attribute that changes value when the block is placed or has come to a stop." How would I set something like this up?

  • SocksSocks London, UK.Member Posts: 12,822

    @http_gamesalad said:
    tatiang I don't have blocks, I have balls..

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @http_gamesalad said:
    Okay tatiang I'm having a problem understanding what you mean by "In your block actor, you'll need an attribute that changes value when the block is placed or has come to a stop." How would I set something like this up?

    I really don't know much about your game other than it shares some features with Tetris and has balls that drop and bounce. Do the balls stack on top of each other and form a chain from the bottom of the scene to the top? If so, then you just need to check the Y position of the ball actor after some amount of time (long enough for the ball to drop into the gameplay area). If you want to follow my suggestion above, then you have to consider what condition in your game means that the ball has stopped moving. Maybe you can provide a screenshot of what your game looks like when it's being played?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • http_gamesaladhttp_gamesalad Member Posts: 1,340

    The balls do stack on top of each other & they bounce & move around @tatiang

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @tatiang said:
    If so, then you just need to check the Y position of the ball actor after some amount of time (long enough for the ball to drop into the gameplay area).

    In other words, if you were to check right as the balls spawn/drop, the Y position would already be at or above the scene height and the rule would trigger, ending the game. So you might need to have something like an After 1 second timer to allow the balls to drop into play before checking their Y position.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • http_gamesaladhttp_gamesalad Member Posts: 1,340

    @tatiang The thing is, I don't know how to set up something to check the balls Y position

  • http_gamesaladhttp_gamesalad Member Posts: 1,340

    :/ Please bare with me.. I'm not that advance

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    The rule looks like this:

    If attribute self.Time > 0.5 AND attribute self.Position.Y > 500 then do Change Scene [scene name]

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SocksSocks London, UK.Member Posts: 12,822

    One other route would be to have a sensor at the top of the screen - and the rule for the ball would be . . . . if it is colliding with the sensor and another ball then game over.

  • http_gamesaladhttp_gamesalad Member Posts: 1,340

    @Socks never thought about that

Sign In or Register to comment.