Auction Lemon wrote:
OK, so I'm working on this game that is like space invaders but with two players. They way someone wins the game is by destroying all of the aliens on screen and and the person with the most points wins. My problem is that I don't know how to transition to a different room after all the aliens are gone and determine who the winner is. I appreciate any help I can get. Thanks! (By the way, I'm using Game Maker 8.1.)
It sounds like you need the variables for player points to be global.
By appending "global." to a variable, you are creating a global variable. Global variables will retain their values for the entire life of the game, regardless of room.
so basically what you want is something like this:
Code:
global.playerOneScore = 0;
global.playerTwoScore = 0;
do this when your gameplay starts and then when you move to another room, you can still reference them. Just add to the values as P1 and P2 gather points.
Let me know if you need any clarification on anything.
[quote="Auction Lemon"]OK, so I'm working on this game that is like space invaders but with two players. They way someone wins the game is by destroying all of the aliens on screen and and the person with the most points wins. My problem is that I don't know how to transition to a different room after all the aliens are gone and determine who the winner is. I appreciate any help I can get. Thanks! (By the way, I'm using Game Maker 8.1.)[/quote]
It sounds like you need the variables for player points to be global.
By appending "global." to a variable, you are creating a global variable. Global variables will retain their values for the entire life of the game, regardless of room.
so basically what you want is something like this:
[code]global.playerOneScore = 0;
global.playerTwoScore = 0;[/code]
do this when your gameplay starts and then when you move to another room, you can still reference them. Just add to the values as P1 and P2 gather points.
Let me know if you need any clarification on anything.