Compare commits
6 Commits
f6de147046
...
b4d07b0d99
| Author | SHA1 | Date | |
|---|---|---|---|
|
b4d07b0d99
|
|||
|
afcc32dc9f
|
|||
|
f4b14214bd
|
|||
|
40111da691
|
|||
|
0f216c6c56
|
|||
|
de70fb71e6
|
@@ -6,12 +6,14 @@ import java.util.logging.Logger;
|
|||||||
public class Boot {
|
public class Boot {
|
||||||
|
|
||||||
public static final Logger logger = Logger.getLogger("JDGame2D");
|
public static final Logger logger = Logger.getLogger("JDGame2D");
|
||||||
|
public static JFrame window;
|
||||||
|
|
||||||
static void main() {
|
static void main() {
|
||||||
JFrame window = new JFrame();
|
window = new JFrame();
|
||||||
window.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
window.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
||||||
window.setResizable(false);
|
window.setResizable(false);
|
||||||
window.setTitle("JGame2D");
|
window.setTitle("JGame2D");
|
||||||
|
window.setUndecorated(true);
|
||||||
|
|
||||||
GamePanel gamePanel = new GamePanel();
|
GamePanel gamePanel = new GamePanel();
|
||||||
window.add(gamePanel);
|
window.add(gamePanel);
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import de.miaurizius.jgame2d.tile.interactive.InteractiveTile;
|
|||||||
import javax.sound.sampled.Clip;
|
import javax.sound.sampled.Clip;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
@@ -19,12 +20,18 @@ public class GamePanel extends JPanel implements Runnable {
|
|||||||
// SCREEN SETTINGS
|
// SCREEN SETTINGS
|
||||||
final int originalTileSize = 16; //16x16 tile
|
final int originalTileSize = 16; //16x16 tile
|
||||||
final int scale = 3;
|
final int scale = 3;
|
||||||
public final int maxScreenCol = 16;
|
|
||||||
public final int tileSize = originalTileSize * scale; //48x48 tile
|
public final int tileSize = originalTileSize * scale; //48x48 tile
|
||||||
|
public final int maxScreenCol = 20;
|
||||||
public final int maxScreenRow = 12;
|
public final int maxScreenRow = 12;
|
||||||
public final int screenWidth = tileSize * maxScreenCol; // 768 pixels
|
public final int screenWidth = tileSize * maxScreenCol; // 960 pixels
|
||||||
public final int screenHeight = tileSize * maxScreenRow; // 576 pixels
|
public final int screenHeight = tileSize * maxScreenRow; // 576 pixels
|
||||||
|
|
||||||
|
// FULLSCREEN SETTINGS
|
||||||
|
int fScreenWidth = screenWidth;
|
||||||
|
int fScreenHeight = screenHeight;
|
||||||
|
BufferedImage tempScreen;
|
||||||
|
Graphics2D fg2;
|
||||||
|
|
||||||
// WORLD SETTINGS
|
// WORLD SETTINGS
|
||||||
public final int maxWorldCol = 50;
|
public final int maxWorldCol = 50;
|
||||||
public final int maxWorldRow = 50;
|
public final int maxWorldRow = 50;
|
||||||
@@ -52,6 +59,7 @@ public class GamePanel extends JPanel implements Runnable {
|
|||||||
public Entity[] monster = new Entity[20];
|
public Entity[] monster = new Entity[20];
|
||||||
public InteractiveTile[] iTile = new InteractiveTile[50];
|
public InteractiveTile[] iTile = new InteractiveTile[50];
|
||||||
public ArrayList<Entity> projectileList = new ArrayList<>();
|
public ArrayList<Entity> projectileList = new ArrayList<>();
|
||||||
|
public ArrayList<Entity> particleList = new ArrayList<>();
|
||||||
ArrayList<Entity> entityList = new ArrayList<>();
|
ArrayList<Entity> entityList = new ArrayList<>();
|
||||||
|
|
||||||
// GAME STATE
|
// GAME STATE
|
||||||
@@ -87,7 +95,9 @@ public class GamePanel extends JPanel implements Runnable {
|
|||||||
|
|
||||||
if(delta >= 1) {
|
if(delta >= 1) {
|
||||||
update();
|
update();
|
||||||
repaint();
|
//repaint(); //since the new drawing method
|
||||||
|
drawTempScreen();
|
||||||
|
drawScreen();
|
||||||
delta--;
|
delta--;
|
||||||
drawCount++;
|
drawCount++;
|
||||||
}
|
}
|
||||||
@@ -122,29 +132,33 @@ public class GamePanel extends JPanel implements Runnable {
|
|||||||
else projectileList.remove(i);
|
else projectileList.remove(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for(int i = 0; i < particleList.size(); i++) {
|
||||||
|
Entity m = particleList.get(i);
|
||||||
|
if(m != null) {
|
||||||
|
if(m.alive) m.update();
|
||||||
|
else particleList.remove(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
for(Entity entity : iTile) if(entity != null) entity.update();
|
for(Entity entity : iTile) if(entity != null) entity.update();
|
||||||
break;
|
break;
|
||||||
case PAUSE:
|
case PAUSE:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void paintComponent(Graphics graphics) {
|
public void drawTempScreen() {
|
||||||
super.paintComponent(graphics);
|
|
||||||
Graphics2D graphics2d = (Graphics2D) graphics;
|
|
||||||
|
|
||||||
// DEBUG
|
// DEBUG
|
||||||
long drawStart;
|
long drawStart;
|
||||||
drawStart = System.nanoTime();
|
drawStart = System.nanoTime();
|
||||||
|
|
||||||
// TITLE SCREEN
|
// TITLE SCREEN
|
||||||
if(gameState == GameState.TITLE) {
|
if(gameState == GameState.TITLE) {
|
||||||
ui.draw(graphics2d);
|
ui.draw(fg2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// GAME
|
// GAME
|
||||||
tileM.draw(graphics2d);
|
tileM.draw(fg2);
|
||||||
for(Entity entity : iTile) if(entity != null) entity.draw(graphics2d);
|
for(Entity entity : iTile) if(entity != null) entity.draw(fg2);
|
||||||
|
|
||||||
// ENTITY RENDER SYSTEM
|
// ENTITY RENDER SYSTEM
|
||||||
entityList.add(player);
|
entityList.add(player);
|
||||||
@@ -152,11 +166,12 @@ public class GamePanel extends JPanel implements Runnable {
|
|||||||
for(Entity entity : obj) if(entity != null) entityList.add(entity);
|
for(Entity entity : obj) if(entity != null) entityList.add(entity);
|
||||||
for(Entity entity : monster) if(entity != null) entityList.add(entity);
|
for(Entity entity : monster) if(entity != null) entityList.add(entity);
|
||||||
for(Entity entity : projectileList) if(entity != null) entityList.add(entity);
|
for(Entity entity : projectileList) if(entity != null) entityList.add(entity);
|
||||||
|
for(Entity entity : particleList) if(entity != null) entityList.add(entity);
|
||||||
entityList.sort(Comparator.comparingInt(o -> o.worldY));
|
entityList.sort(Comparator.comparingInt(o -> o.worldY));
|
||||||
for(Entity entity : entityList) entity.draw(graphics2d);
|
for(Entity entity : entityList) entity.draw(fg2);
|
||||||
entityList.clear();
|
entityList.clear();
|
||||||
|
|
||||||
ui.draw(graphics2d);
|
ui.draw(fg2);
|
||||||
|
|
||||||
long drawEnd = System.nanoTime();
|
long drawEnd = System.nanoTime();
|
||||||
long passed = drawEnd - drawStart;
|
long passed = drawEnd - drawStart;
|
||||||
@@ -164,17 +179,19 @@ public class GamePanel extends JPanel implements Runnable {
|
|||||||
// DEBUG
|
// DEBUG
|
||||||
if(keyH.debug) {
|
if(keyH.debug) {
|
||||||
int start = 350;
|
int start = 350;
|
||||||
graphics2d.setColor(Color.white);
|
fg2.setColor(Color.white);
|
||||||
graphics2d.drawString("Draw Time: " + passed, 10, start);
|
fg2.drawString("Draw Time: " + passed, 10, start);
|
||||||
graphics2d.drawString("FPS: " + fpsMeasure, 10, start+tileSize);
|
fg2.drawString("FPS: " + fpsMeasure, 10, start+tileSize);
|
||||||
graphics2d.drawString("Invincible: " + player.invincibleCount, 10, start+tileSize*2);
|
fg2.drawString("Invincible: " + player.invincibleCount, 10, start+tileSize*2);
|
||||||
graphics2d.drawString("X, Y: " + player.worldX+", "+player.worldY, 10, start+tileSize*3);
|
fg2.drawString("X, Y: " + player.worldX+", "+player.worldY, 10, start+tileSize*3);
|
||||||
graphics2d.drawString("Col, Row: " + (player.worldX+player.solidArea.x)/tileSize+", "+(player.worldY+player.solidArea.y)/tileSize, 10, start+tileSize*4);
|
fg2.drawString("Col, Row: " + (player.worldX+player.solidArea.x)/tileSize+", "+(player.worldY+player.solidArea.y)/tileSize, 10, start+tileSize*4);
|
||||||
Boot.logger.log(Level.FINE, "Draw Time: " + passed);
|
Boot.logger.log(Level.FINE, "Draw Time: " + passed);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// END
|
public void drawScreen() {
|
||||||
graphics.dispose();
|
Graphics fg = getGraphics();
|
||||||
|
fg.drawImage(tempScreen, 0, 0, fScreenWidth, fScreenHeight, null);
|
||||||
|
fg.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
// MUSIC
|
// MUSIC
|
||||||
@@ -202,6 +219,19 @@ public class GamePanel extends JPanel implements Runnable {
|
|||||||
assetSetter.setMonster();
|
assetSetter.setMonster();
|
||||||
assetSetter.setITiles();
|
assetSetter.setITiles();
|
||||||
gameState = GameState.TITLE;
|
gameState = GameState.TITLE;
|
||||||
|
|
||||||
|
tempScreen = new BufferedImage(screenWidth, screenHeight, BufferedImage.TYPE_INT_RGB);
|
||||||
|
fg2 = (Graphics2D) tempScreen.getGraphics();
|
||||||
|
|
||||||
|
setFullscreen();
|
||||||
|
}
|
||||||
|
public void setFullscreen() {
|
||||||
|
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
|
||||||
|
GraphicsDevice gd = ge.getDefaultScreenDevice();
|
||||||
|
gd.setFullScreenWindow(Boot.window);
|
||||||
|
|
||||||
|
fScreenWidth = Boot.window.getWidth();
|
||||||
|
fScreenHeight = Boot.window.getHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ public class UI {
|
|||||||
}
|
}
|
||||||
public void drawCharStats() {
|
public void drawCharStats() {
|
||||||
// DRAW FRAME
|
// DRAW FRAME
|
||||||
final int frameX = panel.tileSize;
|
final int frameX = panel.tileSize*2;
|
||||||
final int frameY = panel.tileSize;
|
final int frameY = panel.tileSize;
|
||||||
final int frameWidth = panel.tileSize*5;
|
final int frameWidth = panel.tileSize*5;
|
||||||
final int frameHeight = panel.tileSize*10;
|
final int frameHeight = panel.tileSize*10;
|
||||||
@@ -160,7 +160,7 @@ public class UI {
|
|||||||
}
|
}
|
||||||
public void drawInventory() {
|
public void drawInventory() {
|
||||||
// DRAW FRAME
|
// DRAW FRAME
|
||||||
int frameX = panel.tileSize*9;
|
int frameX = panel.tileSize*12;
|
||||||
int frameY = panel.tileSize;
|
int frameY = panel.tileSize;
|
||||||
int frameWidth = panel.tileSize*6;
|
int frameWidth = panel.tileSize*6;
|
||||||
int frameHeight = panel.tileSize*5;
|
int frameHeight = panel.tileSize*5;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import de.miaurizius.jgame2d.core.enums.Direction;
|
|||||||
import de.miaurizius.jgame2d.core.GamePanel;
|
import de.miaurizius.jgame2d.core.GamePanel;
|
||||||
import de.miaurizius.jgame2d.core.Utility;
|
import de.miaurizius.jgame2d.core.Utility;
|
||||||
import de.miaurizius.jgame2d.core.enums.EntityType;
|
import de.miaurizius.jgame2d.core.enums.EntityType;
|
||||||
|
import de.miaurizius.jgame2d.entity.particle.Particle;
|
||||||
import de.miaurizius.jgame2d.entity.projectile.Projectile;
|
import de.miaurizius.jgame2d.entity.projectile.Projectile;
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
@@ -214,6 +215,35 @@ public class Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PARTICLE SETUP
|
||||||
|
public Color getParticleColor() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
public int getParticleSize() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
public int getParticleSpeed() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
public int getParticleMaxLife() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
public void generateParticle(Entity generator, Entity target) {
|
||||||
|
Color color = generator.getParticleColor();
|
||||||
|
int size = generator.getParticleSize();
|
||||||
|
int speed = generator.getParticleSpeed();
|
||||||
|
int maxLife = generator.getParticleMaxLife();
|
||||||
|
|
||||||
|
Particle p1 = new Particle(panel, target, color, size, speed, maxLife, -2, -1);
|
||||||
|
Particle p2 = new Particle(panel, target, color, size, speed, maxLife, 2, -1);
|
||||||
|
Particle p3 = new Particle(panel, target, color, size, speed, maxLife, -2, 1);
|
||||||
|
Particle p4 = new Particle(panel, target, color, size, speed, maxLife, 2, 1);
|
||||||
|
panel.particleList.add(p1);
|
||||||
|
panel.particleList.add(p2);
|
||||||
|
panel.particleList.add(p3);
|
||||||
|
panel.particleList.add(p4);
|
||||||
|
}
|
||||||
|
|
||||||
// SETTING THINGS UP
|
// SETTING THINGS UP
|
||||||
BufferedImage parseSprite() {
|
BufferedImage parseSprite() {
|
||||||
return switch (direction) {
|
return switch (direction) {
|
||||||
|
|||||||
@@ -225,6 +225,7 @@ public class Player extends Entity {
|
|||||||
panel.iTile[index].playSE();
|
panel.iTile[index].playSE();
|
||||||
panel.iTile[index].life--;
|
panel.iTile[index].life--;
|
||||||
panel.iTile[index].invincible = true;
|
panel.iTile[index].invincible = true;
|
||||||
|
generateParticle(panel.iTile[index], panel.iTile[index]);
|
||||||
if(panel.iTile[index].life == 0) panel.iTile[index] = panel.iTile[index].getDestroyedForm();
|
if(panel.iTile[index].life == 0) panel.iTile[index] = panel.iTile[index].getDestroyedForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
50
src/de/miaurizius/jgame2d/entity/particle/Particle.java
Normal file
50
src/de/miaurizius/jgame2d/entity/particle/Particle.java
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
package de.miaurizius.jgame2d.entity.particle;
|
||||||
|
|
||||||
|
import de.miaurizius.jgame2d.core.GamePanel;
|
||||||
|
import de.miaurizius.jgame2d.entity.Entity;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
|
public class Particle extends Entity {
|
||||||
|
|
||||||
|
GamePanel panel;
|
||||||
|
Entity generator;
|
||||||
|
Color color;
|
||||||
|
int size;
|
||||||
|
int xd, yd;
|
||||||
|
|
||||||
|
public Particle(GamePanel panel, Entity generator, Color color, int size, int speed, int maxLife, int xd, int yd) {
|
||||||
|
super(panel);
|
||||||
|
this.panel = panel;
|
||||||
|
this.generator = generator;
|
||||||
|
this.color = color;
|
||||||
|
this.size = size;
|
||||||
|
this.speed = speed;
|
||||||
|
this.maxLife = maxLife;
|
||||||
|
this.xd = xd;
|
||||||
|
this.yd = yd;
|
||||||
|
|
||||||
|
life = maxLife;
|
||||||
|
int offset = (panel.tileSize/2) - (size/2);
|
||||||
|
worldX = generator.worldX + offset;
|
||||||
|
worldY = generator.worldY + offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update() {
|
||||||
|
life--;
|
||||||
|
if(life < maxLife/3) yd++;
|
||||||
|
worldX += xd*speed;
|
||||||
|
worldY += yd*speed;
|
||||||
|
alive = (life != 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void draw(Graphics2D graphics2d) {
|
||||||
|
int screenX = worldX - panel.player.worldX + panel.player.screenX;
|
||||||
|
int screenY = worldY - panel.player.worldY + panel.player.screenY;
|
||||||
|
|
||||||
|
graphics2d.setColor(color);
|
||||||
|
graphics2d.fillRect(screenX, screenY, size, size);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -28,6 +28,7 @@ public class Projectile extends Entity {
|
|||||||
int monsterIndex = panel.collisionH.checkEntity(this, panel.monster);
|
int monsterIndex = panel.collisionH.checkEntity(this, panel.monster);
|
||||||
if(monsterIndex != 999) {
|
if(monsterIndex != 999) {
|
||||||
panel.player.damageMonster(monsterIndex, attack);
|
panel.player.damageMonster(monsterIndex, attack);
|
||||||
|
generateParticle(user.projectile, panel.monster[monsterIndex]);
|
||||||
alive = false;
|
alive = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -35,6 +36,7 @@ public class Projectile extends Entity {
|
|||||||
if(user.type == EntityType.MONSTER) {
|
if(user.type == EntityType.MONSTER) {
|
||||||
if(!panel.player.invincible && panel.collisionH.checkPlayer(this)) {
|
if(!panel.player.invincible && panel.collisionH.checkPlayer(this)) {
|
||||||
damagePlayer(attack);
|
damagePlayer(attack);
|
||||||
|
generateParticle(user.projectile, panel.player);
|
||||||
alive = false;
|
alive = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package de.miaurizius.jgame2d.entity.projectile;
|
|||||||
import de.miaurizius.jgame2d.core.GamePanel;
|
import de.miaurizius.jgame2d.core.GamePanel;
|
||||||
import de.miaurizius.jgame2d.core.enums.EntityType;
|
import de.miaurizius.jgame2d.core.enums.EntityType;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
public class RockObj extends Projectile {
|
public class RockObj extends Projectile {
|
||||||
|
|
||||||
GamePanel panel;
|
GamePanel panel;
|
||||||
@@ -33,4 +35,17 @@ public class RockObj extends Projectile {
|
|||||||
right2 = initEntitySprites(defaultSprite);
|
right2 = initEntitySprites(defaultSprite);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Color getParticleColor() {
|
||||||
|
return new Color(40, 50,0);
|
||||||
|
}
|
||||||
|
public int getParticleSize() {
|
||||||
|
return 10; //in pixels
|
||||||
|
}
|
||||||
|
public int getParticleSpeed() {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
public int getParticleMaxLife() {
|
||||||
|
return 20;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import de.miaurizius.jgame2d.core.GamePanel;
|
|||||||
import de.miaurizius.jgame2d.core.enums.EntityType;
|
import de.miaurizius.jgame2d.core.enums.EntityType;
|
||||||
import de.miaurizius.jgame2d.entity.Entity;
|
import de.miaurizius.jgame2d.entity.Entity;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
public class DryTreeTI extends InteractiveTile{
|
public class DryTreeTI extends InteractiveTile{
|
||||||
|
|
||||||
GamePanel panel;
|
GamePanel panel;
|
||||||
@@ -31,4 +33,16 @@ public class DryTreeTI extends InteractiveTile{
|
|||||||
public InteractiveTile getDestroyedForm() {
|
public InteractiveTile getDestroyedForm() {
|
||||||
return new TrunkIT(panel, worldX/panel.tileSize, worldY/panel.tileSize);
|
return new TrunkIT(panel, worldX/panel.tileSize, worldY/panel.tileSize);
|
||||||
}
|
}
|
||||||
|
public Color getParticleColor() {
|
||||||
|
return new Color(65, 50,30);
|
||||||
|
}
|
||||||
|
public int getParticleSize() {
|
||||||
|
return 6; //in pixels
|
||||||
|
}
|
||||||
|
public int getParticleSpeed() {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
public int getParticleMaxLife() {
|
||||||
|
return 20;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package de.miaurizius.jgame2d.tile.interactive;
|
|||||||
import de.miaurizius.jgame2d.core.GamePanel;
|
import de.miaurizius.jgame2d.core.GamePanel;
|
||||||
import de.miaurizius.jgame2d.entity.Entity;
|
import de.miaurizius.jgame2d.entity.Entity;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
public class InteractiveTile extends Entity {
|
public class InteractiveTile extends Entity {
|
||||||
|
|
||||||
GamePanel panel;
|
GamePanel panel;
|
||||||
@@ -14,6 +16,7 @@ public class InteractiveTile extends Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GENERAL
|
// GENERAL
|
||||||
|
@Override
|
||||||
public void update() {
|
public void update() {
|
||||||
// INVINCIBLE COUNTER
|
// INVINCIBLE COUNTER
|
||||||
if(!invincible) return;
|
if(!invincible) return;
|
||||||
@@ -23,6 +26,20 @@ public class InteractiveTile extends Entity {
|
|||||||
invincibleCount = 0;
|
invincibleCount = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public void draw(Graphics2D graphics2D) {
|
||||||
|
int screenX = worldX - panel.player.worldX + panel.player.screenX;
|
||||||
|
int screenY = worldY - panel.player.worldY + panel.player.screenY;
|
||||||
|
|
||||||
|
if(worldX + panel.tileSize > panel.player.worldX - panel.player.screenX &&
|
||||||
|
worldX - panel.tileSize < panel.player.worldX + panel.player.screenX &&
|
||||||
|
worldY + panel.tileSize > panel.player.worldY - panel.player.screenY &&
|
||||||
|
worldY - panel.tileSize < panel.player.worldY + panel.player.screenY
|
||||||
|
) {
|
||||||
|
graphics2D.drawImage(down1, screenX, screenY, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// PRE-CONFIGURED
|
// PRE-CONFIGURED
|
||||||
public void playSE() {}
|
public void playSE() {}
|
||||||
|
|||||||
Reference in New Issue
Block a user