Merge pull request 'Casset/level1' (#7) from casset into main

Reviewed-on: #7
This commit was merged in pull request #7.
This commit is contained in:
sam committed 2026-10-03 18:42:56 -05:00
commit 7b15d90633
11 files changed
+297 -349

No files matched your search

+3
View File
@@ -3,4 +3,7 @@ extends Node
@onready var test_level = $"../test_scene" @onready var test_level = $"../test_scene"
@onready var projectile = $"../projectile" @onready var projectile = $"../projectile"
@onready var level_1 = $"../Level1"
var death_counter = 3 var death_counter = 3
var cassets = 0
var doing_puzzle: bool = false
+10
View File
@@ -0,0 +1,10 @@
extends Node2D
var points = 0
func _on_body_entered(body: Node2D) -> void:
queue_free()
GloblaData.cassets += 1
print("1 point")
+1
View File
@@ -0,0 +1 @@
uid://bjj8m1jv577ob
+21
View File
@@ -0,0 +1,21 @@
[gd_scene format=3 uid="uid://c17txy4vh4wka"]
[ext_resource type="Script" uid="uid://bjj8m1jv577ob" path="res://casset.gd" id="1_n02yi"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_aqe1g"]
size = Vector2(47, 25)
[node name="casset" type="Area2D" unique_id=918954585]
collision_layer = 16
script = ExtResource("1_n02yi")
[node name="ColorRect" type="ColorRect" parent="." unique_id=2007285166]
offset_right = 47.0
offset_bottom = 25.0
color = Color(0, 0, 0, 1)
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1414004718]
position = Vector2(23.5, 12.5)
shape = SubResource("RectangleShape2D_aqe1g")
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
+78 -218
View File
@@ -1,229 +1,89 @@
[gd_scene format=3 uid="uid://byyncg030v5uf"] [gd_scene format=3 uid="uid://byyncg030v5uf"]
[ext_resource type="Texture2D" uid="uid://bt61g6xdrepd" path="res://assets/sprites/knight.png" id="1_4tcl0"] [ext_resource type="Script" uid="uid://cogpyoqdfygvg" path="res://scenes/levels/level_1.gd" id="1_bfxgj"]
[ext_resource type="TileSet" uid="uid://bcmaud87chfuu" path="res://assets/sprites/knight.tres" id="2_dd0lh"] [ext_resource type="PackedScene" uid="uid://cmtdq6tedv1mm" path="res://scenes/player.tscn" id="1_dd0lh"]
[ext_resource type="PackedScene" uid="uid://dxx6mxv6x5yws" path="res://scenes/enemy.tscn" id="2_bfxgj"]
[ext_resource type="PackedScene" uid="uid://c17txy4vh4wka" path="res://scenes/casset.tscn" id="3_dywbp"]
[sub_resource type="AtlasTexture" id="AtlasTexture_bfxgj"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_aqe1g"]
atlas = ExtResource("1_4tcl0") size = Vector2(6598.25, 171)
region = Rect2(0, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_dywbp"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_yg5ta"]
atlas = ExtResource("1_4tcl0") size = Vector2(787, 135)
region = Rect2(32, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_1seuy"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_e270b"]
atlas = ExtResource("1_4tcl0") size = Vector2(341, 630)
region = Rect2(64, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_2r1tl"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_xfo6b"]
atlas = ExtResource("1_4tcl0") size = Vector2(74, 1107)
region = Rect2(96, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_8a7m2"]
atlas = ExtResource("1_4tcl0")
region = Rect2(0, 160, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_plydf"]
atlas = ExtResource("1_4tcl0")
region = Rect2(32, 160, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_5ntmo"]
atlas = ExtResource("1_4tcl0")
region = Rect2(64, 160, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_nkeig"]
atlas = ExtResource("1_4tcl0")
region = Rect2(96, 160, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_nfihu"]
atlas = ExtResource("1_4tcl0")
region = Rect2(128, 160, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_lgguw"]
atlas = ExtResource("1_4tcl0")
region = Rect2(160, 160, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_jprdt"]
atlas = ExtResource("1_4tcl0")
region = Rect2(192, 160, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_ps2vj"]
atlas = ExtResource("1_4tcl0")
region = Rect2(224, 160, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_sbmf2"]
atlas = ExtResource("1_4tcl0")
region = Rect2(0, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_1xax6"]
atlas = ExtResource("1_4tcl0")
region = Rect2(32, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_g7tkf"]
atlas = ExtResource("1_4tcl0")
region = Rect2(64, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_4fww7"]
atlas = ExtResource("1_4tcl0")
region = Rect2(96, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_gvm5i"]
atlas = ExtResource("1_4tcl0")
region = Rect2(128, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_jrfo0"]
atlas = ExtResource("1_4tcl0")
region = Rect2(160, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_db1r7"]
atlas = ExtResource("1_4tcl0")
region = Rect2(192, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_6gwlt"]
atlas = ExtResource("1_4tcl0")
region = Rect2(224, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_c2nc4"]
atlas = ExtResource("1_4tcl0")
region = Rect2(0, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_vhxpm"]
atlas = ExtResource("1_4tcl0")
region = Rect2(32, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_arkx4"]
atlas = ExtResource("1_4tcl0")
region = Rect2(64, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_jqv5m"]
atlas = ExtResource("1_4tcl0")
region = Rect2(96, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_noix2"]
atlas = ExtResource("1_4tcl0")
region = Rect2(128, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_025c5"]
atlas = ExtResource("1_4tcl0")
region = Rect2(160, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_bw3ef"]
atlas = ExtResource("1_4tcl0")
region = Rect2(192, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_07dy8"]
atlas = ExtResource("1_4tcl0")
region = Rect2(224, 96, 32, 32)
[sub_resource type="SpriteFrames" id="SpriteFrames_d53c6"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_bfxgj")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_dywbp")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_1seuy")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2r1tl")
}],
"loop": 1,
"name": &"Idle",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_8a7m2")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_plydf")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_5ntmo")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_nkeig")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_nfihu")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_lgguw")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_jprdt")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ps2vj")
}],
"loop": 1,
"name": &"Roll",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_sbmf2")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_1xax6")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_g7tkf")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_4fww7")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_gvm5i")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_jrfo0")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_db1r7")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_6gwlt")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_c2nc4")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_vhxpm")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_arkx4")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_jqv5m")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_noix2")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_025c5")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_bw3ef")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_07dy8")
}],
"loop": 1,
"name": &"Run",
"speed": 5.0
}]
[node name="Level1" type="Node2D" unique_id=872996404] [node name="Level1" type="Node2D" unique_id=872996404]
script = ExtResource("1_bfxgj")
[node name="CharacterBody2D" type="CharacterBody2D" parent="." unique_id=702674080] [node name="ColorRect" type="ColorRect" parent="." unique_id=875566885]
offset_top = 269.0
offset_right = 6588.0
offset_bottom = 368.0
color = Color(0, 0.39215687, 0, 1)
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="CharacterBody2D" unique_id=1742472414] [node name="ColorRect2" type="ColorRect" parent="." unique_id=170644068]
sprite_frames = SubResource("SpriteFrames_d53c6") offset_left = 1250.0
animation = &"Roll" offset_top = -129.0
offset_right = 2039.0
offset_bottom = 6.0
color = Color(0, 0.39215687, 0, 1)
[node name="TileMapLayer" type="TileMapLayer" parent="CharacterBody2D/AnimatedSprite2D" unique_id=1046286093] [node name="ColorRect3" type="ColorRect" parent="." unique_id=1127267083]
tile_set = ExtResource("2_dd0lh") offset_top = 269.0
offset_right = 4761.0
offset_bottom = 368.0
color = Color(0, 0.39215687, 0, 1)
[node name="ColorRect4" type="ColorRect" parent="." unique_id=1994208535]
offset_left = 4215.0
offset_top = -358.0
offset_right = 4563.0
offset_bottom = 267.0
color = Color(0, 0.39215687, 0, 1)
[node name="player" parent="." unique_id=1596338883 instance=ExtResource("1_dd0lh")]
position = Vector2(4730, 39)
[node name="enemy" parent="." unique_id=1471932521 instance=ExtResource("2_bfxgj")]
position = Vector2(1304, -293)
[node name="enemy2" parent="." unique_id=631693255 instance=ExtResource("2_bfxgj")]
position = Vector2(3028, 91)
[node name="casset" parent="." unique_id=918954585 instance=ExtResource("3_dywbp")]
position = Vector2(4342, -430)
[node name="StaticBody2D" type="StaticBody2D" parent="." unique_id=1033326926]
collision_layer = 2
collision_mask = 5
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D" unique_id=2093286666]
position = Vector2(3292.875, 355)
shape = SubResource("RectangleShape2D_aqe1g")
[node name="CollisionShape2D2" type="CollisionShape2D" parent="StaticBody2D" unique_id=162193919]
position = Vector2(1644.5, -61.5)
shape = SubResource("RectangleShape2D_yg5ta")
[node name="CollisionShape2D3" type="CollisionShape2D" parent="StaticBody2D" unique_id=837904529]
position = Vector2(4385.5, -42)
shape = SubResource("RectangleShape2D_e270b")
[node name="Area2D" type="Area2D" parent="." unique_id=1173036271]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" unique_id=857196107]
position = Vector2(5795, -306)
shape = SubResource("RectangleShape2D_xfo6b")
[node name="Marker2D" type="Marker2D" parent="." unique_id=1804380766]
position = Vector2(5418, -140)
[node name="Marker2D2" type="Marker2D" parent="." unique_id=726852992]
position = Vector2(5756, 192)
[connection signal="body_entered" from="Area2D" to="." method="_on_area_2d_body_entered"]
+15
View File
@@ -0,0 +1,15 @@
extends Node2D
@onready var phonephreak = preload("res://scenes/puzzles/phonephreak.tscn")
# 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:
GloblaData.doing_puzzle = true
var instance = phonephreak.instantiate()
$Marker2D.add_child(instance)
+1
View File
@@ -0,0 +1 @@
uid://cogpyoqdfygvg
+25 -2
View File
@@ -1,12 +1,14 @@
[gd_scene format=3 uid="uid://cmtdq6tedv1mm"] [gd_scene format=3 uid="uid://cmtdq6tedv1mm"]
[ext_resource type="Script" uid="uid://2ig5okof0vaa" path="res://scripts/UltimatePlatformerController.gd" id="1_3vyb7"] [ext_resource type="Script" uid="uid://2ig5okof0vaa" path="res://scripts/UltimatePlatformerController.gd" id="1_3vyb7"]
[ext_resource type="FontFile" uid="uid://ddm6ojsaiq20b" path="res://assets/fonts/PixelOperator8-Bold.ttf" id="2_g2els"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_d2by0"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_d2by0"]
size = Vector2(111, 105) size = Vector2(111, 105)
[node name="player" type="CharacterBody2D" unique_id=1596338883] [node name="player" type="CharacterBody2D" unique_id=1596338883]
collision_mask = 6 position = Vector2(510, 410)
collision_mask = 22
script = ExtResource("1_3vyb7") script = ExtResource("1_3vyb7")
[node name="ColorRect" type="ColorRect" parent="." unique_id=1060028972] [node name="ColorRect" type="ColorRect" parent="." unique_id=1060028972]
@@ -16,7 +18,7 @@ offset_bottom = 104.0
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=440932344] [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=440932344]
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1496788104] [node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1496788104]
position = Vector2(55.5, 52.5) position = Vector2(56, 52)
shape = SubResource("RectangleShape2D_d2by0") shape = SubResource("RectangleShape2D_d2by0")
[node name="ColorRect2" type="ColorRect" parent="." unique_id=1595777933] [node name="ColorRect2" type="ColorRect" parent="." unique_id=1595777933]
@@ -42,3 +44,24 @@ color = Color(1, 0, 0, 1)
[node name="Marker2D" type="Marker2D" parent="." unique_id=1559032825] [node name="Marker2D" type="Marker2D" parent="." unique_id=1559032825]
position = Vector2(112, 38) position = Vector2(112, 38)
[node name="Camera2D" type="Camera2D" parent="." unique_id=2084265989]
position = Vector2(57, 54)
[node name="Label" type="Label" parent="." unique_id=519077191]
offset_left = -314.0
offset_top = -265.0
offset_right = -281.0
offset_bottom = -231.0
theme_override_fonts/font = ExtResource("2_g2els")
theme_override_font_sizes/font_size = 25
text = "0"
[node name="Label2" type="Label" parent="." unique_id=1907510281]
offset_left = -516.0
offset_top = -266.0
offset_right = -264.0
offset_bottom = -232.0
theme_override_fonts/font = ExtResource("2_g2els")
theme_override_font_sizes/font_size = 25
text = "cassets:"
+18 -13
View File
@@ -5,33 +5,38 @@
[ext_resource type="Texture2D" uid="uid://hbkkhhlechol" path="res://assets/sprites/phonephreak.png" id="3_ba2os"] [ext_resource type="Texture2D" uid="uid://hbkkhhlechol" path="res://assets/sprites/phonephreak.png" id="3_ba2os"]
[node name="Phonephreak" type="Node2D" unique_id=1830177910] [node name="Phonephreak" type="Node2D" unique_id=1830177910]
position = Vector2(0, 1)
script = ExtResource("1_knn0u") script = ExtResource("1_knn0u")
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="." unique_id=519900134] [node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="." unique_id=519900134]
[node name="Phonephreak" type="Sprite2D" parent="." unique_id=1607325509]
position = Vector2(262, 339.5)
scale = Vector2(2.17, 2.17)
texture = ExtResource("3_ba2os")
[node name="Button0" type="Button" parent="." unique_id=1619377723] [node name="Button0" type="Button" parent="." unique_id=1619377723]
offset_left = 568.0 offset_left = 590.0
offset_top = 494.0 offset_top = 495.50003
offset_right = 613.0 offset_right = 635.0
offset_bottom = 541.0 offset_bottom = 542.5
flat = true flat = true
[node name="Label" type="Label" parent="Button0" unique_id=1004291322] [node name="Label" type="Label" parent="Button0" unique_id=1004291322]
layout_mode = 0 layout_mode = 0
offset_right = 44.0 offset_left = 2.0
offset_bottom = 51.0 offset_top = 2.0
offset_right = 46.0
offset_bottom = 53.0
theme_override_fonts/font = ExtResource("2_bg4gc") theme_override_fonts/font = ExtResource("2_bg4gc")
theme_override_font_sizes/font_size = 50 theme_override_font_sizes/font_size = 50
text = "0" text = "0"
[node name="ColorRect" type="ColorRect" parent="Button0" unique_id=582830561] [node name="ColorRect" type="ColorRect" parent="Button0" unique_id=582830561]
layout_mode = 0 layout_mode = 0
offset_right = 43.0 offset_left = 6.0
offset_bottom = 47.0 offset_top = 3.0
offset_right = 49.0
offset_bottom = 50.0
mouse_filter = 2 mouse_filter = 2
color = Color(1, 1, 1, 0) color = Color(1, 1, 1, 0)
[node name="Phonephreak" type="Sprite2D" parent="." unique_id=1607325509]
position = Vector2(253, 328)
scale = Vector2(2.17, 2.17)
texture = ExtResource("3_ba2os")
+5 -1
View File
@@ -3,6 +3,7 @@
[ext_resource type="PackedScene" uid="uid://cmtdq6tedv1mm" path="res://scenes/player.tscn" id="1_g7g4h"] [ext_resource type="PackedScene" uid="uid://cmtdq6tedv1mm" path="res://scenes/player.tscn" id="1_g7g4h"]
[ext_resource type="Script" uid="uid://v7bcqfwryutg" path="res://scripts/test_scene.gd" id="1_j8ivh"] [ext_resource type="Script" uid="uid://v7bcqfwryutg" path="res://scripts/test_scene.gd" id="1_j8ivh"]
[ext_resource type="PackedScene" uid="uid://dxx6mxv6x5yws" path="res://scenes/enemy.tscn" id="2_j8ivh"] [ext_resource type="PackedScene" uid="uid://dxx6mxv6x5yws" path="res://scenes/enemy.tscn" id="2_j8ivh"]
[ext_resource type="PackedScene" uid="uid://c17txy4vh4wka" path="res://scenes/casset.tscn" id="4_7ddre"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_aqe1g"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_aqe1g"]
size = Vector2(1116.25, 73) size = Vector2(1116.25, 73)
@@ -28,4 +29,7 @@ position = Vector2(561.125, 569)
shape = SubResource("RectangleShape2D_aqe1g") shape = SubResource("RectangleShape2D_aqe1g")
[node name="enemy" parent="." unique_id=1471932521 instance=ExtResource("2_j8ivh")] [node name="enemy" parent="." unique_id=1471932521 instance=ExtResource("2_j8ivh")]
position = Vector2(695, 334) position = Vector2(380, 334)
[node name="casset" parent="." unique_id=1213318639 instance=ExtResource("4_7ddre")]
position = Vector2(1018, 456)
+120 -115
View File
@@ -324,16 +324,20 @@ func _process(_delta):
var dir: bool = 1 var dir: bool = 1
func _physics_process(delta): func _physics_process(delta):
if GloblaData.doing_puzzle == true:
$".".global_position = $"../Marker2D2".global_position
$Label.text = str(int(GloblaData.cassets))
if Input.is_action_pressed("right"): if Input.is_action_pressed("right"):
dir = 1 dir = 1
if Input.is_action_pressed("left"): if Input.is_action_pressed("left"):
dir = 0 dir = 0
if Input.is_action_just_pressed("fire"): if GloblaData.doing_puzzle == false:
var instance = projectile.instantiate() if Input.is_action_just_pressed("fire"):
if !dir: var instance = projectile.instantiate()
instance.speed = -instance.speed if !dir:
instance.position = $Marker2D.global_position instance.speed = -instance.speed
GloblaData.test_level.add_child(instance) instance.position = $Marker2D.global_position
GloblaData.level_1.add_child(instance)
if GloblaData.death_counter == 0: if GloblaData.death_counter == 0:
get_tree().quit() get_tree().quit()
if GloblaData.death_counter == 2: if GloblaData.death_counter == 2:
@@ -363,53 +367,53 @@ func _physics_process(delta):
#INFO Left and Right Movement #INFO Left and Right Movement
if GloblaData.doing_puzzle == false:
if rightHold and leftHold and movementInputMonitoring: if rightHold and leftHold and movementInputMonitoring:
if !instantStop:
_decelerate(delta, false)
else:
velocity.x = -0.1
elif rightHold and movementInputMonitoring.x:
if velocity.x > maxSpeed or instantAccel:
velocity.x = maxSpeed
else:
velocity.x += acceleration * delta
if velocity.x < 0:
if !instantStop: if !instantStop:
_decelerate(delta, false) _decelerate(delta, false)
else: else:
velocity.x = -0.1 velocity.x = -0.1
elif leftHold and movementInputMonitoring.y: elif rightHold and movementInputMonitoring.x:
if velocity.x < -maxSpeed or instantAccel: if velocity.x > maxSpeed or instantAccel:
velocity.x = -maxSpeed velocity.x = maxSpeed
else: else:
velocity.x -= acceleration * delta velocity.x += acceleration * delta
if velocity.x < 0:
if !instantStop:
_decelerate(delta, false)
else:
velocity.x = -0.1
elif leftHold and movementInputMonitoring.y:
if velocity.x < -maxSpeed or instantAccel:
velocity.x = -maxSpeed
else:
velocity.x -= acceleration * delta
if velocity.x > 0:
if !instantStop:
_decelerate(delta, false)
else:
velocity.x = 0.1
if velocity.x > 0: if velocity.x > 0:
wasMovingR = true
elif velocity.x < 0:
wasMovingR = false
if rightTap:
wasPressingR = true
if leftTap:
wasPressingR = false
if runningModifier and !runHold:
maxSpeed = maxSpeedLock / 2
elif is_on_floor():
maxSpeed = maxSpeedLock
if !(leftHold or rightHold):
if !instantStop: if !instantStop:
_decelerate(delta, false) _decelerate(delta, false)
else: else:
velocity.x = 0.1 velocity.x = 0
if velocity.x > 0:
wasMovingR = true
elif velocity.x < 0:
wasMovingR = false
if rightTap:
wasPressingR = true
if leftTap:
wasPressingR = false
if runningModifier and !runHold:
maxSpeed = maxSpeedLock / 2
elif is_on_floor():
maxSpeed = maxSpeedLock
if !(leftHold or rightHold):
if !instantStop:
_decelerate(delta, false)
else:
velocity.x = 0
#INFO Crouching #INFO Crouching
if crouch: if crouch:
@@ -451,81 +455,82 @@ func _physics_process(delta):
pass pass
#INFO Jump and Gravity #INFO Jump and Gravity
if velocity.y > 0: if GloblaData.doing_puzzle == false:
appliedGravity = gravityScale * descendingGravityFactor if velocity.y > 0:
else: appliedGravity = gravityScale * descendingGravityFactor
appliedGravity = gravityScale else:
appliedGravity = gravityScale
if is_on_wall() and !groundPounding:
appliedTerminalVelocity = terminalVelocity / wallSliding
if wallLatching and ((wallLatchingModifer and latchHold) or !wallLatchingModifer):
appliedGravity = 0
if velocity.y < 0:
velocity.y += 50
if velocity.y > 0:
velocity.y = 0
if wallLatchingModifer and latchHold and movementInputMonitoring == Vector2(true, true):
velocity.x = 0
elif wallSliding != 1 and velocity.y > 0:
appliedGravity = appliedGravity / wallSliding
elif !is_on_wall() and !groundPounding:
appliedTerminalVelocity = terminalVelocity
if gravityActive:
if velocity.y < appliedTerminalVelocity:
velocity.y += appliedGravity
elif velocity.y > appliedTerminalVelocity:
velocity.y = appliedTerminalVelocity
if shortHopAkaVariableJumpHeight and jumpRelease and velocity.y < 0: if is_on_wall() and !groundPounding:
velocity.y = velocity.y / jumpVariable appliedTerminalVelocity = terminalVelocity / wallSliding
if wallLatching and ((wallLatchingModifer and latchHold) or !wallLatchingModifer):
if jumps == 1: appliedGravity = 0
if !is_on_floor() and !is_on_wall():
if coyoteTime > 0:
coyoteActive = true
_coyoteTime()
if jumpTap and !is_on_wall(): if velocity.y < 0:
if coyoteActive: velocity.y += 50
coyoteActive = false if velocity.y > 0:
_jump() velocity.y = 0
if jumpBuffering > 0:
jumpWasPressed = true if wallLatchingModifer and latchHold and movementInputMonitoring == Vector2(true, true):
_bufferJump() velocity.x = 0
elif jumpBuffering == 0 and coyoteTime == 0 and is_on_floor():
_jump() elif wallSliding != 1 and velocity.y > 0:
elif jumpTap and is_on_wall() and !is_on_floor(): appliedGravity = appliedGravity / wallSliding
if wallJump and !latched: elif !is_on_wall() and !groundPounding:
_wallJump() appliedTerminalVelocity = terminalVelocity
elif wallJump and latched:
_wallJump() if gravityActive:
elif jumpTap and is_on_floor(): if velocity.y < appliedTerminalVelocity:
_jump() velocity.y += appliedGravity
elif velocity.y > appliedTerminalVelocity:
velocity.y = appliedTerminalVelocity
if is_on_floor(): if shortHopAkaVariableJumpHeight and jumpRelease and velocity.y < 0:
jumpCount = jumps velocity.y = velocity.y / jumpVariable
if coyoteTime > 0:
coyoteActive = true if jumps == 1:
else: if !is_on_floor() and !is_on_wall():
coyoteActive = false if coyoteTime > 0:
if jumpWasPressed: coyoteActive = true
_coyoteTime()
if jumpTap and !is_on_wall():
if coyoteActive:
coyoteActive = false
_jump()
if jumpBuffering > 0:
jumpWasPressed = true
_bufferJump()
elif jumpBuffering == 0 and coyoteTime == 0 and is_on_floor():
_jump()
elif jumpTap and is_on_wall() and !is_on_floor():
if wallJump and !latched:
_wallJump()
elif wallJump and latched:
_wallJump()
elif jumpTap and is_on_floor():
_jump() _jump()
if is_on_floor():
jumpCount = jumps
if coyoteTime > 0:
coyoteActive = true
else:
coyoteActive = false
if jumpWasPressed:
_jump()
elif jumps > 1: elif jumps > 1:
if is_on_floor(): if is_on_floor():
jumpCount = jumps jumpCount = jumps
if jumpTap and is_on_wall() and wallJump: if jumpTap and is_on_wall() and wallJump:
_wallJump() _wallJump()
elif jumpTap and jumpCount > 0: elif jumpTap and jumpCount > 0:
velocity.y = -jumpMagnitude velocity.y = -jumpMagnitude
jumpCount = jumpCount - 1 jumpCount = jumpCount - 1
_endGroundPound() _endGroundPound()
#INFO dashing #INFO dashing
if is_on_floor(): if is_on_floor():
dashCount = dashes dashCount = dashes