Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SpaceCheckers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TDT4240-group23
SpaceCheckers
Commits
d593e3a4
Commit
d593e3a4
authored
Apr 24, 2021
by
Anders H. Rebner
Browse files
Options
Downloads
Patches
Plain Diff
Gathered game-finished-functions in PlayView
parent
68c1e43e
No related branches found
No related tags found
1 merge request
!14
WIP: Default game
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CheckersClient/core/src/com/mygdx/game/controllers/GameController.java
+1
-2
1 addition, 2 deletions
...t/core/src/com/mygdx/game/controllers/GameController.java
CheckersClient/core/src/com/mygdx/game/views/PlayView.java
+11
-6
11 additions, 6 deletions
CheckersClient/core/src/com/mygdx/game/views/PlayView.java
with
12 additions
and
8 deletions
CheckersClient/core/src/com/mygdx/game/controllers/GameController.java
+
1
−
2
View file @
d593e3a4
...
...
@@ -111,7 +111,6 @@ public class GameController {
}
public
void
setGameFinished
()
{
this
.
view
.
removeTurnIndicator
();
this
.
view
.
placeExitButton
();
this
.
view
.
setGameFinished
();
}
}
This diff is collapsed.
Click to expand it.
CheckersClient/core/src/com/mygdx/game/views/PlayView.java
+
11
−
6
View file @
d593e3a4
...
...
@@ -56,6 +56,8 @@ public class PlayView extends AbstractView {
List
<
Image
>
possibleMoves
=
new
ArrayList
<>();
Texture
possibleMoveTexture
;
TextButton
leaveButton
;
float
scale_factor_piece
;
public
float
hex_side_length
;
...
...
@@ -213,11 +215,6 @@ public class PlayView extends AbstractView {
rocketExhaustImage
.
setPosition
(
rocketImage
.
getX
()
-
62
F
,
rocketImage
.
getY
()
+
20
F
-
(
rocketImage
.
getHeight
())
*
rocketImage
.
getScaleY
());
}
public
void
removeTurnIndicator
()
{
rocketImage
.
remove
();
rocketExhaustImage
.
remove
();
}
public
void
placePossibleMoves
(
List
<
Vector3
>
cubeCoordinates
)
{
Float
[]
coordinates
;
...
...
@@ -274,6 +271,14 @@ public class PlayView extends AbstractView {
stage
.
addActor
(
placeField
);
}
public
void
setGameFinished
()
{
// Remove turn indicator and leavebutton. Place exit button
rocketImage
.
remove
();
rocketExhaustImage
.
remove
();
leaveButton
.
remove
();
placeExitButton
();
}
public
void
placeExitButton
()
{
TextButton
homeButton
=
new
TextButton
(
"Exit"
,
skin
,
"small"
);
homeButton
.
setPosition
(
Gdx
.
graphics
.
getWidth
()
/
2
F
-
homeButton
.
getWidth
()
/
2
F
,
Gdx
.
graphics
.
getHeight
()
/
2
F
-
homeButton
.
getHeight
()
/
2
F
);
...
...
@@ -292,7 +297,7 @@ public class PlayView extends AbstractView {
}
public
void
placeLeaveButton
()
{
TextButton
leaveButton
=
new
TextButton
(
"Leave"
,
skin
,
"small"
);
leaveButton
=
new
TextButton
(
"Leave"
,
skin
,
"small"
);
leaveButton
.
setSize
(
col_width
,
(
float
)(
row_height
*
0.75
));
leaveButton
.
setPosition
(
Gdx
.
graphics
.
getWidth
()
/
2
+
(
boardImage
.
getWidth
()
*
boardImage
.
getScaleX
())
/
3
-
leaveButton
.
getWidth
()
/
2
,
Gdx
.
graphics
.
getHeight
()
-
3
F
*
hex_side_length
-
leaveButton
.
getHeight
()
/
2
F
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment