Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
the_dungeon_project
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
genie_logiciel_2015
the_dungeon_project
Commits
2c6a98dd
Commit
2c6a98dd
authored
Jan 01, 2016
by
Thomas Dupriez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a GameOver panel to the swing gui
parent
b0fc6083
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
1 deletion
+69
-1
src/graphics/graphical_abstraction/GraphicsMasterAbstraction.java
...hics/graphical_abstraction/GraphicsMasterAbstraction.java
+2
-1
src/graphics/guiSkeleton/GraphicsMaster.java
src/graphics/guiSkeleton/GraphicsMaster.java
+3
-0
src/graphics/guiSkeleton/guiPanel/menuPanel/GameOverPanel.java
...raphics/guiSkeleton/guiPanel/menuPanel/GameOverPanel.java
+64
-0
No files found.
src/graphics/graphical_abstraction/GraphicsMasterAbstraction.java
View file @
2c6a98dd
...
@@ -34,7 +34,8 @@ public abstract class GraphicsMasterAbstraction {
...
@@ -34,7 +34,8 @@ public abstract class GraphicsMasterAbstraction {
MULTIPLAYER_GAME_CREATION
,
MULTIPLAYER_GAME_CREATION
,
SINGLEPLAYER_GAME_CREATION
,
SINGLEPLAYER_GAME_CREATION
,
MULTIPLAYER_CHARACTER_CHOICE
,
MULTIPLAYER_CHARACTER_CHOICE
,
SINGLEPLAYER_CHARACTER_CHOICE
}
SINGLEPLAYER_CHARACTER_CHOICE
,
GAME_OVER
}
//This map indicates to graphicsMaster which guiPanel is associated to each GUIState, it is filled in Graphicsmaster's constructor
//This map indicates to graphicsMaster which guiPanel is associated to each GUIState, it is filled in Graphicsmaster's constructor
protected
HashMap
<
GUIStates
,
PanelAbstraction
>
mapGUIStatesToGUIPanel
=
new
HashMap
<>();
protected
HashMap
<
GUIStates
,
PanelAbstraction
>
mapGUIStatesToGUIPanel
=
new
HashMap
<>();
//The current state of the GUI
//The current state of the GUI
...
...
src/graphics/guiSkeleton/GraphicsMaster.java
View file @
2c6a98dd
...
@@ -54,6 +54,8 @@ public class GraphicsMaster extends GraphicsMasterAbstraction {
...
@@ -54,6 +54,8 @@ public class GraphicsMaster extends GraphicsMasterAbstraction {
mapGUIStatesToGUIPanel
.
put
(
GUIStates
.
SINGLEPLAYER_GAME_CREATION
,
new
SinglePlayer_GameCreationPanel
(
this
));
mapGUIStatesToGUIPanel
.
put
(
GUIStates
.
SINGLEPLAYER_GAME_CREATION
,
new
SinglePlayer_GameCreationPanel
(
this
));
mapGUIStatesToGUIPanel
.
put
(
GUIStates
.
SINGLEPLAYER_CHARACTER_CHOICE
,
new
SinglePlayer_CharacterChoicePanel
(
this
));
mapGUIStatesToGUIPanel
.
put
(
GUIStates
.
SINGLEPLAYER_CHARACTER_CHOICE
,
new
SinglePlayer_CharacterChoicePanel
(
this
));
mapGUIStatesToGUIPanel
.
put
(
GUIStates
.
SINGLEPLAYER_LOADGAME
,
new
SinglePlayer_LoadGamePanel
(
this
));
mapGUIStatesToGUIPanel
.
put
(
GUIStates
.
SINGLEPLAYER_LOADGAME
,
new
SinglePlayer_LoadGamePanel
(
this
));
mapGUIStatesToGUIPanel
.
put
(
GUIStates
.
GAME_OVER
,
new
GameOverPanel
(
this
));
}
}
public
static
void
build
()
{
public
static
void
build
()
{
...
@@ -83,6 +85,7 @@ public class GraphicsMaster extends GraphicsMasterAbstraction {
...
@@ -83,6 +85,7 @@ public class GraphicsMaster extends GraphicsMasterAbstraction {
//mf.addKeyListener(mainFrameKeyListener);
//mf.addKeyListener(mainFrameKeyListener);
//mf.revalidate();
//mf.revalidate();
//mf.setVisible(true);
//mf.setVisible(true);
changeGUIStateTo
(
GUIStates
.
MAIN_MENU
);
changeGUIStateTo
(
GUIStates
.
MAIN_MENU
);
}
}
});
});
...
...
src/graphics/guiSkeleton/guiPanel/menuPanel/GameOverPanel.java
0 → 100644
View file @
2c6a98dd
package
graphics.guiSkeleton.guiPanel.menuPanel
;
import
graphics.graphical_abstraction.GraphicsMasterAbstraction
;
import
graphics.guiSkeleton.GUIColorsAndFonts
;
import
graphics.guiSkeleton.GraphicsMaster
;
import
graphics.guiSkeleton.guiPanel.menuPanel.facilities.ButtonMaker
;
import
graphics.guiSkeleton.guiPanel.menuPanel.facilities.MenuPanel
;
import
graphics.ingame_input_listener.Input
;
import
javax.swing.*
;
import
java.awt.event.ActionEvent
;
import
java.awt.event.ActionListener
;
/**
* Created by dupriez on 01/01/16.
*/
public
class
GameOverPanel
extends
MenuPanel
{
public
GameOverPanel
(
GraphicsMaster
graphicsMaster
)
{
super
(
graphicsMaster
);
JLabel
sorryLabel
=
new
JLabel
(
"sorry, you died..."
);
sorryLabel
.
setFont
(
GUIColorsAndFonts
.
smallFont1
);
sorryLabel
.
setForeground
(
GUIColorsAndFonts
.
fontColor1
);
setTitlePanel
(
"Game Over"
);
addToCentralColumn
(
sorryLabel
,
1
,
1
);
addToCentralColumn
(
ButtonMaker
.
makeButton
(
"Return to main menu"
,
returnButtonActionListener
),
1
,
1
);
GraphicsMasterAbstraction
.
getInstance
().
changeGUIStateTo
(
GraphicsMasterAbstraction
.
GUIStates
.
GAME_OVER
);
}
private
ActionListener
returnButtonActionListener
=
new
ActionListener
()
{
@Override
public
void
actionPerformed
(
ActionEvent
actionEvent
)
{
getGraphicsMaster
().
changeGUIStateTo
(
GraphicsMaster
.
GUIStates
.
MAIN_MENU
);
}
};
@Override
public
void
initialise
()
{
}
@Override
public
void
finalise
()
{
}
@Override
public
void
keyPressedHandler
(
Input
e
)
{
}
@Override
public
void
keyReleasedHandler
(
Input
e
)
{
}
@Override
public
void
keyTypedHandler
(
Input
e
)
{
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment