Keeping 2 different types of gameplay within a set of scenes?

msx88msx88 Member, PRO Posts: 27

Hi,
I’m trying to figure out how to have 2 different types of game play within a set of 20 scenes.

What I specifically mean is, for one type of play, I’d like the game to be over when the player collects 50 coins.
The other type of play is, the player continues on indefinitely regardless of number of coins collected.

The player gets to choose either of the game play at the menu screen.

At the moment, I can set it up so that when the Index value = 50, game play is over.
But if the player chooses the other type of game play where they continue on to collect as many coins as possible, how would I go about setting this up without having it conflict with the other type of game play?

Do I need to have 2 sets of 20 scenes for each type of game play? That would come out to be 40 scenes total and I’m sure there is a much more efficient way to achieve this with code.

I’m sort of a beginner and I’m wondering if you have other ideas? Thank you!

Comments

  • HopscotchHopscotch Member, PRO Posts: 2,782
    edited December 2016

    @jimmyxpark

    make a game level attribute (e.g. game.GamePlayMode of type integer)

    On the menu,
    if the player chooses the normal mode, then first set game.GamePlayMode = 0 before changing scene to the game.
    If the player chooses endless mode, then first set game.GamePlayMode = 1 before changing scene to the game.

    Now, in the actor which currently checks for the win condition of 50, add the game.GamePlayMode as an extra condition:

    Rule (when all): 
    pointvalue = 50 and 
    game.GamePlayMode = 0 then
              --Win State--
    End rule
    

    This will then only stop gameplay at 50 points if normal mode is selected.

  • msx88msx88 Member, PRO Posts: 27

    thank you so much @Hopscotch ! I will give this a try :)

Sign In or Register to comment.