I'm trying to male an aliene game where there is meteors/balls flying all around and if one catches you you die OR alternatively an alien that had to catch the balls in however long time, however finding it soooooo hard!
Heres my code so far, doesn't work :(
1st tab=
//Declaring
//library for music
import ddf.minim.* ;
//Variables
PImage img;//background
AudioPlayer player;
Minim minim;
Alien myAlien;
Ball myMoon;
//
void setup() {
size(800, 800); //size of screen
smooth();
ellipseMode(RADIUS);
shapeMode(CENTER);
//background image
img = loadImage("space.jpg");
image(img,0,0);
//music
minim = new Minim(this) ;
player = minim.loadFile("Free Video Game Music.mp3");
player.play();
//alien
score = 0;
myAlien = new Alien(450, 320, 200, 220);
myAlien = new Ball(200,200);
}
void draw(){
background(img);
fill(color(229,228,178));
myAlien.drawAlien();
myAlien.move();
fill(color(178,65,172));
//moon balls
myMoon.display();
myMoon.move();
myMoon.bounce();
myMoon.gravity();
if(myAlien.checkForOverlap(myMoon)) {
for(int i = 0; i < 50; i++) { //function of moon balls
Ball myMoon = (Ball) ballGroup.get(i);
myMoon.run();
if(vanish==true)
{
destroy(mousePressed);
vanish = false;
}
moons();
text ( "Game over": ", 400,40);
GameOver();
}
}
//music stop
{
minim.stop();
super.stop();
}
//
2nd=
class Alien {
//Variables for Class Alien
int bodyXLoc;
int bodyYLoc;
int bodyWidth;
int bodyHeight;
int antennaeWidth;
int antennaeHeight;
int antennaeHeight;
int antennaeXLoc;
int antennaeYLoc;
int eyeboxWidth;
int eyeboxHeight;
int eyeboxXLoc;
int eyeboxYLoc;
int Alien = 0;
int ySpeed;
int xSpeed;
//class description
Alien(int x, int y, int meteorWidth, int meteorHeight) {