Level Select Question

0 favourites
  • 8 posts
From the Asset Store
A set of retro 16-Bit Neon UI elements to make your menus pop!
  • guys sorry for the trouble but i've been having trouble with my level select been trying out lots of level select here in the forum but to no avail i failed.. i am almost there but i got some problems whenever a finish a level sometimes i open 2 levels above instead of only one.. can someone please help me, been trying to solve this issue for almost a month

    my game is like angry birds and my level select + star system is also alike from angry birds..

    the bug that i have is

    1.) when i finish a level and back to level select i unlock 2 levels ahead of me and i don't know at what instance it will happen it is random.

    here is my capx just remove the . on the start thanks for the help in advance

    .https://www.dropbox.com/sh/u6d361unvegv4qy/H_FWklRDWO

  • Without seeing the capx I think it would only be guess work - not that that has ever stopped me before !

  • Oh what the heck. <img src="smileys/smiley1.gif" border="0" align="middle" />

    Do you have something like LevelUpgrade=0

    I have done well so let LevelUpgrade=LevelUpgrade+1

    LevelFinished so Level=level+LevelUpgrade

    ? If so look at where you set these doing the leveUpgrade twice

    (total guess)

  • i edited my post i post my capx with . on the start just remove it you can download it thanks

    i dont have levelupgrade but i have currentlevel = 0

    then after i finish a level

    add 1 to currentlevel

  • What I tend to do is on each level I have a sprite that holds level information in instance variables. Like CurrentLevel, NextLevel, etc... at the end of the layout I read these variables and use them for level unlock, score, etc... makes it easy and since the sprite has the same name on each level, I only need one event to read it in my end of layout event.

  • blue ill try that.. thanks but can u explain a little more..

    like if i put an instance variable then should i delete my for example currentlevel global variable?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You can keep your globals if you want, just copy the value from the instance variable into it when the layout starts.

    I have an invisible object called LevelGoal at the end of each layout. When the player touches it, I have a condition that reads the instance variables from it. I also have global variables for the high score for each level, the number of gems for each level and if the level was beaten.

    When the user touches(collides with) the LevelGoal sprite, I check to see if the current level score is greater than the current levels score and if so I copy it into the global variable to replace the old high score. I also Set the Variable for if the level was beaten to yes. This is important because in my game a level can only be unlocked if the level before it has been beaten.

    On my level select screen I have code that looks at the state of if certain levels were beaten for other things as well, for example in my game every 4 levels beaten you learn a new ability. So by tracking if level 4,8,12 are beaten I can control what abilities the player has. This also means that once they have beaten those levels, they can go back and play them with their new moves since I track that those moves are now unlocked for them to use.

    This is just an example of how I do things and may not be the best or most efficient but it gives me a system that I can easily understand exactly where a player is in the game and what they have done.

    Also by storing the stats in globals I can do other things, for example my system of awarding medals to players is based on looking at a combination of how many gems they found in the level as well as their score. My level select screen then uses this to properly display what medal they have been awarded for that level (Bronze, Silver, Gold, Platinum, etc...).

  • ok sir thank you i got the idea now, ill try it on and see if it works with my level select or if i follow it right <img src="smileys/smiley1.gif" border="0" align="middle" />

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)