diff --git a/Character.pde b/Character.pde new file mode 100644 index 0000000..335cca6 --- /dev/null +++ b/Character.pde @@ -0,0 +1,61 @@ +void characterChecks() +{ + if (gender == "Male") + { + switch(preset) + { + case 1: + presetVar = "Male_preset1.png"; + break; + case 2: + presetVar = "Male_preset2.png"; + break; + case 3: + presetVar = "Male_preset3.png"; + break; + case 4: + presetVar = "Male_preset4.png"; + break; + case 5: + presetVar = "Male_preset5.png"; + break; + case 6: + presetVar = "Male_preset6.png"; + break; + default: + println("Something went wrong with Male presets."); + break; + } + } + if (gender == "Female") + { + switch(preset) + { + case 1: + presetVar = "Female_preset1.png"; + break; + case 2: + presetVar = "Female_preset2.png"; + break; + case 3: + presetVar = "Female_preset3.png"; + break; + case 4: + presetVar = "Female_preset4.png"; + break; + case 5: + presetVar = "Female_preset5.png"; + break; + case 6: + presetVar = "Female_preset6.png"; + break; + default: + println("Something went wrong with Female presets."); + break; + } + } + if (gender != "Male" && gender != "Female") + { + System.out.println("Uh oh, there's no proper gender selected!"); + } +} \ No newline at end of file diff --git a/Chest.pde b/Chest.pde new file mode 100644 index 0000000..205d8d9 --- /dev/null +++ b/Chest.pde @@ -0,0 +1,21 @@ +class Chest +{ + PVector chest = new PVector(700, 644); + PImage chestIMG; + boolean open = false; + + Chest() + { + } + + void chestDisplay() + { + if (chest.x <= Bob.x && chest.x+30 >= Bob.x +10) + { + chestIMG = loadImage("Chest Open.png"); + } + chestIMG = loadImage("Chest Closed.png"); + chestIMG.resize(40, 40); + image(chestIMG, chest.x, chest.y); + } +} \ No newline at end of file diff --git a/GameUI.pde b/GameUI.pde new file mode 100644 index 0000000..4ac5da8 --- /dev/null +++ b/GameUI.pde @@ -0,0 +1,65 @@ +void screenDisplay() +{ + rectMode(0); + //Health Display + fill(0, 0); + stroke(0); + rect(10, 10, 200, 30); + fill(255, 0, 0); + rect(10, 10, health*2, 30); + fill(255); + if (health>80) + { + textSize(health/3); + text("Health:" + health+"%", 10, 40); + } + else + { + textSize(30); + text(health+"%", 10, 40); + } + if (health <= 0) + { + gameScreen = false; + deathScreen = true; + } + + //Level Display + textSize(30); + fill(0); + text("Level: "+level + "/20", 250, 40); + + //Pause Button + fill(0); + stroke(255); + rect(890, 10, 100, 50); + fill(255); + textSize(30); + text("Pause", 895, 45); + timer += counter; + if (timer >= 10) + { + timer = 0; + counter = 0; + } + if (mousePressed) + { + if (mouseX>=890 && mouseY<=990) + { + if (mouseY>=10 && mouseY<=60) + { + if (pauseScreen && timer == 0) + { + pauseScreen=false; + counter = 1; + } + else if (timer == 0) + { + pauseScreen = true; + counter = 1; + } + } + } + } + println(counter+ "timer:"+ timer); +} \ No newline at end of file diff --git a/Inner_Demons.pde b/Inner_Demons.pde new file mode 100644 index 0000000..17b2240 --- /dev/null +++ b/Inner_Demons.pde @@ -0,0 +1,260 @@ +/********************\ + + Authors: + Eric Mazza, Shayne Lisk, Ben Kenard + + Start Date: + May 19th, 2017 + + Project Name: + Inner Demons + + Description: + This is a dungeon crawler game where the player gets multiple cusomization choices. + They are able to choose their gender, and one of the preset character looks, based on their gender. + + They are able to collect cool items, and they can fight monsters down in the deepest depths of a dungeon. + They can fight a giant boss monster, and truely face their Inner Demons. + + \********************/ + +//Images - Backgrounds +PImage startBackground; +PImage background2; +PImage background3; +PImage background4; +PImage bossBackground; + +//Images - Characters +PImage spriteSheet; +//Images - Enemies + +//Chest object +Chest randomChest = new Chest(); + +//Character Global Variables +int preset = 1; +String gender = "Male"; +String presetVar = "Male_preset1.png"; + +//Scene Checking Variables +boolean menuScreen = true; //Starts off true (Because it's the starting screen) +//The rest of the screens will be false, because they are only active when the player gets to them, menuScreen will be deactivated when switching from one screen to the next. +boolean characterScreen = false; +boolean quitScreen = false; +boolean difficultyScreen = false; +boolean gameScreen = false; +boolean optionsScreen = false; +boolean creditsScreen = false; +boolean pauseScreen = false; +boolean deathScreen = false; +boolean winScreen = false; + +//Difficulty Variables +int difficulty = 2; + +//Game Progression Variables +int level = 0; + +//Credits +int y = 700; + +//PauseMenu +int timer = 0; +int counter = 0; + +//Player Declaration +boolean keys[]; +Player Bob; +boolean arrowCheck = false; +boolean up = false; +boolean down = false; + +int health = 100; + +//Weapons +float damageMod = 0; +float damage = 5; +float finalDamage; +int currentWeapon = 1; +PImage[] weaponImage = new PImage[10]; + +/* +This section below determines what items the player has in their inventory. + If the player only has 3 items in his inventory, then only 3 items can be displayed. + */ +PImage[] inventory = new PImage[10]; +int weaponCount = 1; + +//Chest +int luck; + +void setup() +{ + size(1000, 700); //Sets the size of the screen + smooth(); + + //Image Defining + startBackground = loadImage("Starting Background.png"); + startBackground.resize(1000, 700); + background2 = loadImage("background2.png"); + background2.resize(1000, 700); + background3 = loadImage("background3.png"); + background3.resize(1000, 700); + background4 = loadImage("background4.png"); + background4.resize(1000, 700); + bossBackground= loadImage("boss_background.png"); + bossBackground.resize(1000, 700); + + //Player Defining + Bob = new Player(); + keys = new boolean[128]; +} + +void draw() +{ + checks(); //Runs all the screen checks constantly + characterChecks(); //Constantly checks what character should be displayed. + weaponChecks(); //Constantly checks what weapon should be displayed + move(); +} + +//The checks in the checks function just run through, to see what screen the user is supposed to be on. +void checks() +{ + if (menuScreen) + { + menuScreen(); + } + if (characterScreen) + { + characterScreen(); + } + if (quitScreen) + { + quitScreen(); + } + if (difficultyScreen) + { + difficultyScreen(); + } + if (gameScreen) + { + gameScreen(); + } + if (optionsScreen) + { + optionsScreen(); + } + if (creditsScreen) + { + creditsScreen(); + } + if (pauseScreen) + { + pauseScreen(); + } + if (deathScreen) + { + deathScreen(); + } + if (winScreen) + { + winScreen(); + } +} + +/* +Work in progress... + Short description of the code below: + This is supposed to make the button creation process go by a lot quicker and use less code... + currently, it doesn't work, but I have hopes for it to become very usefull. + Any suggestions for it would be very helpful. + */ +void buttonClick(int x1, int x2, int y1, int y2, boolean activate, boolean disable) +{ + if (mousePressed) + { + if (mouseX>=x1 && mouseX<=x2) + { + if (mouseY>=y1 && mouseY<=y2) + { //Selects YES + activate = true; + disable = false; + } + } + } +} + +/* +This area is used to control User movement + */ +void move() +{ + int xDelta=0; + int yDelta=0; + if (keys['w']) + { + //up = true; + Bob.levelChange(); + } + if (keys['a']) + { + xDelta -=4; + } + if (keys['d']) + { + xDelta+=4; + } + if (keys['s']) + { + health=health-100; + } + if (keys['c']) + { + chestOpen(); + } + //if (up == true) { Unfinished jump feature + // yDelta --; + //} + //if (y <= 550) { + // up = false; + // yDelta = 0; + //} + + Bob.updatePlayer(xDelta, yDelta); +} + + +void mousePressed() +{ + if (mousePressed) + { + Bob.attackUpdate(); + } +} + + + + + +void keyPressed() +{ + if (keyPressed && key == CODED) + { + System.out.println("Hey, you can't use the arrow keys!"); + arrowCheck = true; + return; + } + keys[key] = true; +} +void keyReleased() +{ + if (arrowCheck == true) + { + System.out.println("Try using: W, A, S, D!"); + arrowCheck = false; + return; + } + keys[key] = false; +} \ No newline at end of file diff --git a/Inner_Demons/Character.pde b/Inner_Demons/Character.pde index b9c569e..335cca6 100644 --- a/Inner_Demons/Character.pde +++ b/Inner_Demons/Character.pde @@ -1,6 +1,9 @@ -void characterChecks() { - if (gender == "Male") { - switch(preset) { +void characterChecks() +{ + if (gender == "Male") + { + switch(preset) + { case 1: presetVar = "Male_preset1.png"; break; @@ -24,8 +27,10 @@ void characterChecks() { break; } } - if (gender == "Female") { - switch(preset) { + if (gender == "Female") + { + switch(preset) + { case 1: presetVar = "Female_preset1.png"; break; @@ -49,7 +54,8 @@ void characterChecks() { break; } } - if (gender != "Male" && gender != "Female") { + if (gender != "Male" && gender != "Female") + { System.out.println("Uh oh, there's no proper gender selected!"); } } \ No newline at end of file diff --git a/Inner_Demons/Chest.pde b/Inner_Demons/Chest.pde index e61ada2..205d8d9 100644 --- a/Inner_Demons/Chest.pde +++ b/Inner_Demons/Chest.pde @@ -1,30 +1,21 @@ -class Chest { +class Chest +{ PVector chest = new PVector(700, 644); PImage chestIMG; boolean open = false; - Chest() { + Chest() + { } - void chestDisplay() { - chestIMG = loadImage("Chest Closed.png"); - if (chest.x-10 <= Bob.x && chest.x+40 >= Bob.x +10) { - fill(255); - text("Press 'e' to open!", 10, 130); - if (keys['e']) { - if (chestOpen == false) { - chestOpen(); - } - chestOpen = true; - } - } - chestIMG.resize(40, 40); - if (chestOpen == true) { + void chestDisplay() + { + if (chest.x <= Bob.x && chest.x+30 >= Bob.x +10) + { chestIMG = loadImage("Chest Open.png"); - chestIMG.resize(70, 70); - image(chestIMG, chest.x-18, chest.y-10); - } else { - image(chestIMG, chest.x, chest.y); } + chestIMG = loadImage("Chest Closed.png"); + chestIMG.resize(40, 40); + image(chestIMG, chest.x, chest.y); } } \ No newline at end of file diff --git a/Inner_Demons/GameUI.pde b/Inner_Demons/GameUI.pde index 930491a..4ac5da8 100644 --- a/Inner_Demons/GameUI.pde +++ b/Inner_Demons/GameUI.pde @@ -1,4 +1,5 @@ -void screenDisplay() { +void screenDisplay() +{ rectMode(0); //Health Display fill(0, 0); @@ -7,25 +8,25 @@ void screenDisplay() { fill(255, 0, 0); rect(10, 10, health*2, 30); fill(255); - if (health>80) { + if (health>80) + { textSize(health/3); text("Health:" + health+"%", 10, 40); - } else { + } + else + { textSize(30); text(health+"%", 10, 40); } - if (health <= 0) { + if (health <= 0) + { gameScreen = false; deathScreen = true; } //Level Display textSize(30); - if (level < 5) { - fill(0); - } else { - fill(255); - } + fill(0); text("Level: "+level + "/20", 250, 40); //Pause Button @@ -36,21 +37,29 @@ void screenDisplay() { textSize(30); text("Pause", 895, 45); timer += counter; - if (timer >= 10) { + if (timer >= 10) + { timer = 0; counter = 0; } - if (mousePressed) { - if (mouseX>=890 && mouseY<=990) { - if (mouseY>=10 && mouseY<=60) { - if (pauseScreen && timer == 0) { + if (mousePressed) + { + if (mouseX>=890 && mouseY<=990) + { + if (mouseY>=10 && mouseY<=60) + { + if (pauseScreen && timer == 0) + { pauseScreen=false; counter = 1; - } else if (timer == 0) { + } + else if (timer == 0) + { pauseScreen = true; counter = 1; } } } } + println(counter+ "timer:"+ timer); } \ No newline at end of file diff --git a/Inner_Demons/Inner_Demons.pde b/Inner_Demons/Inner_Demons.pde index c49857d..17b2240 100644 --- a/Inner_Demons/Inner_Demons.pde +++ b/Inner_Demons/Inner_Demons.pde @@ -49,7 +49,6 @@ boolean creditsScreen = false; boolean pauseScreen = false; boolean deathScreen = false; boolean winScreen = false; -boolean helpScreen = false; //Difficulty Variables int difficulty = 2; @@ -85,20 +84,14 @@ This section below determines what items the player has in their inventory. If the player only has 3 items in his inventory, then only 3 items can be displayed. */ PImage[] inventory = new PImage[10]; -int[] inventoryTrack = new int[10]; int weaponCount = 1; -//Weapon location variables -float weaponX; -float weaponY; - //Chest int luck; -int chestAppearLuck; -boolean chestOpen = false; -void setup() { - size(1000, 700, P3D); //Sets the size of the screen +void setup() +{ + size(1000, 700); //Sets the size of the screen smooth(); //Image Defining @@ -118,84 +111,147 @@ void setup() { keys = new boolean[128]; } -void draw() { +void draw() +{ checks(); //Runs all the screen checks constantly - weaponChecks(); //Constantly checks what weapon should be displayed characterChecks(); //Constantly checks what character should be displayed. + weaponChecks(); //Constantly checks what weapon should be displayed move(); } //The checks in the checks function just run through, to see what screen the user is supposed to be on. -void checks() { - if (menuScreen) { +void checks() +{ + if (menuScreen) + { menuScreen(); } - if (characterScreen) { + if (characterScreen) + { characterScreen(); } - if (quitScreen) { + if (quitScreen) + { quitScreen(); } - if (difficultyScreen) { + if (difficultyScreen) + { difficultyScreen(); } - if (gameScreen) { + if (gameScreen) + { gameScreen(); } - if (optionsScreen) { + if (optionsScreen) + { optionsScreen(); } - if (creditsScreen) { + if (creditsScreen) + { creditsScreen(); } - if (pauseScreen) { + if (pauseScreen) + { pauseScreen(); } - if (deathScreen) { + if (deathScreen) + { deathScreen(); } - if (winScreen) { + if (winScreen) + { winScreen(); } - if (helpScreen) { - helpScreen(); +} + +/* +Work in progress... + Short description of the code below: + This is supposed to make the button creation process go by a lot quicker and use less code... + currently, it doesn't work, but I have hopes for it to become very usefull. + Any suggestions for it would be very helpful. + */ +void buttonClick(int x1, int x2, int y1, int y2, boolean activate, boolean disable) +{ + if (mousePressed) + { + if (mouseX>=x1 && mouseX<=x2) + { + if (mouseY>=y1 && mouseY<=y2) + { //Selects YES + activate = true; + disable = false; + } + } } } /* This area is used to control User movement */ -void move() { +void move() +{ int xDelta=0; int yDelta=0; - if (keys['w']) { + if (keys['w']) + { //up = true; Bob.levelChange(); } - if (keys['a']) { + if (keys['a']) + { xDelta -=4; } - if (keys['d']) { + if (keys['d']) + { xDelta+=4; } - if (keys['s']) { - health --; + if (keys['s']) + { + health=health-100; } + if (keys['c']) + { + chestOpen(); + } + //if (up == true) { Unfinished jump feature + // yDelta --; + //} + //if (y <= 550) { + // up = false; + // yDelta = 0; + //} + Bob.updatePlayer(xDelta, yDelta); } -void keyPressed() { - if (keyPressed && key == CODED) { - text("Use 'W A S D' to move - using the arrow keys can crash the game!", 0, 100); + +void mousePressed() +{ + if (mousePressed) + { + Bob.attackUpdate(); + } +} + + + + + +void keyPressed() +{ + if (keyPressed && key == CODED) + { System.out.println("Hey, you can't use the arrow keys!"); arrowCheck = true; return; } keys[key] = true; } -void keyReleased() { - if (arrowCheck == true) { - text("Use 'W A S D' to move - using the arrow keys can crash the game!", 0, 100); +void keyReleased() +{ + if (arrowCheck == true) + { System.out.println("Try using: W, A, S, D!"); arrowCheck = false; return; diff --git a/Inner_Demons/Monsters.pde b/Inner_Demons/Monsters.pde index c502361..a32de83 100644 --- a/Inner_Demons/Monsters.pde +++ b/Inner_Demons/Monsters.pde @@ -1,23 +1,39 @@ -class Monsters { +class Monsters +{ float monsterX; float monsterY; PImage [][] Orc; - Monsters(/*float tempX, float tempY*/) { + Monsters(/*float tempX, float tempY*/) + { } - void setupMonsters() { - Orc = new PImage[12][9]; - spriteSheet = loadImage("Orc.png"); + void setupMonsters() + { + Orc = new PImage[12][9]; + spriteSheet = loadImage("Orc.png"); + } - - void monsterUpdate() { + + + void monsterUpdate() + { float r=random(1); - if (r <=.1) { + if(r <=.1) + { monsterX = monsterX + 5; } - if (r >.1 && r <=.2) { + if(r >.1 && r <=.2) + { monsterX = monsterX -5; } + + + } + + + + + } \ No newline at end of file diff --git a/Inner_Demons/Player.pde b/Inner_Demons/Player.pde index e9f494a..a8e2be3 100644 --- a/Inner_Demons/Player.pde +++ b/Inner_Demons/Player.pde @@ -2,17 +2,22 @@ class Player { float x, y; PImage [][] movement; + PImage [][] attack; boolean inMotion; //Lets you know if character is moving or not + boolean attacking; //Lets program know if player is attacking or not int currentDirection; float currentFrame; + float currentFrame2; final int UP = 0, LEFT = 1, DOWN = 2, RIGHT =3; Player() { inMotion = false; + attacking = false; currentDirection=3; currentFrame=3; + currentFrame2=1; x = 100; y = 625; @@ -26,16 +31,20 @@ class Player spriteSheet = loadImage(presetVar); //Load entire spritesheet for (int i = 0; i < 9; i++) { - movement[0][i] = spriteSheet.get(21 + 64 * i, 514, 32, 65); //Upward moving sprite - movement[1][i] = spriteSheet.get(16 + 64 * i, 578, 40, 65); //Left moving sprite - movement[2][i] = spriteSheet.get(16 + 64 * i, 642, 32, 65); //Downward moving sprite + movement[0][i] = spriteSheet.get(10 + 64 * i, 514, 40, 65); //Upward moving sprite + movement[1][i] = spriteSheet.get(10 + 64 * i, 578, 45, 65); //Left moving sprite + movement[2][i] = spriteSheet.get(10 + 64 * i, 642, 40, 65); //Downward moving sprite movement[3][i] = spriteSheet.get(10 + 64 * i, 706, 40, 65); //Right moving sprite + movement[4][i] = spriteSheet.get(10 + 64 * i, 384, 40, 65); //Left attacking animation + movement[5][i] = spriteSheet.get(10 + 64 * i, 448, 40, 65); //Right attacking animation } } + - void levelChange() { - chestOpen = false; - chestAppearLuck = (int) random(1, 3); + + + void levelChange() + { fill(255, 90); text("Level Up!", 70, 70); level++; @@ -44,31 +53,45 @@ class Player y = 625; } - void drawPlayer() { - weaponX = x; - weaponY = y+40; - if (inMotion) { + + + + + void drawPlayer() + { + if (inMotion) + { image(movement[currentDirection][1 + int(currentFrame)], x, y); //Cycles through the frames with the help of line 46 - if (currentDirection ==3) { - image(weaponImage[currentWeapon], weaponX+10, weaponY); - } else { - pushMatrix(); - scale(-1, 1); - image(weaponImage[currentWeapon], -weaponX-20, weaponY); - popMatrix(); - } - } else { + + } + else + { image(movement[currentDirection][0], x, y); - if (currentDirection ==3) { - image(weaponImage[currentWeapon], weaponX+10, weaponY); - } else { - pushMatrix(); - scale(-1, 1); - image(weaponImage[currentWeapon], -weaponX-20, weaponY); - popMatrix(); - } + } + + + + if(attacking) + { + image(movement[5][1 + int(currentFrame2)],x , y); } + else + { + image(movement[5][0], x, y); + } + +} + + void attackUpdate() + { + currentFrame2 = (currentFrame2 + 0.6) % 8; + attacking = true; + } + + + + void updatePlayer(int xDelta, int yDelta) { currentFrame = (currentFrame + 0.6 /*Changing the 0.2 changes animation speed*/) % 8; //helps change through the frames @@ -94,6 +117,17 @@ class Player x = x - xDelta; y = y - yDelta; } + if (currentDirection==3) + { + image(weaponImage[currentWeapon], x+10, y+40); + } + if (currentDirection==1) + { + pushMatrix(); + scale(-1, 1); + image(weaponImage[currentWeapon], x+30, y+40); + popMatrix(); + } } boolean isPlayerOffScreen(float x, float y) { diff --git a/Inner_Demons/Skeleton.pde b/Inner_Demons/Skeleton.pde index 61e8a12..9336400 100644 --- a/Inner_Demons/Skeleton.pde +++ b/Inner_Demons/Skeleton.pde @@ -1,53 +1,60 @@ -class Skeleton { - float x, y; - PImage spriteSheet; - PImage [][] movement; - boolean inMotion; //Lets you know if character is moving or not - int currentDirection; - float currentFrame; - - final int UP = 0, LEFT = 1, DOWN = 2, RIGHT =3; - - Skeleton() { - inMotion = false; - currentDirection=1; - currentFrame=0; - x = 300; - y = 300; - - setupSprites(); - } - - void setupSprites() { - movement= new PImage[12][9]; //Create 2D array for Images - spriteSheet = loadImage("skeleton.png"); //Load entire spritesheet - for (int i = 0; i < 9; i++) { - movement[0][i] = spriteSheet.get(16 + 64 * i, 512, 32, 56); //Upward moving sprite - movement[1][i] = spriteSheet.get(16 + 64 * i, 576, 32, 56); //Left moving sprite - movement[2][i] = spriteSheet.get(16 + 64 * i, 640, 32, 56); //Downward moving sprite - movement[3][i] = spriteSheet.get(16 + 64 * i, 704, 32, 56); //Right moving sprite - } - } - - void drawSkeleton() { - image(movement[currentDirection][0], x, y); - } - - void updateSkeleton(int xDelta, int yDelta) { - inMotion = true; - - if (xDelta ==0 && yDelta ==0) - inMotion =false; - else if (xDelta == -1) - currentDirection = LEFT; - else if (xDelta == 1) - currentDirection = RIGHT; - else if (yDelta == -1) - currentDirection = UP; - else if (yDelta == 1) - currentDirection = DOWN; - - x = x + xDelta; - y = y + yDelta; - } -} \ No newline at end of file +class Skeleton +{ + float x, y; + PImage spriteSheet; + PImage [][] movement; + boolean inMotion; //Lets you know if character is moving or not + int currentDirection; + float currentFrame; + + final int UP = 0, LEFT = 1, DOWN = 2, RIGHT =3; + + Skeleton() + { + inMotion = false; + currentDirection=1; + currentFrame=0; + x = 300; + y = 300; + + setupSprites(); + } + + void setupSprites() + { + movement= new PImage[12][9]; //Create 2D array for Images + spriteSheet = loadImage("skeleton.png"); //Load entire spritesheet + for (int i = 0; i < 9; i++) + { + movement[0][i] = spriteSheet.get(16 + 64 * i, 512, 32, 56); //Upward moving sprite + movement[1][i] = spriteSheet.get(16 + 64 * i, 576, 32, 56); //Left moving sprite + movement[2][i] = spriteSheet.get(16 + 64 * i, 640, 32, 56); //Downward moving sprite + movement[3][i] = spriteSheet.get(16 + 64 * i, 704, 32, 56); //Right moving sprite + } + } + + + void drawSkeleton() + { + image(movement[currentDirection][0], x, y); + } + void updateSkeleton(int xDelta, int yDelta) + { + inMotion = true; + + if(xDelta ==0 && yDelta ==0) + inMotion =false; + else if(xDelta == -1) + currentDirection = LEFT; + else if (xDelta == 1) + currentDirection = RIGHT; + else if (yDelta == -1) + currentDirection = UP; + else if (yDelta == 1) + currentDirection = DOWN; + + + x = x + xDelta; + y = y + yDelta; + } +} diff --git a/Inner_Demons/WeaponChecks.pde b/Inner_Demons/WeaponChecks.pde index 5582e81..29635db 100644 --- a/Inner_Demons/WeaponChecks.pde +++ b/Inner_Demons/WeaponChecks.pde @@ -20,11 +20,9 @@ void weaponChecks() { break; case 7: damageMod = 1.9; - weaponX = weaponX-20; break; case 8: damageMod = 2; - weaponX = weaponX-20; break; case 9: damageMod = 1.5; @@ -48,7 +46,6 @@ void weaponChecks() { This will track the inventory */ inventory[1] = loadImage("Dagger.png"); //This will never change - inventoryTrack[1] = 1; //This will never change } void chestOpen() { @@ -63,7 +60,6 @@ void chestOpen() { if (weaponCount != 8) { weaponCount++; inventory[weaponCount] = weaponImage[rand]; - inventoryTrack[weaponCount] = rand; } break; case 2: diff --git a/Inner_Demons/data/Game project concepts-1.png b/Inner_Demons/data/Game project concepts-1.png deleted file mode 100644 index 8430309..0000000 Binary files a/Inner_Demons/data/Game project concepts-1.png and /dev/null differ diff --git a/Inner_Demons/data/Game project concepts-10.png b/Inner_Demons/data/Game project concepts-10.png deleted file mode 100644 index 83d5d42..0000000 Binary files a/Inner_Demons/data/Game project concepts-10.png and /dev/null differ diff --git a/Inner_Demons/data/Game project concepts-11.png b/Inner_Demons/data/Game project concepts-11.png deleted file mode 100644 index e2aecc0..0000000 Binary files a/Inner_Demons/data/Game project concepts-11.png and /dev/null differ diff --git a/Inner_Demons/data/Game project concepts-2.png b/Inner_Demons/data/Game project concepts-2.png deleted file mode 100644 index ee185c5..0000000 Binary files a/Inner_Demons/data/Game project concepts-2.png and /dev/null differ diff --git a/Inner_Demons/data/Game project concepts-3.png b/Inner_Demons/data/Game project concepts-3.png deleted file mode 100644 index 2258f2f..0000000 Binary files a/Inner_Demons/data/Game project concepts-3.png and /dev/null differ diff --git a/Inner_Demons/data/Game project concepts-4.png b/Inner_Demons/data/Game project concepts-4.png deleted file mode 100644 index 0ffb278..0000000 Binary files a/Inner_Demons/data/Game project concepts-4.png and /dev/null differ diff --git a/Inner_Demons/data/Game project concepts-5.png b/Inner_Demons/data/Game project concepts-5.png deleted file mode 100644 index dcb6874..0000000 Binary files a/Inner_Demons/data/Game project concepts-5.png and /dev/null differ diff --git a/Inner_Demons/data/Game project concepts-6.png b/Inner_Demons/data/Game project concepts-6.png deleted file mode 100644 index 5bef0ce..0000000 Binary files a/Inner_Demons/data/Game project concepts-6.png and /dev/null differ diff --git a/Inner_Demons/data/Game project concepts-7.png b/Inner_Demons/data/Game project concepts-7.png deleted file mode 100644 index 049d602..0000000 Binary files a/Inner_Demons/data/Game project concepts-7.png and /dev/null differ diff --git a/Inner_Demons/data/Game project concepts-8.png b/Inner_Demons/data/Game project concepts-8.png deleted file mode 100644 index 666fe57..0000000 Binary files a/Inner_Demons/data/Game project concepts-8.png and /dev/null differ diff --git a/Inner_Demons/data/Game project concepts-9.png b/Inner_Demons/data/Game project concepts-9.png deleted file mode 100644 index 3a3663a..0000000 Binary files a/Inner_Demons/data/Game project concepts-9.png and /dev/null differ diff --git a/Inner_Demons/data/Snake.png b/Inner_Demons/data/Snake.png new file mode 100644 index 0000000..8fd7a7b Binary files /dev/null and b/Inner_Demons/data/Snake.png differ diff --git a/Inner_Demons/data/Spear animation (2).gif b/Inner_Demons/data/Spear animation (2).gif deleted file mode 100644 index 0fe0547..0000000 Binary files a/Inner_Demons/data/Spear animation (2).gif and /dev/null differ diff --git a/Inner_Demons/data/Thumbs.db b/Inner_Demons/data/Thumbs.db deleted file mode 100644 index 932c24b..0000000 Binary files a/Inner_Demons/data/Thumbs.db and /dev/null differ diff --git a/Inner_Demons/data/advanced_spear (2).gif b/Inner_Demons/data/advanced_spear (2).gif deleted file mode 100644 index 0fe0547..0000000 Binary files a/Inner_Demons/data/advanced_spear (2).gif and /dev/null differ diff --git a/Inner_Demons/MonsterCall.pde b/MonsterCall.pde similarity index 86% rename from Inner_Demons/MonsterCall.pde rename to MonsterCall.pde index cd4e452..ad47ce1 100644 --- a/Inner_Demons/MonsterCall.pde +++ b/MonsterCall.pde @@ -1,3 +1,4 @@ -void monsterCall() { +void monsterCall() +{ //This will be used to call monsters dependent on the level that the player is on... it will be used ONCE WE ACTUALLY HAVE MONSTERS! *Glares at other developers* } \ No newline at end of file diff --git a/Monsters.pde b/Monsters.pde new file mode 100644 index 0000000..a32de83 --- /dev/null +++ b/Monsters.pde @@ -0,0 +1,39 @@ +class Monsters +{ + float monsterX; + float monsterY; + PImage [][] Orc; + + Monsters(/*float tempX, float tempY*/) + { + } + + void setupMonsters() + { + Orc = new PImage[12][9]; + spriteSheet = loadImage("Orc.png"); + + } + + + void monsterUpdate() + { + float r=random(1); + if(r <=.1) + { + monsterX = monsterX + 5; + } + if(r >.1 && r <=.2) + { + monsterX = monsterX -5; + } + + + + } + + + + + +} \ No newline at end of file diff --git a/Player.pde b/Player.pde new file mode 100644 index 0000000..a8e2be3 --- /dev/null +++ b/Player.pde @@ -0,0 +1,138 @@ +class Player +{ + float x, y; + PImage [][] movement; + PImage [][] attack; + boolean inMotion; //Lets you know if character is moving or not + boolean attacking; //Lets program know if player is attacking or not + int currentDirection; + float currentFrame; + float currentFrame2; + + final int UP = 0, LEFT = 1, DOWN = 2, RIGHT =3; + + Player() + { + inMotion = false; + attacking = false; + currentDirection=3; + currentFrame=3; + currentFrame2=1; + x = 100; + y = 625; + + setupSprites(); + } + + void setupSprites() + { + movement= new PImage[12][9]; //Create 2D array for Images + characterChecks(); + spriteSheet = loadImage(presetVar); //Load entire spritesheet + for (int i = 0; i < 9; i++) + { + movement[0][i] = spriteSheet.get(10 + 64 * i, 514, 40, 65); //Upward moving sprite + movement[1][i] = spriteSheet.get(10 + 64 * i, 578, 45, 65); //Left moving sprite + movement[2][i] = spriteSheet.get(10 + 64 * i, 642, 40, 65); //Downward moving sprite + movement[3][i] = spriteSheet.get(10 + 64 * i, 706, 40, 65); //Right moving sprite + movement[4][i] = spriteSheet.get(10 + 64 * i, 384, 40, 65); //Left attacking animation + movement[5][i] = spriteSheet.get(10 + 64 * i, 448, 40, 65); //Right attacking animation + } + } + + + + + void levelChange() + { + fill(255, 90); + text("Level Up!", 70, 70); + level++; + currentDirection = 3; + x = 100; + y = 625; + } + + + + + + void drawPlayer() + { + if (inMotion) + { + image(movement[currentDirection][1 + int(currentFrame)], x, y); //Cycles through the frames with the help of line 46 + + } + else + { + image(movement[currentDirection][0], x, y); + } + + + + if(attacking) + { + image(movement[5][1 + int(currentFrame2)],x , y); + } + else + { + image(movement[5][0], x, y); + } + +} + + void attackUpdate() + { + currentFrame2 = (currentFrame2 + 0.6) % 8; + attacking = true; + + } + + + + + void updatePlayer(int xDelta, int yDelta) + { + currentFrame = (currentFrame + 0.6 /*Changing the 0.2 changes animation speed*/) % 8; //helps change through the frames + inMotion = true; + + if (xDelta ==0 && yDelta ==0) + inMotion =false; + else if (xDelta <= -1) + currentDirection = LEFT; + else if (xDelta >= 1) + currentDirection = RIGHT; + else if (yDelta == -1) + currentDirection = UP; + else if (yDelta == 1) + currentDirection = DOWN; + + + x = x + xDelta; + y = y + yDelta; + + if (isPlayerOffScreen(x, y)) + { + x = x - xDelta; + y = y - yDelta; + } + if (currentDirection==3) + { + image(weaponImage[currentWeapon], x+10, y+40); + } + if (currentDirection==1) + { + pushMatrix(); + scale(-1, 1); + image(weaponImage[currentWeapon], x+30, y+40); + popMatrix(); + } + } + boolean isPlayerOffScreen(float x, float y) + { + if (x < 0 || x > width-30 || y<0 || y > height - 56) + return true; + return false; + } +} \ No newline at end of file diff --git a/Inner_Demons/Screens.pde b/Screens.pde similarity index 55% rename from Inner_Demons/Screens.pde rename to Screens.pde index ac0d00f..c230a9a 100644 --- a/Inner_Demons/Screens.pde +++ b/Screens.pde @@ -1,4 +1,5 @@ -void menuScreen() { //The screen for the main menu, this is where the game starts up, and the player chooses where to go from here. +void menuScreen() +{ //The screen for the main menu, this is where the game starts up, and the player chooses where to go from here. background(255); //Setting Up the Title @@ -24,21 +25,28 @@ void menuScreen() { //The screen for the main menu, this is where the game start text("Options", (width/2)-140, 400+25); //Mid Button - Text(Options) text("Quit", (width/2)-85, 600+25); //Low Button - Text(Quit) - if (mousePressed) { - if (mouseX >= (width/2)-150 && mouseX<=(width/2)+150) { //Goes to character selection screen - if (mouseY>= 200-50 && mouseY<= 200+50) { + if (mousePressed) + { + if (mouseX >= (width/2)-150 && mouseX<=(width/2)+150) + { //Goes to character selection screen + if (mouseY>= 200-50 && mouseY<= 200+50) + { characterScreen = true; menuScreen = false; } } - if (mouseX >= (width/2)-150 && mouseX<=(width/2)+150) { //Goes to settings screen - if (mouseY>=400-50 && mouseY<=400+50) { + if (mouseX >= (width/2)-150 && mouseX<=(width/2)+150) + { //Goes to settings screen + if (mouseY>=400-50 && mouseY<=400+50) + { optionsScreen = true; menuScreen = false; } } - if (mouseX >= (width/2)-150 && mouseX<=(width/2)+150) { //Goes to quit confirmation screen - if (mouseY >= 600-50 && mouseY<=600+50) { + if (mouseX >= (width/2)-150 && mouseX<=(width/2)+150) + { //Goes to quit confirmation screen + if (mouseY >= 600-50 && mouseY<=600+50) + { quitScreen = true; menuScreen = false; } @@ -46,7 +54,8 @@ void menuScreen() { //The screen for the main menu, this is where the game start } } -void characterScreen() { //The character selection screen, this is where the player will choose what their character looks like. +void characterScreen() +{ //The character selection screen, this is where the player will choose what their character looks like. background(0); //Title @@ -107,55 +116,76 @@ void characterScreen() { //The character selection screen, this is where the pl textSize(50); text("Back", 80, 670); - if (mousePressed) { - if (mouseX >=660 && mouseX<= 760) { //Selecting BOY - if (mouseY >= 200 && mouseY<= 260) { + if (mousePressed) + { + if (mouseX >=660 && mouseX<= 760) + { //Selecting BOY + if (mouseY >= 200 && mouseY<= 260) + { gender = "Male"; } } - if (mouseX>=790 && mouseX<=890) { //Selecting GIRL - if (mouseY >= 200 && mouseY<= 260) { + if (mouseX>=790 && mouseX<=890) + { //Selecting GIRL + if (mouseY >= 200 && mouseY<= 260) + { gender = "Female"; } } - if (mouseX>=680 && mouseX<=755) { //Selecting Preset 1 - if (mouseY>=375 && mouseY<=425) { + if (mouseX>=680 && mouseX<=755) + { //Selecting Preset 1 + if (mouseY>=375 && mouseY<=425) + { preset = 1; } } - if (mouseX>=800 && mouseX<=875) { //Selecting Preset 2 - if (mouseY>=375 && mouseY<=425) { + if (mouseX>=800 && mouseX<=875) + { //Selecting Preset 2 + if (mouseY>=375 && mouseY<=425) + { preset = 2; } } - if (mouseX>=680 && mouseX<=755) { //Selecting Preset 3 - if (mouseY>=455 && mouseY<=505) { + if (mouseX>=680 && mouseX<=755) + { //Selecting Preset 3 + if (mouseY>=455 && mouseY<=505) + { preset = 3; } } - if (mouseX>=800 && mouseX<=875) { //Selecting Preset 4 - if (mouseY>=455 && mouseY<=505) { + if (mouseX>=800 && mouseX<=875) + { //Selecting Preset 4 + if (mouseY>=455 && mouseY<=505) + { preset = 4; } } - if (mouseX>=680 && mouseX<=755) { //Selecting Preset 5 - if (mouseY>=535 && mouseY<=585) { + if (mouseX>=680 && mouseX<=755) + { //Selecting Preset 5 + if (mouseY>=535 && mouseY<=585) + { preset = 5; } } - if (mouseX>=800 && mouseX<=875) { //Selecting Preset 6 - if (mouseY>=535 && mouseY<=585) { + if (mouseX>=800 && mouseX<=875) + { //Selecting Preset 6 + if (mouseY>=535 && mouseY<=585) + { preset = 6; } } - if (mouseX>=40 && mouseX<=240) { //Back Button - if (mouseY>=615 && mouseY<=690) { + if (mouseX>=40 && mouseX<=240) + { //Back Button + if (mouseY>=615 && mouseY<=690) + { menuScreen = true; characterScreen = false; } } - if (mouseX>=690 && mouseX<=690+270) { //Continue Button - if (mouseY>=615 && mouseY<=690) { + if (mouseX>=690 && mouseX<=690+270) + { //Continue Button + if (mouseY>=615 && mouseY<=690) + { difficultyScreen = true; characterScreen = false; } @@ -181,7 +211,8 @@ void characterScreen() { //The character selection screen, this is where the pl image(displayWeapon, 315, 360); } -void quitScreen() { //This is the quit confirmation screen, it basically just asks if the player really wants to switch screens. +void quitScreen() +{ //This is the quit confirmation screen, it basically just asks if the player really wants to switch screens. background(0); //Setting the title @@ -202,14 +233,19 @@ void quitScreen() { //This is the quit confirmation screen, it basically jus text("Yes", 150, 620); //Setting YES button text text("No", 760, 620); //Setting NO button text - if (mousePressed) { - if (mouseX>=100 && mouseX<=300) { - if (mouseY>=550 && mouseY<=650) { //Selects YES + if (mousePressed) + { + if (mouseX>=100 && mouseX<=300) + { + if (mouseY>=550 && mouseY<=650) + { //Selects YES exit(); } } - if (mouseX>=700 && mouseX<=900) { - if (mouseY>= 550 && mouseY<=650) { //Selects NO + if (mouseX>=700 && mouseX<=900) + { + if (mouseY>= 550 && mouseY<=650) + { //Selects NO menuScreen = true; quitScreen = false; } @@ -217,7 +253,8 @@ void quitScreen() { //This is the quit confirmation screen, it basically jus } } -void difficultyScreen() { //Difficulty selection screen, player chooses how hard they want the game to be. +void difficultyScreen() +{ //Difficulty selection screen, player chooses how hard they want the game to be. background(0); //Setting up title @@ -251,46 +288,59 @@ void difficultyScreen() { //Difficulty selection screen, player chooses how har ellipse(600, 350, 25, 25); //Display Circle for NORMAL ellipse(950, 350, 25, 25); //Display Circle for HARD - if (difficulty == 1) { //Visual Display for EASY mode + if (difficulty == 1) + { //Visual Display for EASY mode fill(0, 255, 0); stroke(255); ellipse(250, 350, 25, 25); } - if (difficulty == 2) { //Visual Display for NORMAL mode + if (difficulty == 2) + {//Visual Display for NORMAL mode fill(0, 255, 0); stroke(255); ellipse(600, 350, 25, 25); } - if (difficulty == 3) { //Visual Display for HARD mode + if (difficulty == 3) + { //Visual Display for HARD mode fill(0, 255, 0); stroke(255); ellipse(950, 350, 25, 25); } if (mousePressed) { - if (mouseX>=50 && mouseX<=250) { - if (mouseY>=350 && mouseY<=450) { //Sets the difficulty to 1 (EASY) + if (mouseX>=50 && mouseX<=250) + { + if (mouseY>=350 && mouseY<=450) + { //Sets the difficulty to 1 (EASY) difficulty = 1; } } - if (mouseX>=400 && mouseX<=600) { - if (mouseY>=350 && mouseY<=450) { //Sets the difficulty to 2 (NORMAL) + if (mouseX>=400 && mouseX<=600) + { + if (mouseY>=350 && mouseY<=450) + { //Sets the difficulty to 2 (NORMAL) difficulty = 2; } } - if (mouseX>=750 && mouseX<=950) { - if (mouseY>=350 && mouseY<= 450) { //Sets the difficulty to 3 (HARD) + if (mouseX>=750 && mouseX<=950) + { + if (mouseY>=350 && mouseY<= 450) + { //Sets the difficulty to 3 (HARD) difficulty = 3; } } - if (mouseX>=width/2-210 && mouseX<=width/2-10) { - if (mouseY>=500 && mouseY<= 600) { //Goes back to character selection screen + if (mouseX>=width/2-210 && mouseX<=width/2-10) + { + if (mouseY>=500 && mouseY<= 600) + { //Goes back to character selection screen characterScreen = true; difficultyScreen = false; } } - if (mouseX>=width/2+10 && mouseX<=width/2+210) { - if (mouseY>=500 && mouseY<= 600) { //Goes to the game screen + if (mouseX>=width/2+10 && mouseX<=width/2+210) + { + if (mouseY>=500 && mouseY<= 600) + { //Goes to the game screen gameScreen = true; difficultyScreen = false; } @@ -298,18 +348,24 @@ void difficultyScreen() { //Difficulty selection screen, player chooses how har } } -void gameScreen() { //The start of the game screen - This is where all the action will take place. - if (level >= 0 && level < 5) { +void gameScreen() +{ //The start of the game screen - This is where all the action will take place. + if (level >= 0 && level < 5) + { background(startBackground); //This will be replaced with dialouge, but for now it's just this monsterCall(); } - if (level >= 5 && level<10) { + if (level >= 5 && level<10) + + { background(background2); } - if (level >=10 && level < 15) { + if (level >=10 && level < 15) + { background(background3); } - if (level >=15 && level < 20) { + if (level >=15 && level < 20) + { background(background4); } if (level==20) { @@ -319,12 +375,13 @@ void gameScreen() { //The start of the game screen - This is where all the actio winScreen = true; gameScreen = false; } - if (chestAppearLuck == 2) { - randomChest.chestDisplay(); - } + randomChest.chestDisplay(); Bob.setupSprites(); Bob.drawPlayer(); screenDisplay(); + for (int i = 1; i <= weaponCount; i++) { + image(inventory[i], i*50, 100); + } } void optionsScreen() { //This is where the player can choose between: Settings - Help - Credits @@ -356,8 +413,6 @@ void optionsScreen() { //This is where the player can choose between: Settings - if (mousePressed) { if (mouseX>=750 && mouseX<=950) { //Selects HELP button if (mouseY>=200 && mouseY<=300) { - helpScreen = true; - optionsScreen = false; } } if (mouseX>=750 && mouseX<=950) { //Selects SETTINGS button @@ -422,136 +477,18 @@ void pauseScreen() { //Pause screen- this is where the player will be able to a fill(0); textSize(40); text("Inventory", 400, 150); - - rectMode(0); - fill(255, 80); - stroke(0); - //Row 1 - rect(280, 250, 100, 100); - rect(395, 250, 100, 100); - rect(510, 250, 100, 100); - rect(625, 250, 100, 100); - //Row 2 - rect(280, 400, 100, 100); - rect(395, 400, 100, 100); - rect(510, 400, 100, 100); - rect(625, 400, 100, 100); - - if (mousePressed) { - if (mouseX>=280 && mouseX<= 380) { - if (mouseY>=250 && mouseY<=350) { - currentWeapon = inventoryTrack[1]; - } - } - if (mouseX>=395 && mouseX<= 495) { - if (mouseY>=250 && mouseY<=350) { - if (inventory[2] == null) return; - currentWeapon = inventoryTrack[2]; - } - } - if (mouseX>=510 && mouseX<= 610) { - if (mouseY>=250 && mouseY<=350) { - if (inventory[3] == null) return; - currentWeapon = inventoryTrack[3]; - } - } - if (mouseX>=625 && mouseX<= 725) { - if (mouseY>=250 && mouseY<=350) { - if (inventory[4] == null) return; - currentWeapon = inventoryTrack[4]; - } - } - if (mouseX>=280 && mouseX<= 380) { - if (mouseY>=400 && mouseY<=500) { - if (inventory[5] == null) return; - currentWeapon = inventoryTrack[5]; - } - } - if (mouseX>=395 && mouseX<= 495) { - if (mouseY>=400 && mouseY<=500) { - if (inventory[6] == null) return; - currentWeapon = inventoryTrack[6]; - } - } - if (mouseX>=510 && mouseX<= 610) { - if (mouseY>=400 && mouseY<=500) { - if (inventory[7] == null) return; - currentWeapon = inventoryTrack[7]; - } - } - if (mouseX>=625 && mouseX<= 725) { - if (mouseY>=400 && mouseY<=500) { - if (inventory[8] == null) return; - currentWeapon = inventoryTrack[8]; - } - } - } - - image(inventory[1], 300, 265); - if (inventory[2] == null) return; - image(inventory[2], 400, 265); - if (inventory[3] == null) return; - image(inventory[3], 530, 265); - if (inventory[4] == null) return; - image(inventory[4], 650, 265); - if (inventory[5] == null) return; - image(inventory[5], 300, 415); - if (inventory[6] == null) return; - image(inventory[6], 400, 415); - if (inventory[7] == null) return; - image(inventory[7], 530, 415); - if (inventory[8] == null) return; - image(inventory[8], 650, 415); } -void deathScreen() { //Death screen, this shows when the player has reached 0% health +void deathScreen() { background(0); fill(255); textSize(200); text("YOU DIED", 30, 300); } -void winScreen() { //Win screen, this shows when the player has beat the boss level(Level 20) in the gameScreen. +void winScreen() { background(0); fill(255); textSize(200); text("YOU WIN", 60, 300); -} - -void helpScreen() { - background(255); - fill(0); - textSize(100); - text("Help", 400, 100); - - textSize(30); - text("If you need help, please refer to the game website.", 10, 160); - text("It lists any and all information that you might need to know about", 10, 200); - text("this game, and how to play it. Have fun!", 10, 240); - - fill(255); - rect(90, 370, 700, 40); //Link box - rect(20, 450, 200, 100); //Back box - - fill(0); - textSize(80); - text("Back", 30, 530); - - fill(0, 0, 255); - textSize(30); - text("http://projectcrystal.ddns.net/Inner-Demons/", 100, 400); - - if (mousePressed) { - if (mouseX>=90 && mouseX<=790) { - if (mouseY>=370 && mouseY<=410) { - link("http://projectcrystal.ddns.net/Inner-Demons/"); - } - } - if (mouseX>=20 && mouseX<=220) { - if (mouseY>=450 && mouseY<= 550) { - optionsScreen = true; - helpScreen = false; - } - } - } } \ No newline at end of file diff --git a/Skeleton.pde b/Skeleton.pde new file mode 100644 index 0000000..9336400 --- /dev/null +++ b/Skeleton.pde @@ -0,0 +1,60 @@ +class Skeleton +{ + float x, y; + PImage spriteSheet; + PImage [][] movement; + boolean inMotion; //Lets you know if character is moving or not + int currentDirection; + float currentFrame; + + final int UP = 0, LEFT = 1, DOWN = 2, RIGHT =3; + + Skeleton() + { + inMotion = false; + currentDirection=1; + currentFrame=0; + x = 300; + y = 300; + + setupSprites(); + } + + void setupSprites() + { + movement= new PImage[12][9]; //Create 2D array for Images + spriteSheet = loadImage("skeleton.png"); //Load entire spritesheet + for (int i = 0; i < 9; i++) + { + movement[0][i] = spriteSheet.get(16 + 64 * i, 512, 32, 56); //Upward moving sprite + movement[1][i] = spriteSheet.get(16 + 64 * i, 576, 32, 56); //Left moving sprite + movement[2][i] = spriteSheet.get(16 + 64 * i, 640, 32, 56); //Downward moving sprite + movement[3][i] = spriteSheet.get(16 + 64 * i, 704, 32, 56); //Right moving sprite + } + } + + + void drawSkeleton() + { + image(movement[currentDirection][0], x, y); + } + void updateSkeleton(int xDelta, int yDelta) + { + inMotion = true; + + if(xDelta ==0 && yDelta ==0) + inMotion =false; + else if(xDelta == -1) + currentDirection = LEFT; + else if (xDelta == 1) + currentDirection = RIGHT; + else if (yDelta == -1) + currentDirection = UP; + else if (yDelta == 1) + currentDirection = DOWN; + + + x = x + xDelta; + y = y + yDelta; + } +} diff --git a/WeaponChecks.pde b/WeaponChecks.pde new file mode 100644 index 0000000..29635db --- /dev/null +++ b/WeaponChecks.pde @@ -0,0 +1,74 @@ +void weaponChecks() { + switch(currentWeapon) { + case 1: + //Nothing about the damage should change. + break; + case 2: + damageMod= 1.1; + break; + case 3: + damageMod= 1.3; + break; + case 4: + damageMod = 1.4; + break; + case 5: + damageMod = 1.6; + break; + case 6: + damageMod = 1.7; + break; + case 7: + damageMod = 1.9; + break; + case 8: + damageMod = 2; + break; + case 9: + damageMod = 1.5; + break; + default: + System.out.println("There is currently no weapon selected."); + break; + } + weaponImage[1] = loadImage("Dagger.png"); //Dagger 1 + weaponImage[2] = loadImage("advanced_dagger.png"); //Dagger 2 + weaponImage[3] = loadImage("Sword.png"); //Sword 1 + weaponImage[4] = loadImage("advanced_sword.png"); //Sword 2 + weaponImage[5] = loadImage("Spear.png"); //Spear 1 + weaponImage[6] = loadImage("advanced_spear.gif"); //Spear 2 + weaponImage[7] = loadImage("Hammer.png"); //Hammer 1 + weaponImage[8] = loadImage("advanced_hammer.png"); //Hammer 2 + //weaponImage[9] = loadImage(""); //Bow + //Make sure when declaring the image, that you use [currentWeapon] in the square brackets, that is so that you use the weapon that the player actually has equiped. + + /* + This will track the inventory + */ + inventory[1] = loadImage("Dagger.png"); //This will never change +} + +void chestOpen() { + if (health <= 10) { + health = 50; + return; + } + luck = (int)random(1, 3); + switch(luck) { + case 1: + int rand = (int) random(2, 9); + if (weaponCount != 8) { + weaponCount++; + inventory[weaponCount] = weaponImage[rand]; + } + break; + case 2: + health = health / 2; + break; + case 3: + if (health != 100) { + health = 100; + } + break; + } +} \ No newline at end of file diff --git a/data/Chest animation-1.png b/data/Chest animation-1.png new file mode 100644 index 0000000..5b82203 Binary files /dev/null and b/data/Chest animation-1.png differ diff --git a/data/Chest animation-2.png b/data/Chest animation-2.png new file mode 100644 index 0000000..8790c35 Binary files /dev/null and b/data/Chest animation-2.png differ diff --git a/data/Snake.png b/data/Snake.png new file mode 100644 index 0000000..8fd7a7b Binary files /dev/null and b/data/Snake.png differ diff --git a/data/Thumbs.db b/data/Thumbs.db index 413358f..50e20f6 100644 Binary files a/data/Thumbs.db and b/data/Thumbs.db differ