Skip to content

Commit

Permalink
shatter on gameover
Browse files Browse the repository at this point in the history
  • Loading branch information
myin142 committed Oct 21, 2023
1 parent c7ea462 commit 94a6e80
Show file tree
Hide file tree
Showing 13 changed files with 308 additions and 75 deletions.
10 changes: 10 additions & 0 deletions godot/src/Enemy.gd
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
extends CharacterBody2D

signal died()

@export var speed := 50
@export var health := 10

@onready var navigation_agent := $NavigationAgent2D

Expand All @@ -24,3 +27,10 @@ func _physics_process(delta):

velocity = new_velocity
move_and_slide()


func _on_hitbox_hit(dmg):
health -= dmg
if health <= 0:
died.emit()
queue_free()
7 changes: 7 additions & 0 deletions godot/src/character/Hitbox.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class_name Hitbox
extends Area2D

signal hit(dmg)

func damage(dmg: int):
hit.emit(dmg)
36 changes: 36 additions & 0 deletions godot/src/character/enemy.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[gd_scene load_steps=6 format=3 uid="uid://mt5fy2ohtmg5"]

[ext_resource type="Script" path="res://src/Enemy.gd" id="1_xsn24"]
[ext_resource type="Texture2D" uid="uid://bwve2nq30wldn" path="res://icon.svg" id="2_s6l7m"]
[ext_resource type="Script" path="res://src/character/Hitbox.gd" id="3_dexve"]

[sub_resource type="RectangleShape2D" id="RectangleShape2D_0wd2x"]
size = Vector2(10, 10)

[sub_resource type="RectangleShape2D" id="RectangleShape2D_5khei"]
size = Vector2(12, 12)

[node name="Enemy" type="CharacterBody2D"]
collision_layer = 4
collision_mask = 0
script = ExtResource("1_xsn24")

[node name="Sprite2D" type="Sprite2D" parent="."]
modulate = Color(1, 0.490196, 0.490196, 1)
scale = Vector2(0.078125, 0.078125)
texture = ExtResource("2_s6l7m")

[node name="NavigationAgent2D" type="NavigationAgent2D" parent="."]

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_0wd2x")

[node name="Hitbox" type="Area2D" parent="."]
collision_layer = 16
collision_mask = 0
script = ExtResource("3_dexve")

[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
shape = SubResource("RectangleShape2D_5khei")

[connection signal="hit" from="Hitbox" to="." method="_on_hitbox_hit"]
50 changes: 50 additions & 0 deletions godot/src/character/player.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[gd_scene load_steps=8 format=3 uid="uid://dlby6flxkmnjs"]

[ext_resource type="Script" path="res://src/player.gd" id="1_356t7"]
[ext_resource type="PackedScene" uid="uid://h5rba01pdi3f" path="res://src/props/projectile.tscn" id="2_yssxu"]
[ext_resource type="Texture2D" uid="uid://bwve2nq30wldn" path="res://icon.svg" id="3_h74si"]
[ext_resource type="Script" path="res://addons/input-system/PlayerInput.gd" id="4_0sora"]
[ext_resource type="Script" path="res://src/character/Hitbox.gd" id="5_dpg7u"]

[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_dgu6m"]
radius = 2.0
height = 16.0

[sub_resource type="RectangleShape2D" id="RectangleShape2D_vssjf"]
size = Vector2(14, 14)

[node name="Player" type="CharacterBody2D" groups=["Player"]]
collision_layer = 2
script = ExtResource("1_356t7")
projectile_scene = ExtResource("2_yssxu")

[node name="Icon" type="Sprite2D" parent="."]
scale = Vector2(0.125, 0.125)
texture = ExtResource("3_h74si")

[node name="Input" type="Node" parent="."]
script = ExtResource("4_0sora")

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 6)
rotation = 1.5708
shape = SubResource("CapsuleShape2D_dgu6m")

[node name="Hand" type="Node2D" parent="."]

[node name="ShotPoint" type="Marker2D" parent="Hand"]
position = Vector2(16, 0)

[node name="Sprite2D" type="Sprite2D" parent="Hand/ShotPoint"]
scale = Vector2(0.03125, 0.03125)
texture = ExtResource("3_h74si")

[node name="Hitbox" type="Area2D" parent="."]
collision_layer = 8
collision_mask = 0
script = ExtResource("5_dpg7u")

[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
shape = SubResource("RectangleShape2D_vssjf")

[connection signal="hit" from="Hitbox" to="." method="_on_hitbox_hit"]
26 changes: 26 additions & 0 deletions godot/src/game.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
extends Node2D

const SHARD_EMITTER = preload("res://src/props/shard_emitter.tscn")

@onready var main = $Main
@onready var death_screen = $DeathScreen

func _ready():
death_screen.hide()

func _on_player_died():
main.process_mode = Node.PROCESS_MODE_DISABLED

var window_scale = get_viewport_rect().size / Vector2(get_window().size)
var tex_scale = max(window_scale.x, window_scale.y)

var img = get_viewport().get_texture().get_image()
var tex = ImageTexture.create_from_image(img)
death_screen.texture = tex
death_screen.scale = Vector2(tex_scale, tex_scale)
death_screen.show()
main.hide()

var shard = SHARD_EMITTER.instantiate()
death_screen.add_child(shard)
get_tree().create_timer(1.0).timeout.connect(func(): shard.shatter())
105 changes: 31 additions & 74 deletions godot/src/game.tscn
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
[gd_scene load_steps=34 format=3 uid="uid://di8g8e6s34cik"]
[gd_scene load_steps=29 format=3 uid="uid://di8g8e6s34cik"]

[ext_resource type="Shader" path="res://src/tile_mirror.gdshader" id="1_atk3l"]
[ext_resource type="Script" path="res://src/game.gd" id="1_fscq0"]
[ext_resource type="Texture2D" uid="uid://vdsf1wra5c5b" path="res://assets/dungeon/Set 1.png" id="1_m7630"]
[ext_resource type="Texture2D" uid="uid://bwve2nq30wldn" path="res://icon.svg" id="2_58mfa"]
[ext_resource type="Script" path="res://src/player.gd" id="5_0tmg6"]
[ext_resource type="PackedScene" uid="uid://tiykwg5o8806" path="res://src/props/mirror.tscn" id="5_ojmwg"]
[ext_resource type="PackedScene" uid="uid://h5rba01pdi3f" path="res://src/props/projectile.tscn" id="6_bcm1c"]
[ext_resource type="Script" path="res://addons/input-system/PlayerInput.gd" id="7_551oe"]
[ext_resource type="Script" path="res://src/Enemy.gd" id="8_3lsk6"]
[ext_resource type="PackedScene" uid="uid://dlby6flxkmnjs" path="res://src/character/player.tscn" id="6_2xq02"]
[ext_resource type="Texture2D" uid="uid://dsjqkag1nk0b7" path="res://assets/DoorVertical.png" id="8_50fra"]
[ext_resource type="Texture2D" uid="uid://dvbp02x8waica" path="res://assets/door.png" id="9_hni6l"]

Expand Down Expand Up @@ -1127,16 +1124,14 @@ size = Vector2(7, 47)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_qvrmu"]
size = Vector2(358, 10)

[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_dgu6m"]
radius = 2.0
height = 16.0
[node name="Game" type="Node2D"]
script = ExtResource("1_fscq0")

[sub_resource type="RectangleShape2D" id="RectangleShape2D_0wd2x"]
size = Vector2(10, 10)
[node name="Camera2D" type="Camera2D" parent="."]

[node name="Game" type="Node2D"]
[node name="Main" type="Node2D" parent="."]

[node name="TileMap" type="TileMap" parent="."]
[node name="TileMap" type="TileMap" parent="Main"]
material = SubResource("ShaderMaterial_rserg")
tile_set = SubResource("TileSet_k6e46")
format = 2
Expand All @@ -1151,116 +1146,78 @@ layer_1/y_sort_origin = 0
layer_1/z_index = -1
layer_1/tile_data = PackedInt32Array(0, 1048578, 13, 3, 1048578, 13, 4, 1048578, 13, 65533, 1048578, 13, 65529, 1048578, 13, 262152, 1048578, 13, 196616, 1048578, 13, 131080, 1048578, 13, 65544, 1048578, 13, 8, 1048578, 13, -65528, 1048578, 13, -131064, 1048578, 13, -196600, 1048578, 13, -262136, 1048578, 13, -327672, 1048578, 13, 262151, 1048578, 13, 196615, 1048578, 13, 131079, 1048578, 13, 65543, 1048578, 13, 7, 1048578, 13, -65529, 1048578, 13, -131065, 1048578, 13, -196601, 1048578, 13, -262137, 1048578, 13, -327673, 1048578, 13, 262150, 1048578, 13, 196614, 1048578, 13, 131078, 1048578, 13, 65542, 1048578, 13, 6, 1048578, 13, -65530, 1048578, 13, -131066, 1048578, 13, -196602, 1048578, 13, -262138, 1048578, 13, -327674, 1048578, 13, 262149, 1048578, 13, 196613, 1048578, 13, 131077, 1048578, 13, 65541, 1048578, 13, 5, 1048578, 13, -65531, 1048578, 13, -131067, 1048578, 13, -196603, 1048578, 13, -262139, 1048578, 13, -327675, 1048578, 13, 262148, 1048578, 13, 196612, 1048578, 13, 131076, 1048578, 13, 65540, 1048578, 13, -65532, 1048578, 13, -131068, 1048578, 13, -196604, 1048578, 13, -262140, 1048578, 13, -327676, 1048578, 13, 262147, 1048578, 13, 196611, 1048578, 13, 131075, 1048578, 13, 65539, 1048578, 13, -65533, 1048578, 13, -131069, 1048578, 13, -196605, 1048578, 13, -262141, 1048578, 13, -327677, 1048578, 13, 262146, 1048578, 13, 196610, 1048578, 13, 131074, 1048578, 13, 65538, 1048578, 13, 2, 1048578, 13, -65534, 1048578, 13, -131070, 1048578, 13, -196606, 1048578, 13, -262142, 1048578, 13, -327678, 1048578, 13, 262145, 1048578, 13, 196609, 1048578, 13, 131073, 1048578, 13, 65537, 1048578, 13, 1, 1048578, 13, -65535, 1048578, 13, -131071, 1048578, 13, -196607, 1048578, 13, -262143, 1048578, 13, -327679, 1048578, 13, 262144, 1048578, 13, 196608, 1048578, 13, 131072, 1048578, 13, 65536, 1048578, 13, -65536, 1048578, 13, -131072, 1048578, 13, -196608, 1048578, 13, -262144, 1048578, 13, -327680, 1048578, 13, 327679, 1048578, 13, 262143, 1048578, 13, 196607, 1048578, 13, 131071, 1048578, 13, 65535, 1048578, 13, -1, 1048578, 13, -65537, 1048578, 13, -131073, 1048578, 13, -196609, 1048578, 13, -262145, 1048578, 13, 327678, 1048578, 13, 262142, 1048578, 13, 196606, 1048578, 13, 131070, 1048578, 13, 65534, 1048578, 13, -2, 1048578, 13, -65538, 1048578, 13, -131074, 1048578, 13, -196610, 1048578, 13, -262146, 1048578, 13, 327677, 1048578, 13, 262141, 1048578, 13, 196605, 1048578, 13, 131069, 1048578, 13, -3, 1048578, 13, -65539, 1048578, 13, -131075, 1048578, 13, -196611, 1048578, 13, -262147, 1048578, 13, 327676, 1048578, 13, 262140, 1048578, 13, 196604, 1048578, 13, 131068, 1048578, 13, 65532, 1048578, 13, -4, 1048578, 13, -65540, 1048578, 13, -131076, 1048578, 13, -196612, 1048578, 13, -262148, 1048578, 13, 327675, 1048578, 13, 262139, 1048578, 13, 196603, 1048578, 13, 131067, 1048578, 13, 65531, 1048578, 13, -5, 1048578, 13, -65541, 1048578, 13, -131077, 1048578, 13, -196613, 1048578, 13, -262149, 1048578, 13, 327674, 1048578, 13, 262138, 1048578, 13, 196602, 1048578, 13, 131066, 1048578, 13, 65530, 1048578, 13, -6, 1048578, 13, -65542, 1048578, 13, -131078, 1048578, 13, -196614, 1048578, 13, -262150, 1048578, 13, 327673, 1048578, 13, 262137, 1048578, 13, 196601, 1048578, 13, 131065, 1048578, 13, -7, 1048578, 13, -65543, 1048578, 13, -131079, 1048578, 13, -196615, 1048578, 13, -262151, 1048578, 13, 327672, 1048578, 13, 262136, 1048578, 13, 196600, 1048578, 13, 131064, 1048578, 13, 65528, 1048578, 13, -8, 1048578, 13, -65544, 1048578, 13, -131080, 1048578, 13, -196616, 1048578, 13, -262152, 1048578, 13, 327671, 1048578, 13, 262135, 1048578, 13, 196599, 1048578, 13, 131063, 1048578, 13, 65527, 1048578, 13, -9, 1048578, 13, -65545, 1048578, 13, -131081, 1048578, 13, -196617, 1048578, 13, -262153, 1048578, 13, 327670, 1048578, 13, 262134, 1048578, 13, 196598, 1048578, 13, 131062, 1048578, 13, 65526, 1048578, 13, -10, 1048578, 13, -65546, 1048578, 13, -131082, 1048578, 13, -196618, 1048578, 13, -262154, 1048578, 13, 327690, 851970, 12, 262154, 851970, 12, 196618, 851970, 12, 131082, 851970, 12, -65526, 851970, 13, -196598, 851970, 12, -262134, 851970, 12, -327670, 851970, 12, -393206, 851970, 11, 327689, 1048578, 13, 262153, 1048578, 13, 196617, 1048578, 13, 131081, 1048578, 13, 65545, 1048578, 13, 9, 1048578, 13, -65527, 1048578, 13, -131063, 1048578, 13, -196599, 1048578, 13, -262135, 1048578, 13, -327671, 1048578, 13, -393207, 786434, 11, 327688, 1048578, 13, -393208, 786434, 11, 327687, 1048578, 13, -393209, 786434, 11, -393210, 786434, 11, -393211, 786434, 11, -393212, 786434, 11, -393213, 786434, 11, -393214, 786434, 11, 327681, 1048578, 13, -393215, 917506, 13, 327680, 1048578, 13, -393216, 851970, 14, 393215, 1048578, 13, -327681, 720898, 14, 393214, 1048578, 13, -327682, 983042, 13, 393213, 1048578, 13, -327683, 786434, 11, 393212, 1048578, 13, -327684, 786434, 11, 393211, 1048578, 13, -327685, 786434, 11, 393210, 1048578, 13, -327686, 786434, 11, 393209, 1048578, 13, -327687, 786434, 11, 393208, 1048578, 13, -327688, 786434, 11, 393207, 1048578, 13, -327689, 786434, 11, 393206, 1048578, 13, -327690, 786434, 11, 393205, 720898, 12, 327669, 720898, 12, 262133, 720898, 12, 196597, 720898, 12, 131061, 983042, 12, 65525, 720898, 14, -11, 720898, 13, -65547, 720898, 12, -131083, 720898, 12, -196619, 720898, 12, -262155, 720898, 12, -327691, 720898, 11, 12, 786434, 11, 11, 917506, 13, 65524, 983042, 13, 65523, 786434, 11, -458752, 851970, 12, -524288, 851970, 12, -589824, 851970, 12, -393217, 720898, 12, -458753, 720898, 12, -524289, 720898, 12, 524288, 851970, 12, 458752, 851970, 12, 393216, 917506, 12, 589823, 720898, 12, 524287, 720898, 12, 458751, 983042, 12, 65546, 917506, 12, 10, 851970, 14, -131062, 851970, 12, 327686, 1048578, 13, 327685, 1048578, 13, 327684, 1048578, 13, 327683, 1048578, 13, 327682, 1048578, 13)

[node name="DoorN" type="StaticBody2D" parent="TileMap"]
[node name="DoorN" type="StaticBody2D" parent="Main/TileMap"]
position = Vector2(0, -104)

[node name="Sprite2D" type="Sprite2D" parent="TileMap/DoorN"]
[node name="Sprite2D" type="Sprite2D" parent="Main/TileMap/DoorN"]
texture = ExtResource("9_hni6l")
hframes = 6
frame = 5

[node name="CollisionShape2D" type="CollisionShape2D" parent="TileMap/DoorN"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Main/TileMap/DoorN"]
position = Vector2(0, 0.5)
shape = SubResource("RectangleShape2D_lth1k")

[node name="DoorS" type="StaticBody2D" parent="TileMap"]
[node name="DoorS" type="StaticBody2D" parent="Main/TileMap"]
position = Vector2(0, 103)

[node name="Sprite2D" type="Sprite2D" parent="TileMap/DoorS"]
[node name="Sprite2D" type="Sprite2D" parent="Main/TileMap/DoorS"]
texture = ExtResource("9_hni6l")
hframes = 6
frame = 5

[node name="CollisionShape2D" type="CollisionShape2D" parent="TileMap/DoorS"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Main/TileMap/DoorS"]
shape = SubResource("RectangleShape2D_hll1h")

[node name="DoorW" type="StaticBody2D" parent="TileMap"]
[node name="DoorW" type="StaticBody2D" parent="Main/TileMap"]
position = Vector2(-179.5, 10.5)

[node name="Sprite2D" type="Sprite2D" parent="TileMap/DoorW"]
[node name="Sprite2D" type="Sprite2D" parent="Main/TileMap/DoorW"]
texture = ExtResource("8_50fra")
hframes = 6

[node name="CollisionShape2D" type="CollisionShape2D" parent="TileMap/DoorW"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Main/TileMap/DoorW"]
shape = SubResource("RectangleShape2D_niqj8")

[node name="DoorE" type="StaticBody2D" parent="TileMap"]
[node name="DoorE" type="StaticBody2D" parent="Main/TileMap"]
position = Vector2(179.5, 10.5)

[node name="Sprite2D" type="Sprite2D" parent="TileMap/DoorE"]
[node name="Sprite2D" type="Sprite2D" parent="Main/TileMap/DoorE"]
texture = ExtResource("8_50fra")
flip_h = true
hframes = 6

[node name="CollisionShape2D" type="CollisionShape2D" parent="TileMap/DoorE"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Main/TileMap/DoorE"]
shape = SubResource("RectangleShape2D_niqj8")

[node name="Mirror" parent="TileMap" instance=ExtResource("5_ojmwg")]
[node name="Mirror" parent="Main/TileMap" instance=ExtResource("5_ojmwg")]
position = Vector2(0, -102)

[node name="CollisionShape2D2" type="CollisionShape2D" parent="TileMap/Mirror"]
[node name="CollisionShape2D2" type="CollisionShape2D" parent="Main/TileMap/Mirror"]
shape = SubResource("RectangleShape2D_qvrmu")

[node name="Mirror3" parent="TileMap" instance=ExtResource("5_ojmwg")]
[node name="Mirror3" parent="Main/TileMap" instance=ExtResource("5_ojmwg")]
position = Vector2(0, 101)

[node name="CollisionShape2D2" type="CollisionShape2D" parent="TileMap/Mirror3"]
[node name="CollisionShape2D2" type="CollisionShape2D" parent="Main/TileMap/Mirror3"]
shape = SubResource("RectangleShape2D_qvrmu")

[node name="Mirror5" parent="TileMap" instance=ExtResource("5_ojmwg")]
[node name="Mirror5" parent="Main/TileMap" instance=ExtResource("5_ojmwg")]
position = Vector2(-182, 12)
rotation = 1.5708

[node name="CollisionShape2D2" type="CollisionShape2D" parent="TileMap/Mirror5"]
[node name="CollisionShape2D2" type="CollisionShape2D" parent="Main/TileMap/Mirror5"]
shape = SubResource("RectangleShape2D_qvrmu")

[node name="Mirror7" parent="TileMap" instance=ExtResource("5_ojmwg")]
[node name="Mirror7" parent="Main/TileMap" instance=ExtResource("5_ojmwg")]
position = Vector2(182, 11)
rotation = 1.5708

[node name="CollisionShape2D2" type="CollisionShape2D" parent="TileMap/Mirror7"]
[node name="CollisionShape2D2" type="CollisionShape2D" parent="Main/TileMap/Mirror7"]
shape = SubResource("RectangleShape2D_qvrmu")

[node name="Player" type="CharacterBody2D" parent="." groups=["Player"]]
collision_layer = 2
script = ExtResource("5_0tmg6")
projectile_scene = ExtResource("6_bcm1c")

[node name="Icon" type="Sprite2D" parent="Player"]
scale = Vector2(0.125, 0.125)
texture = ExtResource("2_58mfa")

[node name="Input" type="Node" parent="Player"]
script = ExtResource("7_551oe")

[node name="CollisionShape2D" type="CollisionShape2D" parent="Player"]
position = Vector2(0, 6)
rotation = 1.5708
shape = SubResource("CapsuleShape2D_dgu6m")

[node name="Hand" type="Node2D" parent="Player"]

[node name="ShotPoint" type="Marker2D" parent="Player/Hand"]
position = Vector2(16, 0)

[node name="Sprite2D" type="Sprite2D" parent="Player/Hand/ShotPoint"]
scale = Vector2(0.03125, 0.03125)
texture = ExtResource("2_58mfa")

[node name="Camera2D" type="Camera2D" parent="."]

[node name="Enemy" type="CharacterBody2D" parent="."]
position = Vector2(-99, 0)
collision_layer = 4
collision_mask = 0
script = ExtResource("8_3lsk6")

[node name="Sprite2D" type="Sprite2D" parent="Enemy"]
modulate = Color(1, 0.490196, 0.490196, 1)
scale = Vector2(0.078125, 0.078125)
texture = ExtResource("2_58mfa")
[node name="Player" parent="Main" instance=ExtResource("6_2xq02")]

[node name="NavigationAgent2D" type="NavigationAgent2D" parent="Enemy"]
[node name="DeathScreen" type="Sprite2D" parent="."]

[node name="CollisionShape2D" type="CollisionShape2D" parent="Enemy"]
shape = SubResource("RectangleShape2D_0wd2x")
[connection signal="died" from="Main/Player" to="." method="_on_player_died"]
9 changes: 9 additions & 0 deletions godot/src/player.gd
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
extends CharacterBody2D

signal died()

@export var speed := 100
@export var accel := 800
@export var health := 50

@export var projectile_scene: PackedScene

Expand Down Expand Up @@ -29,3 +32,9 @@ func _physics_process(delta):

velocity = velocity.move_toward(Vector2(motion_x, motion_y) * speed, accel * delta)
move_and_slide()


func _on_hitbox_hit(dmg):
health -= dmg
if health <= 0:
died.emit()
6 changes: 5 additions & 1 deletion godot/src/props/projectile.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ extends Area2D
@export var speed := 300
@export var dir := Vector2.RIGHT
@export var max_reflections := 4
@export var damage := 5

var reflected := 0

Expand All @@ -16,7 +17,10 @@ func _ready():

if reflected > max_reflections:
queue_free()
)
elif area is Hitbox:
area.damage(damage)
queue_free()
)

func _physics_process(delta):
translate(dir * speed * delta)
1 change: 1 addition & 0 deletions godot/src/props/projectile.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ size = Vector2(32, 4)
collision_layer = 0
collision_mask = 56
script = ExtResource("1_ffy6e")
damage = 30

[node name="Sprite2D" type="Sprite2D" parent="."]
scale = Vector2(0.234375, 0.0256348)
Expand Down
4 changes: 4 additions & 0 deletions godot/src/props/shard.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extends RigidBody2D

func _integrate_forces(state):
scale = Vector2(1, 1)
15 changes: 15 additions & 0 deletions godot/src/props/shard.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[gd_scene load_steps=2 format=3 uid="uid://loeue0lwhf1q"]

[ext_resource type="Script" path="res://src/props/shard.gd" id="1_nrevn"]

[node name="Shard" type="RigidBody2D"]
collision_layer = 0
collision_mask = 0
sleeping = true
freeze = true
script = ExtResource("1_nrevn")

[node name="Polygon2D" type="Polygon2D" parent="."]

[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
disabled = true
Loading

0 comments on commit 94a6e80

Please sign in to comment.