Trying to figure out title screen / menu
in
Programming Questions
•
2 years ago
// i would like to put a title screen explaining how to play the game before it starts running I believe my problem lies i the //void keyPressed
float radius;
int timespressed,last;
PImage Loss;
void setup()
{
size(480,320);
radius=10;
smooth();
Loss = loadImage("GameLoss.gif");
}
void draw ()
{
background(0);
ellipse(width/2,height/2,radius*1.8,radius*1.8);
radius++;
if (radius == 0)
{
image(Loss, 0,0, 480,320);
}
if(radius > 180 )
{
image(Loss, 0,0, 480,320);
//radius%=width/2;
}
}
void keyPressed()
{
println(radius);
if(key== ENTER)
{
timespressed++;
if(timespressed>last) {
radius=0;
last=timespressed;
timespressed=0;
}
}
}
float radius;
int timespressed,last;
PImage Loss;
void setup()
{
size(480,320);
radius=10;
smooth();
Loss = loadImage("GameLoss.gif");
}
void draw ()
{
background(0);
ellipse(width/2,height/2,radius*1.8,radius*1.8);
radius++;
if (radius == 0)
{
image(Loss, 0,0, 480,320);
}
if(radius > 180 )
{
image(Loss, 0,0, 480,320);
//radius%=width/2;
}
}
void keyPressed()
{
println(radius);
if(key== ENTER)
{
timespressed++;
if(timespressed>last) {
radius=0;
last=timespressed;
timespressed=0;
}
}
}
1