Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ProgArkProject
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
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sixten Müller
ProgArkProject
Commits
a2a32f22
Commit
a2a32f22
authored
1 year ago
by
Rebekka Aashaug Stangvik
Browse files
Options
Downloads
Patches
Plain Diff
added go back button to create game view
parent
7365837b
No related branches found
No related tags found
1 merge request
!19
Resolve "Add settings button"
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/src/com/wordbattle/game/controller/CreateGameController.java
+5
-0
5 additions, 0 deletions
.../com/wordbattle/game/controller/CreateGameController.java
core/src/com/wordbattle/game/view/CreateGameView.java
+12
-1
12 additions, 1 deletion
core/src/com/wordbattle/game/view/CreateGameView.java
with
17 additions
and
1 deletion
core/src/com/wordbattle/game/controller/CreateGameController.java
+
5
−
0
View file @
a2a32f22
...
@@ -7,6 +7,7 @@ import com.badlogic.gdx.math.Vector3;
...
@@ -7,6 +7,7 @@ import com.badlogic.gdx.math.Vector3;
import
com.wordbattle.game.network.FirebaseInterface
;
import
com.wordbattle.game.network.FirebaseInterface
;
import
com.wordbattle.game.states.LobbyState
;
import
com.wordbattle.game.states.LobbyState
;
import
com.wordbattle.game.states.CreateGameState
;
import
com.wordbattle.game.states.CreateGameState
;
import
com.wordbattle.game.states.MainMenuState
;
import
com.wordbattle.game.states.SettingsState
;
import
com.wordbattle.game.states.SettingsState
;
import
com.wordbattle.game.view.CreateGameView
;
import
com.wordbattle.game.view.CreateGameView
;
...
@@ -49,6 +50,10 @@ public class CreateGameController {
...
@@ -49,6 +50,10 @@ public class CreateGameController {
System
.
out
.
println
(
"Settings Pressed"
);
System
.
out
.
println
(
"Settings Pressed"
);
state
.
getStateManager
().
setState
(
new
SettingsState
(
state
.
getStateManager
(),
_FBIC
));
state
.
getStateManager
().
setState
(
new
SettingsState
(
state
.
getStateManager
(),
_FBIC
));
}
}
if
(
createGameView
.
getGoBackButtonBounds
().
contains
(
touchPos
.
x
,
touchPos
.
y
))
{
state
.
getStateManager
().
setState
(
new
MainMenuState
(
state
.
getStateManager
(),
_FBIC
));
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
core/src/com/wordbattle/game/view/CreateGameView.java
+
12
−
1
View file @
a2a32f22
...
@@ -44,6 +44,7 @@ public class CreateGameView {
...
@@ -44,6 +44,7 @@ public class CreateGameView {
private
String
selectedLevel
=
"easy"
;
// default to easy
private
String
selectedLevel
=
"easy"
;
// default to easy
private
Rectangle
settingsBounds
;
private
Rectangle
settingsBounds
;
private
Rectangle
goBackButtonBounds
;
public
CreateGameView
(
OrthographicCamera
cam
)
{
public
CreateGameView
(
OrthographicCamera
cam
)
{
...
@@ -78,12 +79,18 @@ public class CreateGameView {
...
@@ -78,12 +79,18 @@ public class CreateGameView {
100
100
);
);
goBackButtonBounds
=
new
Rectangle
(
0
,
WordBattle
.
HEIGHT
-
100
,
100
,
100
);
// Generate a random PIN
// Generate a random PIN
pin
=
generateRandomPin
();
pin
=
generateRandomPin
();
// Load textures
// Load textures
backgroundTexture
=
new
Texture
(
"bg
WithS
ettings.png"
);
backgroundTexture
=
new
Texture
(
"bg
_btn_s
ettings.png"
);
nicknameTexture
=
new
Texture
(
"pink_long-01.png"
);
nicknameTexture
=
new
Texture
(
"pink_long-01.png"
);
createGameTexture
=
new
Texture
(
"Golden_long-01.png"
);
createGameTexture
=
new
Texture
(
"Golden_long-01.png"
);
// Levels, non-selected
// Levels, non-selected
...
@@ -121,6 +128,10 @@ public class CreateGameView {
...
@@ -121,6 +128,10 @@ public class CreateGameView {
return
String
.
format
(
"%04d"
,
new
Random
().
nextInt
(
10000
));
return
String
.
format
(
"%04d"
,
new
Random
().
nextInt
(
10000
));
}
}
public
Rectangle
getGoBackButtonBounds
()
{
return
goBackButtonBounds
;
}
public
void
render
(
SpriteBatch
spriteBatch
)
{
public
void
render
(
SpriteBatch
spriteBatch
)
{
...
...
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
register
or
sign in
to comment