diff options
Diffstat (limited to 'game/microgames/heart_break')
-rw-r--r-- | game/microgames/heart_break/assets/GGJ_Heart-Sheet.png | bin | 0 -> 20020 bytes | |||
-rw-r--r-- | game/microgames/heart_break/assets/GGJ_Heart-Sheet.png.import | 34 | ||||
-rw-r--r-- | game/microgames/heart_break/assets/heart_animation.tres | 37 | ||||
-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 |
9 files changed, 216 insertions, 0 deletions
diff --git a/game/microgames/heart_break/assets/GGJ_Heart-Sheet.png b/game/microgames/heart_break/assets/GGJ_Heart-Sheet.png Binary files differnew file mode 100644 index 0000000..42e6216 --- /dev/null +++ b/game/microgames/heart_break/assets/GGJ_Heart-Sheet.png diff --git a/game/microgames/heart_break/assets/GGJ_Heart-Sheet.png.import b/game/microgames/heart_break/assets/GGJ_Heart-Sheet.png.import new file mode 100644 index 0000000..df05837 --- /dev/null +++ b/game/microgames/heart_break/assets/GGJ_Heart-Sheet.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bn4ogu386cfsa" +path="res://.godot/imported/GGJ_Heart-Sheet.png-d450bea318970c61f802de4c0e4039ea.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://game/microgames/heart_break/assets/GGJ_Heart-Sheet.png" +dest_files=["res://.godot/imported/GGJ_Heart-Sheet.png-d450bea318970c61f802de4c0e4039ea.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 diff --git a/game/microgames/heart_break/assets/heart_animation.tres b/game/microgames/heart_break/assets/heart_animation.tres new file mode 100644 index 0000000..a1d43fe --- /dev/null +++ b/game/microgames/heart_break/assets/heart_animation.tres @@ -0,0 +1,37 @@ +[gd_resource type="SpriteFrames" load_steps=5 format=3 uid="uid://c5j2ojumuirph"] + +[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_bi62t") +region = Rect2(0, 0, 256, 256) + +[sub_resource type="AtlasTexture" id="AtlasTexture_hl0ht"] +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, +"texture": SubResource("AtlasTexture_hl0ht") +}], +"loop": true, +"name": &"default", +"speed": 3.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") |