Skip to content

Commit

Permalink
Add keyboard controls
Browse files Browse the repository at this point in the history
There are a handful of bugfixing and exception handling needed, but it works
  • Loading branch information
Melonator committed Feb 17, 2021
1 parent ec8b767 commit 6d325b4
Show file tree
Hide file tree
Showing 14 changed files with 386 additions and 304 deletions.
Binary file added Assets/UI/TextBox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Assets/UI/TextBox.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/TextBox.png-2ad7bec0b4178924442104273f95e7b4.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Assets/UI/TextBox.png"
dest_files=[ "res://.import/TextBox.png-2ad7bec0b4178924442104273f95e7b4.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
6 changes: 6 additions & 0 deletions Code Combat.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project Sdk="Godot.NET.Sdk/3.2.4">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<RootNamespace>CodeCombat</RootNamespace>
</PropertyGroup>
</Project>
6 changes: 6 additions & 0 deletions Code Combat.csproj.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project Sdk="Godot.NET.Sdk/3.2.3">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<RootNamespace>CodeCombat</RootNamespace>
</PropertyGroup>
</Project>
19 changes: 19 additions & 0 deletions Code Combat.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Code Combat", "Code Combat.csproj", "{C43DDD98-445D-4980-B226-93C668245C1D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
ExportDebug|Any CPU = ExportDebug|Any CPU
ExportRelease|Any CPU = ExportRelease|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C43DDD98-445D-4980-B226-93C668245C1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C43DDD98-445D-4980-B226-93C668245C1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C43DDD98-445D-4980-B226-93C668245C1D}.ExportDebug|Any CPU.ActiveCfg = ExportDebug|Any CPU
{C43DDD98-445D-4980-B226-93C668245C1D}.ExportDebug|Any CPU.Build.0 = ExportDebug|Any CPU
{C43DDD98-445D-4980-B226-93C668245C1D}.ExportRelease|Any CPU.ActiveCfg = ExportRelease|Any CPU
{C43DDD98-445D-4980-B226-93C668245C1D}.ExportRelease|Any CPU.Build.0 = ExportRelease|Any CPU
EndGlobalSection
EndGlobal
363 changes: 162 additions & 201 deletions Levels/ArenaManager.cs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Levels/ClassSelect.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ __meta__ = {

[node name="SelectPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 10 )

[connection signal="mouse_entered" from="Classes/Basic" to="Players" method="_on_button_mouse_entered"]
[connection signal="pressed" from="Classes/Basic" to="Players" method="_on_Basic_pressed"]
[connection signal="mouse_entered" from="Classes/Archer" to="Players" method="_on_button_mouse_entered"]
Expand Down
101 changes: 47 additions & 54 deletions Levels/NavigationArena.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=24 format=2]
[gd_scene load_steps=23 format=2]

[ext_resource path="res://Levels/ArenaManager.cs" type="Script" id=1]
[ext_resource path="res://Assets/Tiles/ObstacleTile.png" type="Texture" id=2]
Expand All @@ -10,7 +10,6 @@
[ext_resource path="res://Levels/Highlight.cs" type="Script" id=8]
[ext_resource path="res://Assets/Tiles/ActorTile.png" type="Texture" id=9]
[ext_resource path="res://Levels/UI/MainUI.tscn" type="PackedScene" id=10]
[ext_resource path="res://Levels/UI/BasicRed.tscn" type="PackedScene" id=11]
[ext_resource path="res://Assets/Sounds/Explosion.ogg" type="AudioStream" id=12]
[ext_resource path="res://Assets/UI/Yellow Alert.png" type="Texture" id=13]
[ext_resource path="res://Assets/UI/Red Alert.png" type="Texture" id=14]
Expand Down Expand Up @@ -165,9 +164,6 @@ margin_bottom = 0.0

[node name="Troop List" parent="Screen" instance=ExtResource( 4 )]

[node name="TroopDisplay" parent="Screen" instance=ExtResource( 11 )]
visible = false

[node name="Labels" type="Control" parent="."]
margin_right = 40.0
margin_bottom = 40.0
Expand Down Expand Up @@ -218,38 +214,38 @@ __meta__ = {
}

[node name="4" type="Label" parent="Labels"]
margin_left = 47.3414
margin_top = 97.7662
margin_right = 58.3414
margin_bottom = 138.766
margin_left = 46.9441
margin_top = 98.5608
margin_right = 57.9441
margin_bottom = 139.561
custom_fonts/font = SubResource( 2 )
text = "e"
text = "d"
align = 1
valign = 1
__meta__ = {
"_edit_use_anchors_": false
}

[node name="5" type="Label" parent="Labels"]
margin_left = 53.8652
margin_top = 102.537
margin_right = 64.8652
margin_bottom = 143.537
margin_left = 54.6598
margin_top = 103.067
margin_right = 65.6598
margin_bottom = 144.067
custom_fonts/font = SubResource( 2 )
text = "f"
text = "e"
align = 1
valign = 1
__meta__ = {
"_edit_use_anchors_": false
}

[node name="6" type="Label" parent="Labels"]
margin_left = 62.3379
margin_top = 105.297
margin_right = 73.3379
margin_bottom = 146.297
margin_left = 62.8676
margin_top = 105.562
margin_right = 73.8676
margin_bottom = 146.562
custom_fonts/font = SubResource( 2 )
text = "g"
text = "f"
align = 1
valign = 1
__meta__ = {
Expand All @@ -262,33 +258,33 @@ margin_top = 110.402
margin_right = 82.1095
margin_bottom = 151.402
custom_fonts/font = SubResource( 2 )
text = "h"
text = "g"
align = 1
valign = 1
__meta__ = {
"_edit_use_anchors_": false
}

[node name="8" type="Label" parent="Labels"]
margin_left = 78.2286
margin_left = 78.6259
margin_top = 114.882
margin_right = 89.2286
margin_right = 89.6259
margin_bottom = 155.882
custom_fonts/font = SubResource( 2 )
text = "i"
text = "h"
align = 1
valign = 1
__meta__ = {
"_edit_use_anchors_": false
}

[node name="9" type="Label" parent="Labels"]
margin_left = 85.2728
margin_top = 118.247
margin_right = 96.2728
margin_bottom = 159.247
margin_left = 87.1269
margin_top = 118.115
margin_right = 98.1269
margin_bottom = 159.115
custom_fonts/font = SubResource( 2 )
text = "j"
text = "i"
align = 1
valign = 1
__meta__ = {
Expand All @@ -301,33 +297,33 @@ margin_top = 122.078
margin_right = 105.689
margin_bottom = 163.078
custom_fonts/font = SubResource( 2 )
text = "k"
text = "j"
align = 1
valign = 1
__meta__ = {
"_edit_use_anchors_": false
}

[node name="11" type="Label" parent="Labels"]
margin_left = 101.9
margin_top = 126.573
margin_right = 112.9
margin_bottom = 167.573
margin_left = 102.695
margin_top = 125.911
margin_right = 113.695
margin_bottom = 166.911
custom_fonts/font = SubResource( 2 )
text = "l"
text = "k"
align = 1
valign = 1
__meta__ = {
"_edit_use_anchors_": false
}

[node name="12" type="Label" parent="Labels"]
margin_left = 110.422
margin_left = 110.687
margin_top = 130.352
margin_right = 121.422
margin_right = 121.687
margin_bottom = 171.352
custom_fonts/font = SubResource( 2 )
text = "m"
text = "l"
align = 1
valign = 1
__meta__ = {
Expand All @@ -340,46 +336,46 @@ margin_top = 133.877
margin_right = 129.662
margin_bottom = 174.877
custom_fonts/font = SubResource( 2 )
text = "n"
text = "m"
align = 1
valign = 1
__meta__ = {
"_edit_use_anchors_": false
}

[node name="14" type="Label" parent="Labels"]
margin_left = 126.341
margin_left = 126.871
margin_top = 137.623
margin_right = 137.341
margin_right = 137.871
margin_bottom = 178.623
custom_fonts/font = SubResource( 2 )
text = "o"
text = "n"
align = 1
valign = 1
__meta__ = {
"_edit_use_anchors_": false
}

[node name="15" type="Label" parent="Labels"]
margin_left = 134.301
margin_left = 135.003
margin_top = 140.807
margin_right = 145.301
margin_right = 146.003
margin_bottom = 181.807
custom_fonts/font = SubResource( 2 )
text = "p"
text = "o"
align = 1
valign = 1
__meta__ = {
"_edit_use_anchors_": false
}

[node name="16" type="Label" parent="Labels"]
margin_left = 142.208
margin_left = 143.05
margin_top = 145.038
margin_right = 153.208
margin_right = 154.05
margin_bottom = 186.038
custom_fonts/font = SubResource( 2 )
text = "q"
text = "p"
align = 1
valign = 1
__meta__ = {
Expand Down Expand Up @@ -643,6 +639,7 @@ __meta__ = {
}

[node name="ColorRect" type="ColorRect" parent="."]
visible = false
margin_right = 304.0
margin_bottom = 170.0
color = Color( 0, 0, 0, 1 )
Expand All @@ -666,12 +663,8 @@ texture = ExtResource( 13 )
[node name="Red Alert" type="Sprite" parent="."]
position = Vector2( 148.806, -3.059 )
texture = ExtResource( 14 )
[connection signal="DisplayTroopList" from="." to="Screen/Troop List" method="DisplayTroopList"]
[connection signal="DisplayTroopStats" from="." to="Screen/TroopDisplay" method="DisplayStats"]
[connection signal="UpdateTroopList" from="." to="Screen/Troop List" method="UpdateTroopList"]
[connection signal="button_down" from="Screen/Buttons/Attack Button" to="." method="_on_Attack_Button_down"]
[connection signal="button_down" from="Screen/Buttons/Walk Button" to="." method="_on_Walk_Button_down"]
[connection signal="button_down" from="Screen/Buttons/End Button" to="." method="_on_End_Button_down"]

[connection signal="Enter" from="Screen" to="." method="_on_Screen_Enter"]
[connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_AnimationPlayer_finished"]

[editable path="Screen"]
Loading

0 comments on commit 6d325b4

Please sign in to comment.