Currently I am trying to make a maze game. I am simply trying to load in the sprites and get the program going but it is not working correctly and giving me an error message stating: Usage: PApplet [options] [sketch args] See the Javadoc for PApplet for an explanation. I have read up some answers that have some sort of solution, however I have no idea what they are talking about since I am a 13 year old beginner/intermediate programmer. Here is my code that is giving me the error message:
package MegaPackage;
import java.util.*;
import processing.core.PApplet;
import processing.core.PImage;
//Main method. Insert public variables and entities here.
public class FlatShooter extends PApplet {
PImage background;
PImage squareImage;
PImage life1Image;
PImage life2Image;
PImage life3Image;
PImage redEnemyImage;
public float xSpeedPlayer = 9;
public int score;
public int enemies;
public int lives;
public boolean moving = false;
public boolean moving2 = false;
public Square square;
public void setup(){
size(900, 900);
background=loadImage("background.jpeg");
squareImage=loadImage("player.png");
life1Image=loadImage("life.png");
life2Image=loadImage("life.png");
life3Image=loadImage("life.png");
square = new Square(squareImage, (width-100)/2, height * 4/5);
}
//Movement for player and other items
public void keyPressed(){
if( key == 'd' || key == 'D'){
moving = true;
}
if(key == 'a' || key == 'A'){
moving2 = true;
}
}
//Stopping movement for players and other items
public void keyReleased(){
if( key == 'd' || key == 'D'){
moving = false;
}
if(key == 'a' || key == 'A'){
moving2 = false;
}
}
public class Square{
PImage square;
float xPos;
float yPos;
public Square(PImage squareImage, float startX, float startY){
square=squareImage;
xPos=startX;
yPos=startY;
}
public void drawSquare(){
image(square, xPos, yPos);
}
}
public void move(float x, float y){
if(moving){
x += xSpeedPlayer;
}
if (moving2){
x-= xSpeedPlayer;
}
}
}
If you can give this answer in fairly simple terms and an easy solution please do so. Thank you.