level 7
This commit is contained in:
BIN
InvisibleTile.class
Normal file
BIN
InvisibleTile.class
Normal file
Binary file not shown.
13
InvisibleTile.java
Normal file
13
InvisibleTile.java
Normal file
@@ -0,0 +1,13 @@
|
||||
import java.awt.Graphics;
|
||||
import javax.swing.ImageIcon;
|
||||
|
||||
public class InvisibleTile extends Tile {
|
||||
public InvisibleTile(int x, int y, int w, int h) {
|
||||
super(x, y, w, h, new ImageIcon("Sprites/Bricks/Brick.png"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Graphics g) {
|
||||
// draw nothing
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -50,6 +50,9 @@ public class LevelLoader {
|
||||
case 'E':
|
||||
enemies.add(new Enemy(x, y, enemyWidth[level], enemyHeight[level], level));
|
||||
break;
|
||||
case 'X':
|
||||
collidables.add(new InvisibleTile(x, y, tileSize, tileSize));
|
||||
break;
|
||||
}
|
||||
}
|
||||
row++;
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
..................................................................................................................
|
||||
..................................................................................................................
|
||||
..................................................................................................................
|
||||
..................................................................................................................
|
||||
..................................................................................................................
|
||||
..................................................................................................................
|
||||
..................................................................................................................
|
||||
..................................................................................................................
|
||||
..P...............................................................................................................
|
||||
..................................................................................................................
|
||||
..................................................................................................................
|
||||
..............................................................A...........................................................E
|
||||
...........................................................BBBBBBBBB.......................A...........................EBBBBBBBBB...
|
||||
........................................................................................BBBBBBB.....................E.BBBBBBBBBBB...
|
||||
...................................................................................................................EBBBBBBBBBBBBB
|
||||
............................................................................E...................................E.BBBBBBBBBBBBBBB
|
||||
..P........................Q..................EEE.........................BBBBBBB...............................BBBBBBBBBBBBBBBBB.........F
|
||||
..........................................BBBBBBBBBBBB..................................................BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB......................
|
||||
........E........A......BBBBBBBBB..........................................................................................
|
||||
BBBBBBBBBB.....BBBBBB.............................................................................................................
|
||||
|
||||
BIN
Platformer.class
BIN
Platformer.class
Binary file not shown.
@@ -355,6 +355,17 @@ public class Platformer extends JPanel implements KeyListener, ActionListener {
|
||||
this.setBackground(SKY);
|
||||
}
|
||||
|
||||
if (currentLevel == 8) {
|
||||
// draw black overlay over entire world
|
||||
g.setColor(new Color(0, 0, 0, 255));
|
||||
g.fillRect(cameraX, cameraY, boardWidth, boardHeight);
|
||||
// cut out a circle around the player
|
||||
Graphics2D g2 = (Graphics2D) g;
|
||||
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.CLEAR));
|
||||
g2.fillOval(player.x - 60, player.y - 60, 120, 120);
|
||||
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER));
|
||||
}
|
||||
|
||||
g.translate(-cameraX, -cameraY);
|
||||
|
||||
player.draw(g);
|
||||
|
||||
Reference in New Issue
Block a user