Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
More structural things, level loading is almost done. Rendering comin…
…g soon.
- Loading branch information
Showing
14 changed files
with
180 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
test | ||
1 1 1 1 1 1 | ||
1 1 1 1 1 1 | ||
1 1 1 1 1 1 | ||
1 1 1 1 1 1 | ||
1 1 1 1 1 1 | ||
1 1 1 1 1 1 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package entities; | ||
|
||
public abstract class Entity { | ||
|
||
public abstract void tick(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package entities; | ||
|
||
public class EntityHandler { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package game; | ||
|
||
import javax.swing.JFrame; | ||
import gfx.Screen; | ||
import level.LevelHandler; | ||
|
||
public class Game extends JFrame{ | ||
|
||
private Screen screen; | ||
|
||
public Game() { | ||
setSize(800, 600); | ||
setTitle(screen.getLevelName()); | ||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | ||
setLocationRelativeTo(null); | ||
setVisible(true); | ||
} | ||
|
||
public void setLevel(LevelHandler newLevel) { | ||
screen = new Screen(newLevel); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
package game; | ||
public class InputHandler { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package game; | ||
|
||
import level.LevelHandler; | ||
|
||
public class Launcher { | ||
|
||
public static void main(String[] args) { | ||
//new Menu().run(); | ||
|
||
// Testing file loading | ||
LevelHandler test = new LevelHandler("res/levels/test.txt"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
package game; | ||
public class MouseHandler { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
package game; | ||
public class WindowHandler { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package gfx; | ||
|
||
import java.awt.Dimension; | ||
import javax.swing.JPanel; | ||
import level.LevelHandler; | ||
|
||
// This class will contain and render a specific level/entities | ||
// The game.Game class will contain one screen at a time to display that level. | ||
public class Screen extends JPanel { | ||
|
||
private String levelName; | ||
private LevelHandler level; | ||
|
||
public Screen(LevelHandler level) { | ||
this.level = level; | ||
this.setPreferredSize(new Dimension(700, 600)); | ||
} | ||
|
||
public String getLevelName() { | ||
return levelName; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package level.tiles; | ||
|
||
import java.awt.Color; | ||
|
||
public class SmoothFloor extends Tile{ | ||
|
||
private float friction = 1; | ||
|
||
public SmoothFloor() { | ||
super(1, true, false, Color.gray); | ||
} | ||
|
||
public void tick() { | ||
|
||
} | ||
|
||
public void render() { | ||
|
||
} | ||
|
||
public float getFriction() { | ||
return friction; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package menu; | ||
|
||
import java.io.FileNotFoundException; | ||
import java.io.IOException; | ||
|
||
import game.Game; | ||
import level.LevelHandler; | ||
|
||
public class Menu { | ||
|
||
// Will display options. This is the main menu. | ||
// Currently jumps right to a game. | ||
public void run() throws IOException{ | ||
Game game = new Game(); | ||
// Show menu options here | ||
|
||
// Control flow to select level, game modes, etc. | ||
|
||
// Pretend a test level was selected | ||
LevelHandler chosenLevel = new LevelHandler("/res/test.txt"); | ||
game.setLevel(chosenLevel); | ||
} | ||
|
||
} |