I'm new to processing and we've been instructed to build a small basic computer game. My role is creating the menu system and integrating the parts together.
However the problem I've got so far is that certain areas of code seem to be active, even though they are in an if statement based on conditions that aren't true.
When clicking on the 'about' section, I've instructed it to change from state 3 back to state 0 (the menu). However, when clicking on parts of the screen, the button functions from the menu (state 0) seem to be active. ie. If you click where the 'play' button is on the menu, but on the about section it still goes to the play section (state 1) of the game.
Yet, when you go to other sections like 'High Scores' and 'Play' (states 1 and 2), you don't get the same problem. Even though the if statement means the exact same thing.
It's as though the code from the menu (state 0) is still being called, even though the state has been set to something else.
Can anyone help me with this? Thanks.
PFont scaryfont32, scaryfont40, scaryfont48;
int state = 0;
String highscorers[] = {"Dan", "Dan", "James", "Bill"};
int highscores[] = {100, 80, 55, 10};
// Orange point light on the right
pointLight(50, 200, 50, // Color
200, -150, 0); // Position
// Blue directional light from the left
directionalLight(50, 50, 255, // Color
1, 0, 0); // The x-, y-, z-axis direction
// Yellow spotlight from the front
spotLight(255, 50, 50, // Color
10000, 10000, 30000, // Position
0, -0.5, -0.5, // Direction
PI / 2, 2); // Angle, concentration