I can't seem to get Eclipse/Processing to cooperate. I'm getting "expecting EOF, found 'PImage'" on line 17... which I can't figure out. I know getting an EOF usually means you're missing a brace there, but I've not even gotten past class variables.
Deleting everything above changes nothing (meaning there isn't a stray curly brace in there), and if I delete that line it throws the same error message on the next all the way down the file.
Yet when I ran this same code in Processing, I didn't have any issues. I really would rather work in Eclipse, but I'm stumped.
I apologize in advance for the size of the class, but I wanted to make sure everything is in there.
import ddf.minim.*;
final static int xResolution = 1280;
final static int yResolution = 720;
final static float ground = 40;
final static int baseFrameRate = 60;
static Player player;
static LevelData levelData;
static Camera camera;
static IntroductionScreen introductionScreen;
static InstructionScreen instructionScreen;
static WinScreen winScreen;
static LoseScreen loseScreen;
static int backgroundColor = 255;
PImage backgroundImg;
PImage playerImg;
PImage monsterImg;
PImage flyingImg;
PImage bulletImg;
Sprite playerSprite;
Sprite monsterSprite;
Sprite flyingSprite;
Sprite bulletSprite;
Minim minim;
AudioPlayer lub;
AudioPlayer dub;
AudioPlayer hit;
AudioPlayer music;
MonsterSpawner monsterSpawner;
Renderer renderer;
// Main setup method that is called on game load.
void setup() {
loadMusic();
size(1280, 720, P2D);
frameRate(baseFrameRate);
background(backgroundColor);
smooth();
SplashScreen splashScreen = new SplashScreen();
splashScreen.drawSplashScreen();
loadImagesAndSprites();
createScreens();
monsterSpawner = new MonsterSpawner();
player = new Player(xResolution/2, yResolution/2, playerSprite);
Physics.addPlayerEntity(player);
levelData = new LevelData();
levelData.createLevelOneGroundHeights();
camera = new Camera();
renderer = new Renderer();
textSize(32);
randomSeed(234234324);
music.play();
}
void createScreens(){
introductionScreen = new IntroductionScreen(true);
if(introductionScreen.introductionScreenActive || winScreen.winScreenActive || loseScreen.loseScreenActive) { // Prevent the player from moving while screens are active
} else {
switch (key) {
case ('w'):case ('W'):player.goUp = true;break;
case ('a'):case ('A'):player.goLeft = true;break;
case ('s'):case ('S'):player.goDown = true;break;
case ('d'):case ('D'):player.goRight = true;break;
case ('i'):case ('I'):instructionScreen.instructionScreenActive = true;break;
}
}
}
// Handles all keyboard releases
public void keyReleased(){
if(introductionScreen.introductionScreenActive) // If the introduction screen is up, allow the player to press any key to begin