From 96fd6f5c264f1f42d8b28e880cf51d98bdf4920e Mon Sep 17 00:00:00 2001 From: HumanoidSandvichDispenser Date: Sat, 3 Jun 2023 17:52:08 -0700 Subject: [PATCH] delete old files --- Tests/HitboxTest.tscn | 36 ------------------------------------ Tests/OscillatingBody.cs | 22 ---------------------- Tests/StaticMovement.cs | 38 -------------------------------------- 3 files changed, 96 deletions(-) delete mode 100644 Tests/HitboxTest.tscn delete mode 100644 Tests/OscillatingBody.cs delete mode 100644 Tests/StaticMovement.cs diff --git a/Tests/HitboxTest.tscn b/Tests/HitboxTest.tscn deleted file mode 100644 index 503263d..0000000 --- a/Tests/HitboxTest.tscn +++ /dev/null @@ -1,36 +0,0 @@ -[gd_scene load_steps=6 format=3 uid="uid://8ewc46esswdo"] - -[ext_resource type="Texture2D" uid="uid://bw052v8ikfget" path="res://icon.svg" id="1_jh0yt"] -[ext_resource type="PackedScene" uid="uid://du5vhccg75nrq" path="res://BoundingBoxes/Hitbox.tscn" id="2_gtebh"] -[ext_resource type="PackedScene" uid="uid://cjgxyhgcyvsv7" path="res://BoundingBoxes/Hurtbox.tscn" id="2_konpx"] -[ext_resource type="Script" path="res://Tests/OscillatingBody.cs" id="3_exvxj"] - -[sub_resource type="RectangleShape2D" id="RectangleShape2D_bvv0o"] -size = Vector2(128, 128) - -[node name="HItboxTest" type="Node2D"] -position = Vector2(377, 214) - -[node name="Node2D" type="Node2D" parent="."] - -[node name="Sprite2D" type="Sprite2D" parent="Node2D"] -texture = ExtResource("1_jh0yt") - -[node name="Hitbox" parent="Node2D" instance=ExtResource("2_gtebh")] - -[node name="OscillatingBody" type="CharacterBody2D" parent="."] -script = ExtResource("3_exvxj") - -[node name="Sprite2D" type="Sprite2D" parent="OscillatingBody"] -position = Vector2(230, 7) -texture = ExtResource("1_jh0yt") - -[node name="Hurtbox" parent="OscillatingBody" instance=ExtResource("2_konpx")] - -[node name="CollisionShape2D" parent="OscillatingBody/Hurtbox" index="0"] -shape = SubResource("RectangleShape2D_bvv0o") - -[connection signal="ReceivedDamage" from="OscillatingBody/Hurtbox" to="OscillatingBody" method="_on_hurtbox_received_damage"] - -[editable path="Node2D/Hitbox"] -[editable path="OscillatingBody/Hurtbox"] diff --git a/Tests/OscillatingBody.cs b/Tests/OscillatingBody.cs deleted file mode 100644 index cd6cc75..0000000 --- a/Tests/OscillatingBody.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Godot; -using SupaLidlGame.Characters; -using System; - -public partial class OscillatingBody : CharacterBody2D -{ - private double _time = 0; - - public override void _PhysicsProcess(double delta) - { - _time += delta; - // move along the path sin(x) whose derivative is cos(x) - Velocity = Vector2.Left * Mathf.Cos((float)_time) * 256; - MoveAndSlide(); - } - - public void _on_hurtbox_received_damage(float damage, Character attacker, - float knockback, Vector2 _, Vector2 __) - { - GD.Print($"took {damage} dmg"); - } -} diff --git a/Tests/StaticMovement.cs b/Tests/StaticMovement.cs deleted file mode 100644 index 72f35f3..0000000 --- a/Tests/StaticMovement.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Godot; - -public partial class StaticMovement : CharacterBody2D -{ - public const float Speed = 300.0f; - public const float JumpVelocity = -400.0f; - - // Get the gravity from the project settings to be synced with RigidBody nodes. - public float gravity = ProjectSettings.GetSetting("physics/2d/default_gravity").AsSingle(); - - public override void _PhysicsProcess(double delta) - { - Vector2 velocity = Velocity; - - // Add the gravity. - if (!IsOnFloor()) - velocity.Y += gravity * (float)delta; - - // Handle Jump. - if (Input.IsActionJustPressed("ui_accept") && IsOnFloor()) - velocity.Y = JumpVelocity; - - // Get the input direction and handle the movement/deceleration. - // As good practice, you should replace UI actions with custom gameplay actions. - Vector2 direction = Input.GetVector("ui_left", "ui_right", "ui_up", "ui_down"); - if (direction != Vector2.Zero) - { - velocity.X = direction.X * Speed; - } - else - { - velocity.X = Mathf.MoveToward(Velocity.X, 0, Speed); - } - - Velocity = velocity; - MoveAndSlide(); - } -}