Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth
This commit is contained in:
commit
51a5418c82
20 changed files with 216 additions and 12 deletions
BIN
enemies/ghost animation/Ghost 1.png
Normal file
BIN
enemies/ghost animation/Ghost 1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
34
enemies/ghost animation/Ghost 1.png.import
Normal file
34
enemies/ghost animation/Ghost 1.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://d3b5hmhjw2jyc"
|
||||
path="res://.godot/imported/Ghost 1.png-43131954ed622829dc5453ddf6a96b4c.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://enemies/ghost animation/Ghost 1.png"
|
||||
dest_files=["res://.godot/imported/Ghost 1.png-43131954ed622829dc5453ddf6a96b4c.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
BIN
enemies/ghost animation/Ghost 2.png
Normal file
BIN
enemies/ghost animation/Ghost 2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
34
enemies/ghost animation/Ghost 2.png.import
Normal file
34
enemies/ghost animation/Ghost 2.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dfhxhum8lek56"
|
||||
path="res://.godot/imported/Ghost 2.png-67077adaa01a71a5c0b85fac254bdf8e.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://enemies/ghost animation/Ghost 2.png"
|
||||
dest_files=["res://.godot/imported/Ghost 2.png-67077adaa01a71a5c0b85fac254bdf8e.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
BIN
enemies/ghost animation/Ghost 3.png
Normal file
BIN
enemies/ghost animation/Ghost 3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
34
enemies/ghost animation/Ghost 3.png.import
Normal file
34
enemies/ghost animation/Ghost 3.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ve5px6ib45g"
|
||||
path="res://.godot/imported/Ghost 3.png-18da238556f83c92715d2db31a14d159.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://enemies/ghost animation/Ghost 3.png"
|
||||
dest_files=["res://.godot/imported/Ghost 3.png-18da238556f83c92715d2db31a14d159.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
BIN
enemies/ghost animation/Ghost 4.png
Normal file
BIN
enemies/ghost animation/Ghost 4.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
34
enemies/ghost animation/Ghost 4.png.import
Normal file
34
enemies/ghost animation/Ghost 4.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cmg8yws3gwx6u"
|
||||
path="res://.godot/imported/Ghost 4.png-45ba6df3ef207a5eff72f5f0036139d6.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://enemies/ghost animation/Ghost 4.png"
|
||||
dest_files=["res://.godot/imported/Ghost 4.png-45ba6df3ef207a5eff72f5f0036139d6.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
BIN
enemies/ghost animation/Ghost 5.png
Normal file
BIN
enemies/ghost animation/Ghost 5.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
34
enemies/ghost animation/Ghost 5.png.import
Normal file
34
enemies/ghost animation/Ghost 5.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bs3lt13umfxu8"
|
||||
path="res://.godot/imported/Ghost 5.png-08f0125e59cfd0173a5d36d75efeae60.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://enemies/ghost animation/Ghost 5.png"
|
||||
dest_files=["res://.godot/imported/Ghost 5.png-08f0125e59cfd0173a5d36d75efeae60.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
[ext_resource type="Script" uid="uid://12jns4dppxxj" path="res://enemies/ghost.gd" id="1_6attn"]
|
||||
[ext_resource type="PackedScene" uid="uid://mtfsdd4cdf3a" path="res://utils/enemy_hurtbox.tscn" id="2_34o1m"]
|
||||
[ext_resource type="Texture2D" uid="uid://cy70quh6k3s1j" path="res://icon.svg" id="2_obmiq"]
|
||||
[ext_resource type="Texture2D" uid="uid://d3b5hmhjw2jyc" path="res://enemies/ghost animation/Ghost 1.png" id="3_34o1m"]
|
||||
[ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="3_obmiq"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_6attn"]
|
||||
|
|
@ -22,7 +22,7 @@ scale = Vector2(6, 6)
|
|||
shape = SubResource("CircleShape2D_6attn")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("2_obmiq")
|
||||
texture = ExtResource("3_34o1m")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
scale = Vector2(6, 6)
|
||||
|
|
|
|||
9
item_ui/item_ui.gd
Normal file
9
item_ui/item_ui.gd
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
extends MarginContainer
|
||||
|
||||
@export var player : Player;
|
||||
|
||||
func _on_player_active_item_changed(newitem: ActiveItem) -> void:
|
||||
%ItemTexture.texture = newitem.sprite
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
player
|
||||
1
item_ui/item_ui.gd.uid
Normal file
1
item_ui/item_ui.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://eusti457vwq1
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://73g8y37skebh"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cy70quh6k3s1j" path="res://icon.svg" id="1_lfuq2"]
|
||||
[ext_resource type="Script" uid="uid://eusti457vwq1" path="res://item_ui/item_ui.gd" id="1_lfuq2"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8oq0s"]
|
||||
draw_center = false
|
||||
|
|
@ -26,12 +26,13 @@ theme_override_constants/margin_left = 25
|
|||
theme_override_constants/margin_top = 25
|
||||
theme_override_constants/margin_right = 25
|
||||
theme_override_constants/margin_bottom = 25
|
||||
script = ExtResource("1_lfuq2")
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_8oq0s")
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="PanelContainer"]
|
||||
[node name="ItemTexture" type="TextureRect" parent="PanelContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
texture = ExtResource("1_lfuq2")
|
||||
expand_mode = 1
|
||||
|
|
|
|||
|
|
@ -1,7 +1,14 @@
|
|||
class_name ActiveItem extends Item
|
||||
|
||||
@export var sprite : Texture2D
|
||||
|
||||
func collect() -> bool:
|
||||
if (player.active_item == null):
|
||||
player.active_item = self
|
||||
return true
|
||||
return false
|
||||
|
||||
func activate():
|
||||
assert(false)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://ewe36lqcjojk"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bbwsc2a2hd0ow" path="res://items/updash.gd" id="1_ghbl6"]
|
||||
[ext_resource type="Script" path="res://items/updash.gd" id="1_ghbl6"]
|
||||
[ext_resource type="Texture2D" uid="uid://cy70quh6k3s1j" path="res://icon.svg" id="1_ptc3l"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_ghbl6"]
|
||||
|
||||
[node name="Updash" type="Area2D"]
|
||||
script = ExtResource("1_ghbl6")
|
||||
sprite = ExtResource("1_ptc3l")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
scale = Vector2(3, 3)
|
||||
|
|
|
|||
|
|
@ -48,11 +48,13 @@ autostart = true
|
|||
offset_right = 128.0
|
||||
offset_bottom = 128.0
|
||||
|
||||
[node name="ItemUI" parent="CanvasLayer" instance=ExtResource("6_4c57u")]
|
||||
[node name="ItemUI" parent="CanvasLayer" node_paths=PackedStringArray("player") instance=ExtResource("6_4c57u")]
|
||||
player = NodePath("../../Player")
|
||||
|
||||
[node name="DeathScreen" parent="CanvasLayer" instance=ExtResource("7_5vw27")]
|
||||
visible = false
|
||||
|
||||
[connection signal="active_item_changed" from="Player" to="CanvasLayer/ItemUI" method="_on_player_active_item_changed"]
|
||||
[connection signal="health_changed" from="Player" to="CanvasLayer/Healthbar" method="_on_player_health_changed"]
|
||||
[connection signal="max_hp_changed" from="Player" to="CanvasLayer/Healthbar" method="_on_player_max_hp_changed"]
|
||||
[connection signal="player_died" from="Player" to="CanvasLayer/DeathScreen" method="_on_player_player_died"]
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
extends CharacterBody2D
|
||||
class_name Player extends CharacterBody2D
|
||||
# Child Nodes
|
||||
@onready var camera : Camera2D = $Camera2D;
|
||||
@onready var anim_sprite : AnimatedSprite2D = $AnimatedSprite2D;
|
||||
@onready var earth_aligner : Node2D = $EarthAligner;
|
||||
@onready var sword : Area2D = $Sword;
|
||||
@onready var active_item_cooldown : Timer = $ActiveItemCooldown
|
||||
|
||||
# allow taking away player control
|
||||
var handle_input : bool = true
|
||||
|
|
@ -47,8 +48,12 @@ var atk_cooldown = 0.5
|
|||
var atk_timer = 0
|
||||
|
||||
# Active Item
|
||||
var active_item = null
|
||||
var item_cooldown = 0
|
||||
signal active_item_changed(newitem : Item)
|
||||
var active_item : ActiveItem = null:
|
||||
set(new_active_item):
|
||||
active_item = new_active_item
|
||||
active_item_changed.emit(active_item)
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
max_hp_changed.emit(max_hp)
|
||||
|
|
@ -75,8 +80,8 @@ func manage_attack(delta : float):
|
|||
atk_timer = atk_cooldown
|
||||
|
||||
func manage_active(delta : float):
|
||||
item_cooldown = max(item_cooldown - delta, 0)
|
||||
if(active_item != null and Input.is_action_just_pressed("item") and item_cooldown <= 0):
|
||||
# item_cooldown = max(item_cooldown - delta, 0)
|
||||
if(active_item != null and Input.is_action_just_pressed("item") and active_item_cooldown.is_stopped()):
|
||||
active_item.activate()
|
||||
|
||||
func manage_movement_options() -> void:
|
||||
|
|
|
|||
|
|
@ -58,3 +58,6 @@ frame_progress = 0.433977
|
|||
[node name="EarthAligner" parent="." instance=ExtResource("3_i3pqv")]
|
||||
|
||||
[node name="Sword" parent="." instance=ExtResource("4_yw30f")]
|
||||
|
||||
[node name="ActiveItemCooldown" type="Timer" parent="."]
|
||||
one_shot = true
|
||||
|
|
|
|||
|
|
@ -26,11 +26,13 @@ window/size/mode=3
|
|||
move_right={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
move_left={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
jump={
|
||||
|
|
@ -41,16 +43,19 @@ jump={
|
|||
attack={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":67,"key_label":0,"unicode":99,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":1,"position":Vector2(356, 29),"global_position":Vector2(365, 77),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":null)
|
||||
]
|
||||
}
|
||||
drop={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
item={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":88,"key_label":0,"unicode":120,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":2,"position":Vector2(297, 25),"global_position":Vector2(306, 73),"factor":1.0,"button_index":2,"canceled":false,"pressed":true,"double_click":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue