Skip to content

Commit

Permalink
Merge pull request #47 from bsu-cs315/Instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
lr00429 authored Nov 21, 2021
2 parents f99960d + 7050160 commit d3f857e
Show file tree
Hide file tree
Showing 11 changed files with 331 additions and 103 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Repository for final project. Created by Michael Heckman, Cameron Slash, and Lloyd Rowe.

## Instructions
Use the arrow keys or wasd to move around. Aim and left-click with the mouse to attack enemies. Stun enemies by running into them with your bow out. Open your inventory with E. Pick up items on the ground by attacking them/running into them with a bow. Win the game by defeating all the monsters.
Use the arrow keys or wasd to move around. Aim and left-click with the mouse to attack enemies. Stun enemies by running into them with your bow out. Open your inventory with E or by clicking the backpack icon. Switch weapons by pressing R or clicking the weapons icon. Pick up items on the ground by attacking them/running into them with a bow. Win the game by defeating all the monsters and escaping through the door that opens.

## Project Report

Expand Down
Binary file added project/assets/Tileset/gate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 20 additions & 11 deletions project/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -24,46 +24,54 @@ config/name="Escape-The-Dungeon"
run/main_scene="res://src/TitleScreen.tscn"
config/icon="res://icon.png"

[display]

window/stretch/mode="2d"

[global]

window=false

[input]

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,"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)
"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)
]
}
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,"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)
"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)
]
}
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,"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)
"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)
]
}
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,"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)
"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)
]
}
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,"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,"physical_scancode":0,"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,"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,"physical_scancode":0,"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,"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,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
}

Expand All @@ -74,3 +82,4 @@ common/enable_pause_aware_picking=true
[rendering]

environment/default_environment="res://default_env.tres"
quality/dynamic_fonts/use_oversampling=false
21 changes: 11 additions & 10 deletions project/src/Fuzz.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ height = 11.8597

[sub_resource type="SpriteFrames" id=3]
animations = [ {
"frames": [ ExtResource( 2 ) ],
"loop": true,
"name": "default",
"speed": 1.0
}, {
"frames": [ ExtResource( 3 ) ],
"loop": true,
"name": "hurt 2",
Expand All @@ -34,19 +29,24 @@ animations = [ {
"name": "attack",
"speed": 0.5
}, {
"frames": [ ExtResource( 6 ) ],
"frames": [ ExtResource( 4 ) ],
"loop": true,
"name": "killed",
"speed": 0.5
"name": "hurt",
"speed": 1.0
}, {
"frames": [ ExtResource( 2 ), ExtResource( 7 ) ],
"loop": true,
"name": "walk",
"speed": 2.0
}, {
"frames": [ ExtResource( 4 ) ],
"frames": [ ExtResource( 6 ) ],
"loop": true,
"name": "hurt",
"name": "killed",
"speed": 0.5
}, {
"frames": [ ExtResource( 2 ) ],
"loop": true,
"name": "default",
"speed": 1.0
} ]

Expand All @@ -70,6 +70,7 @@ shape = SubResource( 2 )
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
frames = SubResource( 3 )
animation = "walk"
frame = 1
playing = true

[node name="sound" type="AudioStreamPlayer" parent="."]
Expand Down
32 changes: 24 additions & 8 deletions project/src/HUD.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=13 format=2]
[gd_scene load_steps=14 format=2]

[ext_resource path="res://assets/Fonts/moiktext.ttf" type="DynamicFontData" id=1]
[ext_resource path="res://assets/Screens/Inventory/item-window.png" type="Texture" id=2]
Expand Down Expand Up @@ -47,6 +47,10 @@ tracks/0/keys = {
"values": [ Vector2( 1.1, 1.1 ), Vector2( 1.45, 1.45 ), Vector2( 1.1, 1.1 ) ]
}

[sub_resource type="DynamicFont" id=9]
size = 26
font_data = ExtResource( 1 )

[node name="HUD" type="Control"]
margin_right = 40.0
margin_bottom = 40.0
Expand Down Expand Up @@ -104,10 +108,10 @@ margin_left = -76.368
margin_top = 72.293
margin_right = 75.632
margin_bottom = 114.293
custom_styles/hover = SubResource( 4 )
custom_styles/normal = SubResource( 5 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
custom_colors/font_color_hover = Color( 0, 0, 0, 1 )
custom_styles/hover = SubResource( 4 )
custom_styles/normal = SubResource( 5 )
text = "Return To Title Screen"
__meta__ = {
"_edit_use_anchors_": false
Expand All @@ -132,14 +136,14 @@ scale = Vector2( 1.1, 1.1 )
texture = ExtResource( 3 )

[node name="KeyLogo" type="Sprite" parent="."]
position = Vector2( 61.6926, 199.141 )
position = Vector2( 319, -230 )
texture = ExtResource( 5 )

[node name="KeyLabel" type="Label" parent="."]
margin_left = 93.1643
margin_top = 184.084
margin_right = 151.164
margin_bottom = 235.084
margin_left = 371.0
margin_top = -255.0
margin_right = 429.0
margin_bottom = -204.0
custom_fonts/font = SubResource( 1 )
text = "x0"
__meta__ = {
Expand All @@ -153,4 +157,16 @@ texture = ExtResource( 6 )
[node name="PrimaryAnimation" type="AnimationPlayer" parent="."]
anims/grow = SubResource( 6 )

[node name="DoorLabel" type="Label" parent="."]
visible = false
margin_left = -114.0
margin_top = 199.0
margin_right = 183.0
margin_bottom = 240.0
custom_fonts/font = SubResource( 9 )
text = "The Door Has Opened"
__meta__ = {
"_edit_use_anchors_": false
}

[connection signal="pressed" from="RestartButton" to="." method="_on_RestartButton_pressed"]
18 changes: 12 additions & 6 deletions project/src/Level.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,32 @@ func _ready():
$Item2.set_item("Key", "null")



func _process(_delta):
var no_enemies = get_tree().get_nodes_in_group("Enemies").empty()
if no_enemies:
$Player.active = false
$Player/HUD/EndMessage.text = "You Win"
$Player/HUD/RestartButton.visible = true
$Player/HUD/EndMessage.visible = true
$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):
var position = chest.position
var new_item: Item = load("res://src/Item.tscn").instance()
new_item.set_item("Potion", "null")
new_item.position = position
call_deferred("remove_child", chest)
call_deferred("add_child", new_item)


func _on_Dungeon_body_exited(body):
if body.name == 'Player':
$Player.is_active = false
$Player/HUD/EndMessage.text = "You Win"
$Player/HUD/RestartButton.visible = true
$Player/HUD/EndMessage.visible = true
119 changes: 69 additions & 50 deletions project/src/Level.tscn

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions project/src/Player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,14 @@ 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()
72 changes: 61 additions & 11 deletions project/src/Player.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=12 format=2]
[gd_scene load_steps=18 format=2]

[ext_resource path="res://src/Player.gd" type="Script" id=1]
[ext_resource path="res://assets/Player/walk.png" type="Texture" id=2]
Expand All @@ -12,16 +12,6 @@

[sub_resource type="SpriteFrames" id=1]
animations = [ {
"frames": [ ExtResource( 3 ) ],
"loop": true,
"name": "idle",
"speed": 5.0
}, {
"frames": [ ExtResource( 5 ) ],
"loop": true,
"name": "killed",
"speed": 0.5
}, {
"frames": [ ExtResource( 6 ) ],
"loop": true,
"name": "attack",
Expand All @@ -36,12 +26,45 @@ animations = [ {
"loop": true,
"name": "walk",
"speed": 5.0
}, {
"frames": [ ExtResource( 5 ) ],
"loop": true,
"name": "killed",
"speed": 0.5
}, {
"frames": [ ExtResource( 3 ) ],
"loop": true,
"name": "idle",
"speed": 5.0
} ]

[sub_resource type="CapsuleShape2D" id=2]
radius = 28.9106
height = 13.416

[sub_resource type="StyleBoxFlat" id=3]
bg_color = Color( 0.6, 0.6, 0.6, 0 )
border_color = Color( 0.8, 0.8, 0.8, 0 )

[sub_resource type="StyleBoxFlat" id=9]
bg_color = Color( 0.6, 0.6, 0.6, 0 )
border_color = Color( 0.8, 0.8, 0.8, 0 )

[sub_resource type="StyleBoxFlat" id=4]
bg_color = Color( 0.6, 0.6, 0.6, 0 )
border_color = Color( 0.8, 0.8, 0.8, 0 )

[sub_resource type="StyleBoxFlat" id=7]
bg_color = Color( 0.6, 0.6, 0.6, 0 )
border_color = Color( 0.8, 0.8, 0.8, 0 )

[sub_resource type="StyleBoxFlat" id=8]
bg_color = Color( 0.6, 0.6, 0.6, 0 )
border_color = Color( 0.8, 0.8, 0.8, 0 )

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

[node name="Player" type="KinematicBody2D"]
z_index = 2
script = ExtResource( 1 )
Expand Down Expand Up @@ -70,4 +93,31 @@ margin_top = -300.507
margin_right = -501.347
margin_bottom = -300.507

[node name="InventoryButton" type="Button" parent="."]
margin_left = -440.0
margin_top = -256.0
margin_right = -383.0
margin_bottom = -203.0
custom_styles/hover = SubResource( 3 )
custom_styles/pressed = SubResource( 9 )
custom_styles/normal = SubResource( 4 )
toggle_mode = true
__meta__ = {
"_edit_use_anchors_": false
}

[node name="WeaponButton" type="Button" parent="."]
margin_left = 240.0
margin_top = 152.0
margin_right = 454.0
margin_bottom = 242.0
custom_styles/hover = SubResource( 7 )
custom_styles/pressed = SubResource( 8 )
custom_styles/normal = SubResource( 6 )
__meta__ = {
"_edit_use_anchors_": false
}

[connection signal="animation_finished" from="AnimatedSprite" to="." method="_on_AnimatedSprite_animation_finished"]
[connection signal="toggled" from="InventoryButton" to="." method="_on_InventoryButton_toggled"]
[connection signal="pressed" from="WeaponButton" to="." method="_on_WeaponButton_pressed"]
4 changes: 4 additions & 0 deletions project/src/TitleScreen.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ extends Node2D

func _on_StartButton_pressed():
var _ignored = get_tree().change_scene("res://src/Level.tscn")


func _on_Instructions_pressed():
$InstructionsPopup.popup()
Loading

0 comments on commit d3f857e

Please sign in to comment.