Skip to content

Commit

Permalink
Fixed some style guide issues
Browse files Browse the repository at this point in the history
  • Loading branch information
moikheck committed Nov 23, 2021
1 parent d3f857e commit 2f27c41
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 56 deletions.
22 changes: 11 additions & 11 deletions project/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -36,42 +36,42 @@ window=false

move_up={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null)
]
}
move_left={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null)
]
}
move_right={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null)
]
}
move_down={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null)
]
}
attack={
"deadzone": 0.5,
"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null)
]
}
open_inventory={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":69,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":69,"unicode":0,"echo":false,"script":null)
]
}
change_weapon={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":82,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":82,"unicode":0,"echo":false,"script":null)
]
}

Expand Down
3 changes: 2 additions & 1 deletion project/src/HUD.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ extends Control

const KEY_OUTLINE := "res://assets/Items/key_outline.png"
const KEY_TEXTURED := "res://assets/Items/key.png"
const INDEX := 100


func _on_RestartButton_pressed():
Expand All @@ -27,5 +28,5 @@ func update_key_count(value):
particles.texture = load("res://assets/Items/key_particle.png")
particles.position = $KeyLogo.position
particles.emitting = true
particles.z_index = 100
particles.z_index = INDEX
get_parent().call_deferred("add_child", particles)
13 changes: 7 additions & 6 deletions project/src/Item.gd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extends Sprite
class_name Item
extends Sprite


var potion := load("res://assets/Items/potion_full.png")
Expand All @@ -19,9 +19,15 @@ var rank := "null"

export var area_type := "item"


onready var player := get_node("../Player")


func _on_Area2D_area_entered(area):
if area == player.get_current_weapon():
collect()


func set_item(new_type, new_rank):
type = new_type
rank = new_rank
Expand Down Expand Up @@ -52,11 +58,6 @@ func set_item(new_type, new_rank):
texture = gold_longsword


func _on_Area2D_area_entered(area):
if area == player.get_current_weapon():
collect()


func collect():
player.collect_item(type, rank)
queue_free()
11 changes: 5 additions & 6 deletions project/src/Level.gd
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ func _process(_delta):
$Gate.visible = false
$Gate/StaticBody2D/CollisionShape2D.disabled = true
$Player/HUD/DoorLabel.show()



func pause_enemies(value):
for enemy in get_tree().get_nodes_in_group("Enemies"):
enemy.pause(value)


func _on_Chest_open(chest):
Expand All @@ -35,3 +29,8 @@ func _on_Dungeon_body_exited(body):
$Player/HUD/EndMessage.text = "You Win"
$Player/HUD/RestartButton.visible = true
$Player/HUD/EndMessage.visible = true


func pause_enemies(value):
for enemy in get_tree().get_nodes_in_group("Enemies"):
enemy.pause(value)
22 changes: 11 additions & 11 deletions project/src/Player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,17 @@ func _on_AnimatedSprite_animation_finished():
_is_hurt = false


func _on_InventoryButton_toggled(button_pressed):
if button_pressed:
pause()
else:
unpause()


func _on_WeaponButton_pressed():
switch_weapon()


func take_damage(damage):
if not _is_hurt:
health -= damage
Expand Down Expand Up @@ -214,14 +225,3 @@ func spawn_particles(par_tex):
particles.emitting = true
particles.z_index = 100
get_parent().call_deferred("add_child", particles)


func _on_InventoryButton_toggled(button_pressed):
if button_pressed:
pause()
else:
unpause()


func _on_WeaponButton_pressed():
switch_weapon()
42 changes: 21 additions & 21 deletions project/src/TitleScreen.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,35 @@ corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5

[sub_resource type="StyleBoxFlat" id=7]
[sub_resource type="StyleBoxFlat" id=4]
bg_color = Color( 0.803922, 0.784314, 0.784314, 1 )
corner_radius_top_left = 20
corner_radius_top_right = 20
corner_radius_bottom_right = 20
corner_radius_bottom_left = 20

[sub_resource type="DynamicFont" id=4]
size = 28
font_data = ExtResource( 3 )

[sub_resource type="StyleBoxFlat" id=5]
bg_color = Color( 0, 0, 0, 0.180392 )

[sub_resource type="StyleBoxFlat" id=6]
bg_color = Color( 0.6, 0.6, 0.6, 0 )

[sub_resource type="DynamicFont" id=7]
size = 28
font_data = ExtResource( 3 )

[sub_resource type="DynamicFont" id=8]
size = 52
font_data = ExtResource( 3 )

[sub_resource type="DynamicFont" id=9]
font_data = ExtResource( 3 )
[sub_resource type="StyleBoxFlat" id=9]
bg_color = Color( 0.6, 0.6, 0.6, 0 )

[sub_resource type="StyleBoxFlat" id=10]
bg_color = Color( 0.6, 0.6, 0.6, 0 )

[sub_resource type="StyleBoxFlat" id=11]
bg_color = Color( 0.6, 0.6, 0.6, 0 )
[sub_resource type="DynamicFont" id=11]
font_data = ExtResource( 3 )

[node name="TitleScreen" type="Node2D"]
script = ExtResource( 2 )
Expand All @@ -71,10 +71,10 @@ margin_left = 448.0
margin_top = 413.0
margin_right = 573.0
margin_bottom = 447.0
custom_colors/font_color = Color( 0, 0, 0, 1 )
custom_colors/font_color_hover = Color( 0, 0, 0, 1 )
custom_styles/hover = SubResource( 2 )
custom_styles/normal = SubResource( 3 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
custom_colors/font_color_hover = Color( 0, 0, 0, 1 )
text = "Start Game"
__meta__ = {
"_edit_use_anchors_": false
Expand All @@ -85,10 +85,10 @@ margin_left = 448.0
margin_top = 470.0
margin_right = 573.0
margin_bottom = 504.0
custom_colors/font_color = Color( 0, 0, 0, 1 )
custom_colors/font_color_hover = Color( 0, 0, 0, 1 )
custom_styles/hover = SubResource( 2 )
custom_styles/normal = SubResource( 3 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
custom_colors/font_color_hover = Color( 0, 0, 0, 1 )
text = "How To Play"
__meta__ = {
"_edit_use_anchors_": false
Expand All @@ -107,18 +107,18 @@ margin_left = 163.0
margin_top = 38.0
margin_right = 863.0
margin_bottom = 577.0
custom_styles/panel = SubResource( 7 )
custom_styles/panel = SubResource( 4 )

[node name="Exit" type="Button" parent="InstructionsPopup"]
margin_left = 797.0
margin_top = 72.0
margin_right = 840.0
margin_bottom = 108.0
custom_colors/font_color = Color( 0, 0, 0, 1 )
custom_colors/font_color_hover = Color( 1, 1, 1, 1 )
custom_fonts/font = SubResource( 4 )
custom_styles/hover = SubResource( 5 )
custom_styles/normal = SubResource( 6 )
custom_fonts/font = SubResource( 7 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
custom_colors/font_color_hover = Color( 1, 1, 1, 1 )
text = "X"
__meta__ = {
"_edit_use_anchors_": false
Expand All @@ -129,19 +129,19 @@ margin_left = 346.0
margin_top = 64.0
margin_right = 657.0
margin_bottom = 130.0
custom_colors/default_color = Color( 0, 0, 0, 1 )
custom_fonts/normal_font = SubResource( 8 )
custom_colors/default_color = Color( 0, 0, 0, 1 )
text = "How To Play"

[node name="TextEdit" type="TextEdit" parent="InstructionsPopup"]
margin_left = 227.0
margin_top = 175.0
margin_right = 808.0
margin_bottom = 548.0
custom_styles/read_only = SubResource( 9 )
custom_styles/normal = SubResource( 10 )
custom_fonts/font = SubResource( 11 )
custom_colors/font_color_readonly = Color( 0, 0, 0, 1 )
custom_fonts/font = SubResource( 9 )
custom_styles/read_only = SubResource( 10 )
custom_styles/normal = SubResource( 11 )
text = "Controls
Use the arrow keys to move around
Use the mouse to attack, collect and interact with enemies and objects
Expand Down

0 comments on commit 2f27c41

Please sign in to comment.