diff options
author | Marcelo Costa <marcardion@gmail.com> | 2024-01-26 23:39:05 -0300 |
---|---|---|
committer | Marcelo Costa <marcardion@gmail.com> | 2024-01-26 23:39:05 -0300 |
commit | 620fba1078b9d65eaca10cf1ab90579ab70cb772 (patch) | |
tree | 59506e4d11ae681cd565d88268b23abf7036ca10 | |
parent | d23ec4f11ffec4892d18ed07f360ed45b0c52dbc (diff) | |
download | gamejam-ggj-2024-620fba1078b9d65eaca10cf1ab90579ab70cb772.tar.gz gamejam-ggj-2024-620fba1078b9d65eaca10cf1ab90579ab70cb772.tar.bz2 gamejam-ggj-2024-620fba1078b9d65eaca10cf1ab90579ab70cb772.zip |
Revert "Revert "Starting HeartBreak Microgame""
This reverts commit d23ec4f11ffec4892d18ed07f360ed45b0c52dbc.
-rw-r--r-- | game/microgames/heart_break/assets/GGJ_Heart-Sheet.png (renamed from game/shared/assets/GGJ_Heart-Sheet.png) | bin | 20020 -> 20020 bytes | |||
-rw-r--r-- | game/microgames/heart_break/assets/GGJ_Heart-Sheet.png.import (renamed from game/shared/assets/GGJ_Heart-Sheet.png.import) | 6 | ||||
-rw-r--r-- | game/microgames/heart_break/assets/heart_animation.tres (renamed from game/shared/characters/heart_animation.tres) | 20 | ||||
-rw-r--r-- | game/microgames/heart_break/heart_break.gd | 18 | ||||
-rw-r--r-- | game/microgames/heart_break/heart_break.tscn | 57 | ||||
-rw-r--r-- | game/microgames/heart_break/player_heart.gd | 15 | ||||
-rw-r--r-- | game/microgames/heart_break/player_heart.tscn | 22 | ||||
-rw-r--r-- | game/microgames/heart_break/spiky.gd | 11 | ||||
-rw-r--r-- | game/microgames/heart_break/spiky.tscn | 22 | ||||
-rw-r--r-- | game/shared/characters/character_animation.tscn | 3 | ||||
-rw-r--r-- | project.godot | 27 |
11 files changed, 193 insertions, 8 deletions
diff --git a/game/shared/assets/GGJ_Heart-Sheet.png b/game/microgames/heart_break/assets/GGJ_Heart-Sheet.png Binary files differindex 42e6216..42e6216 100644 --- a/game/shared/assets/GGJ_Heart-Sheet.png +++ b/game/microgames/heart_break/assets/GGJ_Heart-Sheet.png diff --git a/game/shared/assets/GGJ_Heart-Sheet.png.import b/game/microgames/heart_break/assets/GGJ_Heart-Sheet.png.import index d2d8671..df05837 100644 --- a/game/shared/assets/GGJ_Heart-Sheet.png.import +++ b/game/microgames/heart_break/assets/GGJ_Heart-Sheet.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://bn4ogu386cfsa" -path="res://.godot/imported/GGJ_Heart-Sheet.png-1b22dd03d8ebc1bb69e1fa37955fcecc.ctex" +path="res://.godot/imported/GGJ_Heart-Sheet.png-d450bea318970c61f802de4c0e4039ea.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://game/shared/assets/GGJ_Heart-Sheet.png" -dest_files=["res://.godot/imported/GGJ_Heart-Sheet.png-1b22dd03d8ebc1bb69e1fa37955fcecc.ctex"] +source_file="res://game/microgames/heart_break/assets/GGJ_Heart-Sheet.png" +dest_files=["res://.godot/imported/GGJ_Heart-Sheet.png-d450bea318970c61f802de4c0e4039ea.ctex"] [params] diff --git a/game/shared/characters/heart_animation.tres b/game/microgames/heart_break/assets/heart_animation.tres index be1cfe1..a1d43fe 100644 --- a/game/shared/characters/heart_animation.tres +++ b/game/microgames/heart_break/assets/heart_animation.tres @@ -1,19 +1,31 @@ -[gd_resource type="SpriteFrames" load_steps=4 format=3 uid="uid://c5j2ojumuirph"] +[gd_resource type="SpriteFrames" load_steps=5 format=3 uid="uid://c5j2ojumuirph"] -[ext_resource type="Texture2D" uid="uid://bn4ogu386cfsa" path="res://game/shared/assets/GGJ_Heart-Sheet.png" id="1_8nbnc"] +[ext_resource type="Texture2D" uid="uid://bn4ogu386cfsa" path="res://game/microgames/heart_break/assets/GGJ_Heart-Sheet.png" id="1_bi62t"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_vjtln"] +atlas = ExtResource("1_bi62t") +region = Rect2(512, 0, 256, 256) [sub_resource type="AtlasTexture" id="AtlasTexture_xa2t5"] -atlas = ExtResource("1_8nbnc") +atlas = ExtResource("1_bi62t") region = Rect2(0, 0, 256, 256) [sub_resource type="AtlasTexture" id="AtlasTexture_hl0ht"] -atlas = ExtResource("1_8nbnc") +atlas = ExtResource("1_bi62t") region = Rect2(256, 0, 256, 256) [resource] animations = [{ "frames": [{ "duration": 1.0, +"texture": SubResource("AtlasTexture_vjtln") +}], +"loop": true, +"name": &"death", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, "texture": SubResource("AtlasTexture_xa2t5") }, { "duration": 1.0, diff --git a/game/microgames/heart_break/heart_break.gd b/game/microgames/heart_break/heart_break.gd new file mode 100644 index 0000000..b12ae70 --- /dev/null +++ b/game/microgames/heart_break/heart_break.gd @@ -0,0 +1,18 @@ +extends Microgame + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass + +func _on_player_heart_body_entered(body): + if body is Spiky: + print("hey") + $PlayerHeart.get_node("AnimatedSprite2D").play("death") + ## GameOver + pass diff --git a/game/microgames/heart_break/heart_break.tscn b/game/microgames/heart_break/heart_break.tscn new file mode 100644 index 0000000..68bec77 --- /dev/null +++ b/game/microgames/heart_break/heart_break.tscn @@ -0,0 +1,57 @@ +[gd_scene load_steps=6 format=3 uid="uid://b18b72hhe1lbo"] + +[ext_resource type="Script" path="res://game/microgames/heart_break/heart_break.gd" id="1_ia77r"] +[ext_resource type="PackedScene" uid="uid://ce7600yfkpdbq" path="res://game/microgames/heart_break/player_heart.tscn" id="2_uwtaj"] +[ext_resource type="PackedScene" uid="uid://shdrrjh51igy" path="res://game/microgames/heart_break/spiky.tscn" id="3_dfa23"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_upktn"] +size = Vector2(1168, 20) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_y3mqx"] +size = Vector2(20, 676) + +[node name="HeartBreak" type="Node"] +script = ExtResource("1_ia77r") + +[node name="PlayerHeart" parent="." instance=ExtResource("2_uwtaj")] +position = Vector2(553, 317) + +[node name="Upper Boundary" type="StaticBody2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Upper Boundary"] +position = Vector2(574, 0) +shape = SubResource("RectangleShape2D_upktn") + +[node name="Left Boundary" type="StaticBody2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Left Boundary"] +position = Vector2(0, 328) +shape = SubResource("RectangleShape2D_y3mqx") + +[node name="Left Boundary2" type="StaticBody2D" parent="."] +position = Vector2(1161, 0) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Left Boundary2"] +position = Vector2(0, 328) +shape = SubResource("RectangleShape2D_y3mqx") + +[node name="Lower Boundary" type="StaticBody2D" parent="."] +position = Vector2(0, 656) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Lower Boundary"] +position = Vector2(574, 0) +shape = SubResource("RectangleShape2D_upktn") + +[node name="Spiky" parent="." instance=ExtResource("3_dfa23")] +position = Vector2(182, 188) + +[node name="Spiky2" parent="." instance=ExtResource("3_dfa23")] +position = Vector2(964, 218) + +[node name="Spiky3" parent="." instance=ExtResource("3_dfa23")] +position = Vector2(235, 481) + +[node name="Spiky4" parent="." instance=ExtResource("3_dfa23")] +position = Vector2(845, 496) + +[connection signal="body_entered" from="PlayerHeart" to="." method="_on_player_heart_body_entered"] diff --git a/game/microgames/heart_break/player_heart.gd b/game/microgames/heart_break/player_heart.gd new file mode 100644 index 0000000..565cee1 --- /dev/null +++ b/game/microgames/heart_break/player_heart.gd @@ -0,0 +1,15 @@ +extends RigidBody2D + +var speed = 250 + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _physics_process(delta): + var moveVector = Vector2(Input.get_axis("Left","Right")*speed, Input.get_axis("Up","Down")*speed) + apply_force(moveVector) + #set_axis_velocity(moveVector) + pass diff --git a/game/microgames/heart_break/player_heart.tscn b/game/microgames/heart_break/player_heart.tscn new file mode 100644 index 0000000..539dd4f --- /dev/null +++ b/game/microgames/heart_break/player_heart.tscn @@ -0,0 +1,22 @@ +[gd_scene load_steps=4 format=3 uid="uid://ce7600yfkpdbq"] + +[ext_resource type="Script" path="res://game/microgames/heart_break/player_heart.gd" id="1_e40wj"] +[ext_resource type="SpriteFrames" uid="uid://c5j2ojumuirph" path="res://game/microgames/heart_break/assets/heart_animation.tres" id="1_koysl"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_sp11c"] +radius = 52.469 + +[node name="PlayerHeart" type="RigidBody2D"] +gravity_scale = 0.0 +can_sleep = false +max_contacts_reported = 10 +contact_monitor = true +script = ExtResource("1_e40wj") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +position = Vector2(-5, 14) +sprite_frames = ExtResource("1_koysl") +autoplay = "default" + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("CircleShape2D_sp11c") diff --git a/game/microgames/heart_break/spiky.gd b/game/microgames/heart_break/spiky.gd new file mode 100644 index 0000000..3fa5983 --- /dev/null +++ b/game/microgames/heart_break/spiky.gd @@ -0,0 +1,11 @@ +extends RigidBody2D +class_name Spiky + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass diff --git a/game/microgames/heart_break/spiky.tscn b/game/microgames/heart_break/spiky.tscn new file mode 100644 index 0000000..267dc26 --- /dev/null +++ b/game/microgames/heart_break/spiky.tscn @@ -0,0 +1,22 @@ +[gd_scene load_steps=4 format=3 uid="uid://shdrrjh51igy"] + +[ext_resource type="Script" path="res://game/microgames/heart_break/spiky.gd" id="1_fx3ld"] +[ext_resource type="Texture2D" uid="uid://bn4ogu386cfsa" path="res://game/microgames/heart_break/assets/GGJ_Heart-Sheet.png" id="1_ig6xt"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_1xy8p"] +size = Vector2(96.5, 90) + +[node name="Spiky" type="RigidBody2D"] +gravity_scale = 0.0 +script = ExtResource("1_fx3ld") + +[node name="Sprite2D" type="Sprite2D" parent="."] +scale = Vector2(0.5, 0.5) +texture = ExtResource("1_ig6xt") +hframes = 4 +vframes = 2 +frame = 5 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(3.75, -1) +shape = SubResource("RectangleShape2D_1xy8p") diff --git a/game/shared/characters/character_animation.tscn b/game/shared/characters/character_animation.tscn index 6e74c4e..04ddb12 100644 --- a/game/shared/characters/character_animation.tscn +++ b/game/shared/characters/character_animation.tscn @@ -1,6 +1,7 @@ [gd_scene load_steps=2 format=3 uid="uid://k0mx61qjphst"] -[ext_resource type="SpriteFrames" uid="uid://c5j2ojumuirph" path="res://game/shared/characters/heart_animation.tres" id="1_utnrb"] +[ext_resource type="SpriteFrames" uid="uid://c5j2ojumuirph" path="res://game/microgames/heart_break/assets/heart_animation.tres" id="1_utnrb"] + [node name="CharacterAnimation" type="Node2D"] diff --git a/project.godot b/project.godot index 0f4f25c..9ef6cbd 100644 --- a/project.godot +++ b/project.godot @@ -16,3 +16,30 @@ config/features=PackedStringArray("4.2") [display] window/stretch/mode="viewport" + +[input] + +Left={ +"deadzone": 0.5, +"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,"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,"echo":false,"script":null) +] +} +Right={ +"deadzone": 0.5, +"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,"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,"echo":false,"script":null) +] +} +Up={ +"deadzone": 0.5, +"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":4194320,"key_label":0,"unicode":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":87,"key_label":0,"unicode":119,"echo":false,"script":null) +] +} +Down={ +"deadzone": 0.5, +"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":83,"key_label":0,"unicode":115,"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":4194322,"key_label":0,"unicode":0,"echo":false,"script":null) +] +} |