Cant get my if statement to wrok
in
Programming Questions
•
8 months ago
Im trying to make a game and im pretty sure my if statement is terribly wrong
i wantit to draw the start screen when enter or return are pressed
//Pimp_Man
int time; //Timer for elapsed time
int m = millis(); //Shorten time used to type "millis()"
void setup() {
noLoop();
size(800,800); //size of game
textSize(20); //size of timer text
textAlign(100,100); //alignment of timer
}
void draw() {
begin(); //call Start Screen
background(255); //White Background
time=m/1000; //Timer itself
}
void begin() { //Start Screen
background(0); //Black Background
text("PIMP MAN",400,200); //Game Title
text("Press Return to Start",width/2,height/2); //How to Start
if(keyPressed == ENTER || keyPressed == RETURN) { //Pushed to Start
loop();
}
}
1