Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Go Save The King
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Htoo Aung (kha451)
Go Save The King
Commits
33869ee6
Commit
33869ee6
authored
1 month ago
by
Alan
Browse files
Options
Downloads
Patches
Plain Diff
Pieces now move out to the left when captured
parent
3c25ddfa
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.godot/editor/script_editor_cache.cfg
+2
-2
2 additions, 2 deletions
.godot/editor/script_editor_cache.cfg
scripts/game.gd
+28
-1
28 additions, 1 deletion
scripts/game.gd
with
30 additions
and
3 deletions
.godot/editor/script_editor_cache.cfg
+
2
−
2
View file @
33869ee6
...
...
@@ -129,11 +129,11 @@ state={
state
=
{
"bookmarks":
PackedInt32Array(),
"breakpoints":
PackedInt32Array(),
"column":
38
,
"column":
19
,
"folded_lines":
Array
[int]
(
[]
),
"h_scroll_position":
0,
"row":
113,
"scroll_position":
9
9
.0,
"scroll_position":
9
5
.0,
"selection":
false,
"syntax_highlighter":
"GDScript"
}
This diff is collapsed.
Click to expand it.
scripts/game.gd
+
28
−
1
View file @
33869ee6
...
...
@@ -117,7 +117,8 @@ func _process(delta: float) -> void:
if
selected_piece_value
is
Pawn
:
if
selected_piece_value
.
is_white
:
draw_pieces
()
remove_piece
(
selected_piece_position
.
x
,
selected_piece_position
.
y
)
selected_piece
.
queue_free
()
# remove_piece(selected_piece_position.x, selected_piece_position.y)
func
draw_pieces
():
...
...
@@ -337,6 +338,32 @@ func remove_piece(x,y):
if
child
.
position
==
Vector2
(
x
*
tile_size
+
32
,
y
*
tile_size
+
32
):
explosion_effect
.
position
=
child
.
position
+
translate
()
explosion_effect
.
restart
()
var
piece
=
child
.
duplicate
()
if
is_opponent
(
x
,
y
):
opponent_piece_count
+=
1
if
opponent_piece_count
<=
4
:
piece
.
position
=
Vector2
(
opponent_piece_count
-
1
,
0
)
*
tile_size
elif
opponent_piece_count
<=
8
:
piece
.
position
=
Vector2
(
opponent_piece_count
-
5
,
1
)
*
tile_size
elif
opponent_piece_count
<=
12
:
piece
.
position
=
Vector2
(
opponent_piece_count
-
9
,
2
)
*
tile_size
else
:
piece
.
position
=
Vector2
(
opponent_piece_count
-
13
,
3
)
*
tile_size
opponent_pieces
.
add_child
(
piece
)
else
:
player_piece_count
+=
1
if
player_piece_count
<=
4
:
piece
.
position
=
Vector2
(
player_piece_count
-
1
,
0
)
*
tile_size
elif
player_piece_count
<=
8
:
piece
.
position
=
Vector2
(
player_piece_count
-
5
,
1
)
*
tile_size
elif
player_piece_count
<=
12
:
piece
.
position
=
Vector2
(
player_piece_count
-
9
,
2
)
*
tile_size
else
:
piece
.
position
=
Vector2
(
player_piece_count
-
13
,
3
)
*
tile_size
player_pieces
.
add_child
(
piece
)
piece_container
.
remove_child
(
child
)
child
.
queue_free
()
break
...
...
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