level 10
This commit is contained in:
@@ -3,18 +3,22 @@
|
|||||||
..................................................................................................................
|
..................................................................................................................
|
||||||
..................................................................................................................
|
..................................................................................................................
|
||||||
..................................................................................................................
|
..................................................................................................................
|
||||||
|
..P................................................................................................................
|
||||||
|
..............................................B...................................................................
|
||||||
|
BBBBBBBBBBB...................................B..............................................................................
|
||||||
|
..............................................B...................................................................
|
||||||
|
..............................................B.......................................................................BBBBBBBBBBBBBBBBBBBBBBBBB.........................................
|
||||||
|
..............................................B.......................................................................B..............................................................
|
||||||
|
....B.........................................B.......................................................................B.............................................................................................
|
||||||
|
....B.........................................B.......................................................................B........E......A.....E......................................................................
|
||||||
|
....B.........................................B..........B............................................................B.....BBBBBBBBBBBBBBBBBBBBBB......XXXXXX................................................
|
||||||
|
....B.........................................B..........B............................................................B..........................B....................A....................A.......................
|
||||||
|
....BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB..........B............................................................B..........................B.................XXXXXX..............XXXXXXX...............
|
||||||
|
.........................................................B............................................................BBBBBBBBBBBBBBBB...........B..............................................................
|
||||||
|
.........................................................B...........................................................................B...........B............................XXXXX..............................................
|
||||||
|
.........................................................BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...........B................................................................F
|
||||||
|
.................................................Q...............................................................................................B......................................A...................XXXXXXXXX....
|
||||||
|
...................AAAAAAAAAAAAAAAAAA......................................E.......................A....E....................E...................B...................................XXXXXXX...........................
|
||||||
|
.................BBBBBBBBBBBBBBBBBBBBBBB.....BBBBBBBBBBBBBBBBBBBBB....BBBBBBBBBBBBBBBBBB........BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB......................................................................................
|
||||||
..................................................................................................................
|
..................................................................................................................
|
||||||
..................................................................................................................
|
..................................................................................................................
|
||||||
..................................................................................................................
|
|
||||||
..................................................................................................................
|
|
||||||
..................................................................................................................
|
|
||||||
..................................................................................................................
|
|
||||||
..................................................................................................................
|
|
||||||
..................................................................................................................
|
|
||||||
..................................................................................................................
|
|
||||||
..................................................................................................................
|
|
||||||
..................................................................................................................
|
|
||||||
..P...............................................................................................................
|
|
||||||
..................................................................................................................
|
|
||||||
..................................................................................................................
|
|
||||||
BBBBBBBBBB.....BBBBBB.............................................................................................................
|
|
||||||
|
|||||||
BIN
Platformer.class
BIN
Platformer.class
Binary file not shown.
@@ -19,7 +19,7 @@ public class Platformer extends JPanel implements KeyListener, ActionListener {
|
|||||||
static final int MAXYVELO = 15;
|
static final int MAXYVELO = 15;
|
||||||
static final int MAXXVELO = 5;
|
static final int MAXXVELO = 5;
|
||||||
static final int totalLevels = 10;
|
static final int totalLevels = 10;
|
||||||
static int[] numAm = {4, 5, 10, 18, 6, 6, 0, 0, 0, 0};
|
static int[] numAm = {4, 5, 10, 18, 6, 6, 0, 0, 0, 23};
|
||||||
|
|
||||||
// game objects
|
// game objects
|
||||||
Player player;
|
Player player;
|
||||||
@@ -111,8 +111,9 @@ public class Platformer extends JPanel implements KeyListener, ActionListener {
|
|||||||
if (currentLevel > totalLevels) return;
|
if (currentLevel > totalLevels) return;
|
||||||
|
|
||||||
// lvl 3 arena
|
// lvl 3 arena
|
||||||
if (currentLevel == 4) {
|
if (currentLevel == 4 || currentLevel == 10) {
|
||||||
if (enemiesKilled < 100 && enemies.isEmpty()) {
|
boolean empty = currentLevel == 4 ? enemies.isEmpty() : enemies.size() <= 5;
|
||||||
|
if (enemiesKilled < 100 * (currentLevel == 4 ? 1 : 4) && empty) {
|
||||||
Random rand = new Random();
|
Random rand = new Random();
|
||||||
int xOff = rand.nextInt(700);
|
int xOff = rand.nextInt(700);
|
||||||
|
|
||||||
@@ -122,7 +123,7 @@ public class Platformer extends JPanel implements KeyListener, ActionListener {
|
|||||||
enemies.add(new Enemy(100 + xOff, 280, 20, 20, currentLevel));
|
enemies.add(new Enemy(100 + xOff, 280, 20, 20, currentLevel));
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (enemiesKilled >= 100) {
|
} else if (enemiesKilled >= 100 * (currentLevel == 4 ? 1 : 4)) {
|
||||||
collidables.removeIf(c -> c.y == 300 && c.x >= 440 && c.x <= 520);
|
collidables.removeIf(c -> c.y == 300 && c.x >= 440 && c.x <= 520);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -367,8 +368,12 @@ public class Platformer extends JPanel implements KeyListener, ActionListener {
|
|||||||
if (currentLevel == 2) {
|
if (currentLevel == 2) {
|
||||||
g.drawString("Take a leap of faith....", flag.x - 25, flag.y - 400);
|
g.drawString("Take a leap of faith....", flag.x - 25, flag.y - 400);
|
||||||
}
|
}
|
||||||
if (currentLevel == 4) {
|
if (currentLevel == 4 || currentLevel == 10) {
|
||||||
g.drawString("Kill 100 of them...", 220, 200);
|
g.drawString("Kill " + 100 * (currentLevel == 4 ? 1 : 4) + " of them...", 220, 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentLevel == 10) {
|
||||||
|
g.drawString("Final Level.... Time for the gauntlet", 80, 80);
|
||||||
}
|
}
|
||||||
// flag counter
|
// flag counter
|
||||||
int amOnes = player.numAmendments % 10;
|
int amOnes = player.numAmendments % 10;
|
||||||
|
|||||||
Reference in New Issue
Block a user