All your Win are Belong to Us

svnsvn Member Posts: 445
edited November -1 in Working with GS (Mac)
I have a physics game coming along well, but I have a problem. The game should only finish the level IF: All of Block A is on top of Block B, Block A's linear velocity is 0, and if Block A is touching Block B. For the latter two conditions, I have no problem doing, but for the first one, I do not know the math to enable the game to tell whether or not the entire Block A is on top of Block B. [I have two Game-level attributes, Block-A X and Block-A Y that constrain themselves to Block A's X and Y positions.] What is the math needed?

Comments

  • I'm not sure I fully understand since I'm fairly new to this. However, if the blocks are of equal size and if block b is a different actor. You could make a rule in block B, if self x is equal to Block AX, then turn boolean winning condition 1 on, or something like that. I think this should work because if their X's are equal then they should be lined up in the same x value. My apologies if this was of no help.
  • svnsvn Member Posts: 445
    [EDIT]: I decided to try something different: I set up a Game-level Boolean attribute called Win. I also created a small (150 width, 10 height) actor called Win with its Alpha=0. Rule: "When Block A collides with Win" and "When Block A.motion.linear.X=0": Timer "After 2 seconds" Change Attribute "game.Win" to True. Then, I have a couple other actors with Rule: "When Attribute "game.Win": is True," Then: Interpolate Attribute "self.color.Alpha" to 1. The actors are in place and immovable. But when Block A hits actor Win, nothing happens. What's wrong?
Sign In or Register to comment.