Hi!
I’m working on a collision system at the moment and everything seemed to work fine (actually not but I want to solve all the other problems on my own lol ) but then I realised that a boolean in the code was first set to true - in an if-statement - and then to false - in the associated else statement. WHAT? It’s kinda difficult to show the problem without many lines of code, but I’ll try my best here:
if(player.x + player.acceleration[2] > x[0] - playerSizeX &&
player.x - player.acceleration[1] < x[1] + playerSizeX &&
player.y + player.acceleration[0] >= y[0] - playerSizeY &&
player.y < y[3] - player.valueForMovingDown[1])
{
player.y = y[0] - playerSizeY;
player.collision[0] = true;
println("This should not");
}else{
player.collision[0] = false;
println("happen :/");
}
It prints out the whole sentence. As I just showed the segment I’m talking about and didn’t explain anything else, feel free to ask for more code!