Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

bug report:

1: The last 2 colors are not unlockable (40 and 45) they roll over to the first and second unlock, and the 2 locks in the customize menu don't dissapear

2: when you beat level 50, you get the same animation of the color unlock, but (like 1) it also continues the streak, showing the thirth unlock. But you can't play after this, so this seems useless for the code.

how to fix:

if this is construct, from what ive found online it uses javascript so:

bugfix 1: this is something i can't guess from the situation, this is your own code, could be because you use a variable that counts up, and when it reaches 8 (the 40 unlockable) it goes above the count, and the variable gets reset to 0 or 1, and then it goes back to doing what it normally does (so every 40 levels it resets). BUT this is just guessing, its what ive done and it looks like it does that, i don't know how it would do it in an other way

bugfix 2: same count function, but this is more easily guessable:

i would assume you have a level check to see if the count up needs to happen, and every 5 levels, it counts the function for a new unlock up.

So an easy fix is making a variable called: lastlevel, and making it equal, the number of the last level. Then in the code check if the level = lastlevel, and if this is true, then don't run the code, example code (it isn't going to be 100% java, but it will get the point across):

int maxlevel = 50 //the highest level made in the game
int cycle = 5 // the cycle of when the next color unlocks
int counter = 0 //the counter to see where we are in the cycle
int currentlevel = 0 //the level we are on at this moment
int colorunlock = 0 //what is the next color that needs to be added


for (currentlevel= 0; currentlevel< maxlevel; currentlevel++ ) {
     if (counter < cycle) {
          counter == counter+1;
     }

    else{
       colorunlock == colorunlock+1 ;
       unlocknewcolor();
      counter == 0;
    }

 normalcode()
}


this is a possible way to fix it, but i do not know how your code works, so i would recommend changing the for loop into a if, and removing the normalcode() from it, but this is just an example for you to use to bugfix the code


this is the code with a check in place, to give an error when you don't have enough colors



int maxlevel = 50; //the highest level made in the game
int cycle = 5; // the cycle of when the next color unlocks
int counter = 0; //the counter to see where we are in the cycle
int currentlevel = 0 ;//the level we are on at this moment
int colorunlock = 0; //what is the next color that needs to be added
const colors = [yellow, orange, grey, green,blue,pink,red,purple,brown,magenta]; // if you use an array
int coloramount = 9; // if you just have the amount --> this is easier but ill be                                                      using it as a check
int coloramountinput = 0; // this is to put the length of the array given above                                                                     in.
int errors = 0 // is there an error, yes or no, to see if we can continue the code, or there is a wrong input

coloramountinput == colors.length;
if (coloramountinput == coloramount){}
else{ Console.log("the amount of colors are not the same");
errors == errors+1;}


if (coloramount = math.floor( (maxlevel-1)/5){}
else{ Console.log("the colors wont fill in the required amount of unlocks");
errors == errors+1;}


for (currentlevel= 0; currentlevel< maxlevel; currentlevel++ ) {
     if (counter < cycle) {
         counter == counter+1;
     }

    else{
       colorunlock == colorunlock+1;
         unlocknewcolor();
      counter == 0;
    }

 normalcode()
}





these are 2 ways you could fix it, but i would really like to be able to see the other 2 un unlockable colors

(+1)

Thanks for the feedback! I’ll fix this.