Adding new scenes

Hi everyone, I'm very new to Gamesalad and I just finished creating Monster Maze by following the videos provided by the tutorial. Here's my question:

I am trying to add an extra level to the game. The first level works fine (by eating 3 candies and reaching the finish line) and triggers the new scene I created. But when I complete the same victory condition to the this new scene I created It doesn't trigger the same victory condition and move to the "You Win" scene. What am I doing wrong?

Thanks in advance : )

Comments

  • bob loblawbob loblaw Member, PRO Posts: 793

    is the behaviour you are using set to go to the win scene, or is it maybe set to go to next or an index?

  • lzantua_isp_edulzantua_isp_edu Member, PRO Posts: 6
    edited April 2020

    Set to go to the next scene...

    Another strange thing is when I go to preview mode and select the new scene I created, It would trigger the victory condition...

  • lzantua_isp_edulzantua_isp_edu Member, PRO Posts: 6

    I'm not sure if it has anything to do with why this is happening but the setting for game attribute is:

    prizeCount =2

    Both scenes would only have 2 candies for the monster to eat, and reach the finish line to trigger the victory condition.

    What if I would like to have each succeeding scene would have more candies for the monster to eat...how should I go about this?

  • bob loblawbob loblaw Member, PRO Posts: 793
    edited April 2020

    whatever the next scene is in your order is where it should go then, unless you have conflicting logic that’s being triggered first.

    with the preview thing, it might be that your default value in the scene has already reached the condition to move the scene on.

    eg. if you have a game where a character needs to eat at least 20 dots before a level ends. if you use a global attribute to count the dots, unless the game resets that attribute to 0 at the start of every level, the level end will automatically trigger.

    any level should have an actor to reset global attributes, and it should be placed as the first actor on the lowest/last layer of a scene - unless you want the value of that attribute to continue through the game.

    in a game where you eat candy and you need to get a different amount. have a global variable that counts how much candy is on the level (i’ll call it candyOnLevel to try describe). to do this, like described above, the first actor on the lowest level (call it gameController) should have a behaviour change attribute candyOnLevel = 0. then on your candy actor, have its first behaviour as candyOnLevel = candyOnLevel + 1. that way your candy should automatically be counted without needing to muck around with other logic. then within the actor that eats the candy, you would put a rule saying if it overlaps/collided with candy, change attribute candyOnLevel to candyOnLevel-1. then also s rule somewhere saying if candyOnLevel =0 do whatever at the end of the level.

    you would also need to set up conditions for the state of play so the 0 candy doesn’t get triggered before the candy is counted.

  • lzantua_isp_edulzantua_isp_edu Member, PRO Posts: 6
    edited April 2020

    Thanks Bob, this is making sense now : )

    I was able to fix the issue by creating a new actor and adding the behavior : change attribute, then set it to game.prizecount = 2.

    This is because I set the game attribute to prizecount = 2


    Would it be easier to go about having multiple number of candies to eat in each level to just not have a game attribute set?

  • bob loblawbob loblaw Member, PRO Posts: 793

    have a look at what I have done in the basic attached demo. this is one type of method so that you can make a template scene to duplicate and tweak quicker while you build. that way you don't need to manually update if you change things in each level.


Sign In or Register to comment.