chill out bro:

This commit is contained in:
pennyrigate 2025-03-01 19:49:37 -05:00
parent cbbf55a48a
commit ddd02953da
10 changed files with 178 additions and 7 deletions

BIN
assets/textures/ice/ice.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d0e475k64fbja"
path="res://.godot/imported/ice.png-d75f02434fc47d5fed2ae33e954ca6d2.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/textures/ice/ice.png"
dest_files=["res://.godot/imported/ice.png-d75f02434fc47d5fed2ae33e954ca6d2.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 510 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d3x8vjgistyb8"
path="res://.godot/imported/jelly.png-1bbbb6a8c7911962c52c884e3494c788.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/textures/jelly/jelly.png"
dest_files=["res://.godot/imported/jelly.png-1bbbb6a8c7911962c52c884e3494c788.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

View file

@ -1,9 +1,10 @@
[gd_scene load_steps=5 format=3 uid="uid://bbnq7ptk8hhxa"]
[gd_scene load_steps=6 format=3 uid="uid://bbnq7ptk8hhxa"]
[ext_resource type="Texture2D" uid="uid://b6a7l24y30iht" path="res://assets/textures/backgrounds/chocomint.png" id="1_gk4ur"]
[ext_resource type="PackedScene" uid="uid://mh2gfm7iqqsm" path="res://objects/player/player.tscn" id="2_kip56"]
[ext_resource type="TileSet" uid="uid://xwfn24if3pxk" path="res://assets/tilesets/chocomint.tres" id="3_4td23"]
[ext_resource type="PackedScene" uid="uid://68lav5rke5ag" path="res://objects/spring/spring.tscn" id="4_a3xei"]
[ext_resource type="PackedScene" uid="uid://b5eso40mjhlmv" path="res://objects/ice/ice.tscn" id="5_88a5a"]
[node name="Level1" type="Node2D"]
@ -18,21 +19,36 @@ position = Vector2(31, 139)
[node name="TileMap" type="TileMap" parent="."]
tile_set = ExtResource("3_4td23")
format = 2
layer_0/tile_data = PackedInt32Array(720896, 0, 0, 720897, 0, 0, 720898, 0, 0, 720899, 0, 0, 720900, 0, 0, 720901, 0, 0, 720902, 0, 0, 720903, 0, 0, 720904, 0, 0, 720905, 0, 0, 720906, 0, 0, 720907, 0, 0, 720908, 0, 0, 720909, 0, 0, 720910, 0, 0, 720911, 0, 0, 720912, 0, 0, 720913, 0, 0)
layer_0/tile_data = PackedInt32Array(720896, 0, 0, 720897, 0, 0, 720898, 0, 0, 720903, 0, 0, 720904, 0, 0, 720905, 0, 0, 720906, 0, 0, 720907, 0, 0, 720909, 0, 0, 720910, 0, 0, 720911, 0, 0, 720912, 0, 0, 720913, 0, 0)
[node name="Spring" parent="." instance=ExtResource("4_a3xei")]
position = Vector2(88, 176)
position = Vector2(96, 80)
[node name="Spring2" parent="." instance=ExtResource("4_a3xei")]
position = Vector2(120, 176)
position = Vector2(128, 80)
[node name="Spring3" parent="." instance=ExtResource("4_a3xei")]
position = Vector2(152, 176)
position = Vector2(160, 80)
[node name="Spring4" parent="." instance=ExtResource("4_a3xei")]
position = Vector2(104, 120)
position = Vector2(112, 24)
rotation = 3.14159
[node name="Spring5" parent="." instance=ExtResource("4_a3xei")]
position = Vector2(136, 120)
position = Vector2(144, 24)
rotation = 3.14159
[node name="Ice" parent="." instance=ExtResource("5_88a5a")]
position = Vector2(200, 184)
[node name="Ice2" parent="." instance=ExtResource("5_88a5a")]
position = Vector2(56, 184)
[node name="Ice3" parent="." instance=ExtResource("5_88a5a")]
position = Vector2(72, 184)
[node name="Ice4" parent="." instance=ExtResource("5_88a5a")]
position = Vector2(88, 184)
[node name="Ice5" parent="." instance=ExtResource("5_88a5a")]
position = Vector2(104, 184)

20
objects/ice/ice.gd Normal file
View file

@ -0,0 +1,20 @@
extends Node2D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_area_2d_body_entered(body: Node2D) -> void:
if body is Player:
body.ices_touched += 1
func _on_area_2d_body_exited(body: Node2D) -> void:
body.ices_touched -= 1

34
objects/ice/ice.tscn Normal file
View file

@ -0,0 +1,34 @@
[gd_scene load_steps=5 format=3 uid="uid://b5eso40mjhlmv"]
[ext_resource type="Texture2D" uid="uid://d0e475k64fbja" path="res://assets/textures/ice/ice.png" id="1_0p7ug"]
[ext_resource type="Script" path="res://objects/ice/ice.gd" id="1_hgdc3"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_sv4q1"]
size = Vector2(16, 17)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_xodyg"]
size = Vector2(16, 16)
[node name="Ice" type="Node2D"]
script = ExtResource("1_hgdc3")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_0p7ug")
[node name="Area2D" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 16
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
position = Vector2(0, -0.5)
shape = SubResource("RectangleShape2D_sv4q1")
[node name="StaticBody2D" type="StaticBody2D" parent="."]
collision_layer = 2
collision_mask = 16
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
shape = SubResource("RectangleShape2D_xodyg")
[connection signal="body_entered" from="Area2D" to="." method="_on_area_2d_body_entered"]
[connection signal="body_exited" from="Area2D" to="." method="_on_area_2d_body_exited"]

View file

@ -10,6 +10,14 @@ extends CharacterBody2D
@export var state_chart: StateChart
@export var graphics: Node2D
var ices_touched:int = 0:
set(value):
ices_touched = value
if ices_touched <= 0:
ices_touched = 0
state_chart.send_event(&"ground_touched")
else:
state_chart.send_event(&"ice_touched")
#region Notifications
func _ready() -> void:

View file

@ -47,6 +47,8 @@ script = ExtResource("9_ht8un")
expression = "player.velocity.y >= 0.0"
[node name="Player" type="CharacterBody2D" node_paths=PackedStringArray("state_chart", "graphics")]
collision_layer = 16
collision_mask = 3
floor_snap_length = 3.0
script = ExtResource("1_jgave")
gravity = 400.0
@ -120,6 +122,12 @@ to = NodePath("../../Airborne")
guard = SubResource("Resource_4mj4w")
delay_in_seconds = "0.0"
[node name="On ice_touched" type="Node" parent="StateChart/Root/Grounded"]
script = ExtResource("8_pgje5")
to = NodePath("../Sliding")
event = &"ice_touched"
delay_in_seconds = "0.0"
[node name="On jump_pressed" type="Node" parent="StateChart/Root/Grounded"]
script = ExtResource("8_pgje5")
to = NodePath("../../Airborne/Jumping")
@ -135,6 +143,15 @@ to = NodePath("../../Running")
guard = SubResource("Resource_kdmd2")
delay_in_seconds = "0.0"
[node name="Sliding" type="Node" parent="StateChart/Root/Grounded"]
script = ExtResource("7_56odx")
[node name="On ground_touched" type="Node" parent="StateChart/Root/Grounded/Sliding"]
script = ExtResource("8_pgje5")
to = NodePath("../../Standing")
event = &"ground_touched"
delay_in_seconds = "0.0"
[node name="Running" type="Node" parent="StateChart/Root/Grounded"]
script = ExtResource("7_56odx")
@ -176,6 +193,7 @@ delay_in_seconds = "0.0"
[connection signal="state_entered" from="StateChart/Root/Grounded/Standing" to="." method="_stop_moving"]
[connection signal="state_entered" from="StateChart/Root/Grounded/Standing" to="Graphics/Sprite/Idle" method="play"]
[connection signal="state_entered" from="StateChart/Root/Grounded/Sliding" to="Graphics/Sprite/Idle" method="play"]
[connection signal="state_entered" from="StateChart/Root/Grounded/Running" to="Graphics/Sprite/Run" method="play"]
[connection signal="state_physics_processing" from="StateChart/Root/Grounded/Running" to="." method="_process_run"]
[connection signal="state_entered" from="StateChart/Root/Grounded/Barking" to="Graphics/Sprite/Bark" method="play"]

View file

@ -11,6 +11,7 @@ config_version=5
[application]
config/name="Capri"
run/main_scene="res://maps/level1.tscn"
config/features=PackedStringArray("4.3", "GL Compatibility")
config/icon="res://icon.svg"
@ -35,6 +36,12 @@ folder_colors={
"res://scripts/": "teal"
}
[layer_names]
2d_physics/layer_1="solid"
2d_physics/layer_2="slippery"
2d_physics/layer_5="player"
[rendering]
textures/canvas_textures/default_texture_filter=0