I made up a basic game for an assignment due tmmrw but i am having trouble recording the score.The basis of the game is to move a player up and down enabling him to shoot a moving target. the score should increase everytime the obstacle and bullet make contact but instead the score increases everytime the x-values are the same. Any help?
int X = 703; //x-coordinate of target
int Y = 100; //y-coordinate of target
int Yspeed = 10; // speed od target
int x = 25; // x-coordinate of shapes
int y = 25; // y-coordinate of shapes
int z = 25; // x-coordinate of bullet
int h = 25;
float score = 0; // score
void setup()
{
size(800,500);
}
void draw() {
stroke (0);
fill (210,50,100);
rect (x+18,y+50,15,60);
fill (245,140,140);
ellipse(x+25,y+30,50,50); // Player
rect (x+33,y+57,40,7);
quad (x+18,y+69,x+18,y+57,x-2,y+103,x+3,y+103);
fill (0);
quad (x+27,y+110,x+33,y+110,x+40,y+155,x+35,y+155);
quad (x+25,y+110,x+18,y+110,x+5,y+155,x+10,y+155);
fill (0);
rect (x+65,y+52,20,5);
rect (x+65,y+65,5,4);
triangle(z+86,y+52,z+86,y+56,z+98,y+54);