How do I set up a height limit like tetris? (Help)
http_gamesalad
Member Posts: 1,340
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
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
@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?
I don't know but it's worth trying.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
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
The balls do stack on top of each other & they bounce & move around @tatiang
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
@tatiang The thing is, I don't know how to set up something to check the balls Y position
Please bare with me.. I'm not that advance
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
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.
@Socks never thought about that