Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Chess2
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
Sander Skogh Linnerud
Chess2
Commits
9fb828d5
Commit
9fb828d5
authored
1 year ago
by
Sander Skogh Linnerud
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/main' into refactor
parents
2eb7efe8
809b4d9c
No related branches found
No related tags found
1 merge request
!73
refactor
Pipeline
#275663
passed
1 year ago
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/src/com/mygdx/game/view/HowToPlayView.java
+16
-5
16 additions, 5 deletions
core/src/com/mygdx/game/view/HowToPlayView.java
with
16 additions
and
5 deletions
core/src/com/mygdx/game/view/HowToPlayView.java
+
16
−
5
View file @
9fb828d5
...
@@ -23,7 +23,8 @@ public class HowToPlayView extends ViewState {
...
@@ -23,7 +23,8 @@ public class HowToPlayView extends ViewState {
"This is the piece Phenoix, as you can see it can only move like a box around it."
,
"This is the piece Phenoix, as you can see it can only move like a box around it."
,
"This is the piece Snake, this pice work like a bishop, but it jumps diagonaly instead"
,
"This is the piece Snake, this pice work like a bishop, but it jumps diagonaly instead"
,
"And last new piece is the Thief, this piece can move like a rook, but it jumps like the snake"
,
"And last new piece is the Thief, this piece can move like a rook, but it jumps like the snake"
,
"After choosing loadout and mapsize, you can click \"Start Game\" to start the game. Good luck!"
"After choosing loadout and mapsize, you can click \"Start Game\" to start the game."
,
"To win the game, you need to capture your opponent's king. Good luck!"
};
};
private
final
String
[]
imgUrls
=
{
"images/howtoplay-1.png"
,
"images/howtoplay-2.png"
,
"images/howtoplay-3.png"
,
private
final
String
[]
imgUrls
=
{
"images/howtoplay-1.png"
,
"images/howtoplay-2.png"
,
"images/howtoplay-3.png"
,
...
@@ -45,9 +46,15 @@ public class HowToPlayView extends ViewState {
...
@@ -45,9 +46,15 @@ public class HowToPlayView extends ViewState {
}
}
private
void
addImg
(
Table
table
)
{
private
void
addImg
(
Table
table
)
{
try
{
Texture
logoTexture
=
new
Texture
(
Gdx
.
files
.
internal
(
getImgUrl
()));
Texture
logoTexture
=
new
Texture
(
Gdx
.
files
.
internal
(
getImgUrl
()));
Image
logo
=
new
Image
(
logoTexture
);
Image
logo
=
new
Image
(
logoTexture
);
table
.
add
(
logo
).
center
();
table
.
add
(
logo
).
center
();
}
// Catch exception if image index is out of bounds or image is not found
// Simply do not add the image in this case
catch
(
Exception
e
)
{
}
table
.
row
();
table
.
row
();
}
}
...
@@ -64,7 +71,11 @@ public class HowToPlayView extends ViewState {
...
@@ -64,7 +71,11 @@ public class HowToPlayView extends ViewState {
}
}
private
String
getImgUrl
()
{
private
String
getImgUrl
()
{
return
imgUrls
[
HowToPlayController
.
getCurrentPage
()
-
1
];
int
index
=
HowToPlayController
.
getCurrentPage
()
-
1
;
if
(
index
<
0
||
index
>=
imgUrls
.
length
)
{
throw
new
RuntimeException
(
"Invalid index"
);
}
return
imgUrls
[
index
];
}
}
private
String
getDescription
()
{
private
String
getDescription
()
{
...
...
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