Starting of creating battle module
This commit is contained in:
parent
22b177ca57
commit
93faa22b9b
4
src/main/java/ruscz/game/gameOfProd/Battle/Battle.java
Normal file
4
src/main/java/ruscz/game/gameOfProd/Battle/Battle.java
Normal file
@ -0,0 +1,4 @@
|
||||
package ruscz.game.gameOfProd.Battle;
|
||||
|
||||
public class Battle {
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
package ruscz.game.gameOfProd.Battle;
|
||||
|
||||
public class BattlePerson {
|
||||
}
|
||||
4
src/main/java/ruscz/game/gameOfProd/Battle/Enemy.java
Normal file
4
src/main/java/ruscz/game/gameOfProd/Battle/Enemy.java
Normal file
@ -0,0 +1,4 @@
|
||||
package ruscz.game.gameOfProd.Battle;
|
||||
|
||||
public class Enemy extends BattlePerson {
|
||||
}
|
||||
4
src/main/java/ruscz/game/gameOfProd/Battle/Hero.java
Normal file
4
src/main/java/ruscz/game/gameOfProd/Battle/Hero.java
Normal file
@ -0,0 +1,4 @@
|
||||
package ruscz.game.gameOfProd.Battle;
|
||||
|
||||
public class Hero extends BattlePerson {
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package ruscz.game.gameOfProd.Cells;
|
||||
|
||||
import ruscz.game.gameOfProd.Game;
|
||||
import ruscz.game.gameOfProd.Windows.WindowOfFreeMove;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public class RandomEncounterCell extends Cell {
|
||||
private final int level;
|
||||
private final Game game;
|
||||
|
||||
public RandomEncounterCell(int x, int y, int lvl, Game game) {
|
||||
super(x, y, WindowOfFreeMove.CELL_SIZE, Color.pink);
|
||||
this.level = lvl;
|
||||
this.game = game;
|
||||
}
|
||||
}
|
||||
6
src/main/java/ruscz/game/gameOfProd/Dialog/MenuBar.java
Normal file
6
src/main/java/ruscz/game/gameOfProd/Dialog/MenuBar.java
Normal file
@ -0,0 +1,6 @@
|
||||
package ruscz.game.gameOfProd.Dialog;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
public class MenuBar extends JPanel {
|
||||
}
|
||||
@ -1,13 +1,11 @@
|
||||
package ruscz.game.gameOfProd;
|
||||
|
||||
import ruscz.game.gameOfProd.Windows.WindowOfBattle;
|
||||
import ruscz.game.gameOfProd.Windows.WindowOfFreeMove;
|
||||
import ruscz.game.gameOfProd.Windows.WindowOfMenu;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.KeyAdapter;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.KeyListener;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
public class Game extends JFrame {
|
||||
private static final int WINDOW_WIDTH = 13;
|
||||
@ -16,6 +14,19 @@ public class Game extends JFrame {
|
||||
|
||||
private WindowOfMenu menu;
|
||||
private WindowOfFreeMove freeMove;
|
||||
private WindowOfBattle battle;
|
||||
|
||||
public WindowOfMenu getMenu() {
|
||||
return menu;
|
||||
}
|
||||
|
||||
public WindowOfFreeMove getFreeMove() {
|
||||
return freeMove;
|
||||
}
|
||||
|
||||
public WindowOfBattle getBattle() {
|
||||
return battle;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
new Game();
|
||||
@ -23,7 +34,8 @@ public class Game extends JFrame {
|
||||
|
||||
public Game() {
|
||||
freeMove = new WindowOfFreeMove(this);
|
||||
menu = new WindowOfMenu(this, freeMove);
|
||||
menu = new WindowOfMenu(this);
|
||||
battle = new WindowOfBattle(this);
|
||||
|
||||
//tohle spustí na začátku menu
|
||||
add(menu);
|
||||
@ -40,8 +52,6 @@ public class Game extends JFrame {
|
||||
setVisible(true);
|
||||
getContentPane().setBackground(Color.BLACK);
|
||||
setExtendedState(MAXIMIZED_BOTH);
|
||||
getContentPane().getComponent(0).setLocation((Toolkit.getDefaultToolkit().getScreenSize().width - (WINDOW_WIDTH * CELL_SIZE)) / 2, (Toolkit.getDefaultToolkit().getScreenSize().height - (WINDOW_HEIGHT * CELL_SIZE)) / 2);
|
||||
getContentPane().getComponent(0).setSize(WINDOW_WIDTH * CELL_SIZE, WINDOW_HEIGHT * CELL_SIZE);
|
||||
}
|
||||
|
||||
public Game game() {return this;}
|
||||
@ -0,0 +1,23 @@
|
||||
package ruscz.game.gameOfProd.Windows;
|
||||
|
||||
import ruscz.game.gameOfProd.Game;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
|
||||
public class WindowOfBattle {
|
||||
private Canvas canvas;
|
||||
|
||||
public WindowOfBattle(Game game) {
|
||||
canvas = new Canvas();
|
||||
|
||||
}
|
||||
|
||||
class Canvas extends JPanel {
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,25 +1,26 @@
|
||||
package ruscz.game.gameOfProd.Windows;
|
||||
|
||||
import ruscz.game.gameOfProd.Game;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.sql.Time;
|
||||
|
||||
public class WindowOfMenu extends JLayeredPane {
|
||||
public static final int WINDOW_WIDTH = 13;
|
||||
public static final int WINDOW_HEIGHT = 13;
|
||||
public static final int CELL_SIZE = 50;
|
||||
|
||||
private JFrame game;
|
||||
private Game game;
|
||||
private WindowOfFreeMove freeMove;
|
||||
private JButton startNewGame;
|
||||
private JButton loadSavedGame;
|
||||
private JButton exitGame;
|
||||
|
||||
public WindowOfMenu(JFrame game, WindowOfFreeMove freeMove) {
|
||||
public WindowOfMenu(Game game) {
|
||||
this.game = game;
|
||||
this.freeMove = freeMove;
|
||||
this.freeMove = game.getFreeMove();
|
||||
|
||||
startNewGame = new JButton("START NEW GAME");
|
||||
//startNewGame.setFocusable(false);
|
||||
@ -49,6 +50,7 @@ public class WindowOfMenu extends JLayeredPane {
|
||||
add(loadSavedGame);
|
||||
add(exitGame);
|
||||
}
|
||||
|
||||
private void cleanUp() {
|
||||
setVisible(false);
|
||||
startNewGame.removeActionListener(startNewGame.getActionListeners()[0]);
|
||||
|
||||
3
src/main/resources/META-INF/MANIFEST.MF
Normal file
3
src/main/resources/META-INF/MANIFEST.MF
Normal file
@ -0,0 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
Main-Class: ruscz.game.gameOfProd.Game
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<wait>
|
||||
<image> boss-face.png
|
||||
Oh, hi Mark.
|
||||
I know, this is on very short notice<br/>but as you've probably heard,<br/>we kinda need someone on the Game of Prod.
|
||||
I know, this is on very short notice<br/>but as you've probably heard,<br/>we kinda need someone on the ruscz.game.gameOfProd.Game of Prod.
|
||||
And that someone is gonna be,<br/>you guessed it, you. You start by tomorrow.
|
||||
You can go now.
|
||||
Bye.
|
||||
|
||||
@ -1,90 +0,0 @@
|
||||
<map>
|
||||
<mapName>m1</mapName>
|
||||
<events>
|
||||
</events>
|
||||
</map>
|
||||
<map>
|
||||
<mapName>m2</mapName>
|
||||
<events>
|
||||
<trigger>
|
||||
<x>7</x>
|
||||
<y>2</y>
|
||||
<active>true</active>
|
||||
</trigger>
|
||||
</events>
|
||||
</map>
|
||||
<map>
|
||||
<mapName>m3</mapName>
|
||||
<events>
|
||||
<trigger>
|
||||
<x>2</x>
|
||||
<y>5</y>
|
||||
<active>true</active>
|
||||
</trigger>
|
||||
</events>
|
||||
</map>
|
||||
<map>
|
||||
<mapName>m4</mapName>
|
||||
<events>
|
||||
<trigger>
|
||||
<x>3</x>
|
||||
<y>3</y>
|
||||
<active>true</active>
|
||||
</trigger>
|
||||
</events>
|
||||
</map>
|
||||
<map>
|
||||
<mapName>m6</mapName>
|
||||
<events>
|
||||
<trigger>
|
||||
<x>11</x>
|
||||
<y>11</y>
|
||||
<active>true</active>
|
||||
</trigger>
|
||||
</events>
|
||||
</map>
|
||||
<map>
|
||||
<mapName>tutorial</mapName>
|
||||
<events>
|
||||
</events>
|
||||
</map>
|
||||
<map>
|
||||
<mapName>openspace</mapName>
|
||||
<events>
|
||||
<trigger>
|
||||
<x>7</x>
|
||||
<y>4</y>
|
||||
<active>true</active>
|
||||
</trigger>
|
||||
<chest>
|
||||
<x>15</x>
|
||||
<y>7</y>
|
||||
<active>true</active>
|
||||
</chest>
|
||||
</events>
|
||||
</map>
|
||||
<map>
|
||||
<mapName>office</mapName>
|
||||
<events>
|
||||
<chest>
|
||||
<x>1</x>
|
||||
<y>9</y>
|
||||
<active>true</active>
|
||||
</chest>
|
||||
</events>
|
||||
</map>
|
||||
<map>
|
||||
<mapName>boss</mapName>
|
||||
<events>
|
||||
<trigger>
|
||||
<x>4</x>
|
||||
<y>18</y>
|
||||
<active>true</active>
|
||||
</trigger>
|
||||
</events>
|
||||
</map>
|
||||
<map>
|
||||
<mapName>treasure</mapName>
|
||||
<events>
|
||||
</events>
|
||||
</map>
|
||||
@ -1,6 +0,0 @@
|
||||
<location>
|
||||
<map>boss</map>
|
||||
<x>4</x>
|
||||
<y>18</y>
|
||||
<direction>2</direction>
|
||||
</location>
|
||||
@ -1 +0,0 @@
|
||||
TODO: Village
|
||||
Loading…
x
Reference in New Issue
Block a user