From 1fd9f6b6905ff6556a673e2c03b19c85b91343e5 Mon Sep 17 00:00:00 2001 From: Jakob Feldmann Date: Mon, 13 Mar 2023 18:49:22 +0100 Subject: [PATCH] Frogs compatible with springs --- src/Actors/Enemies/Beings/WhatAreFrog.tscn | 8 +++----- src/Levels/01 Level.tscn | 8 +++----- src/Levels/02 Level.tscn | 10 ++++------ src/Levels/03 Level.tscn | 10 ++++------ src/Levels/Enemy Test Level.tscn | 4 +--- src/Levels/Flyer Test Level.tscn | 4 +--- src/Levels/Froggy Test Level.tscn | 8 +++----- src/Levels/Grass Test Level.tscn | 8 +++----- src/Levels/LevelTemplate.tscn | 4 +--- .../DropThroughPlatform.tscn | 0 .../FlyingLaserCutter.gd | 0 .../FlyingLaserCutter.png.import | 0 .../FlyingLaserCutter.tscn | 8 ++++---- .../Platform => Platforms}/FlyingPlatform.gd | 0 .../Platform => Platforms}/FlyingPlatform.tscn | 8 ++++---- .../FlyingPlatformClean.tscn | 2 +- .../Platform => Platforms}/Simple.tscn | 0 .../Platform => Platforms}/Spring.tscn | 2 +- .../Platform => Platforms}/SpringPhysics.gd | 2 +- .../Platform => Platforms}/SpringPlatform.tscn | 18 +++++++++--------- 20 files changed, 43 insertions(+), 61 deletions(-) rename src/{Contraptions/Platform => Platforms}/DropThroughPlatform.tscn (100%) rename src/{Contraptions/Platform => Platforms}/FlyingLaserCutter.gd (100%) rename src/{Contraptions/Platform => Platforms}/FlyingLaserCutter.png.import (100%) rename src/{Contraptions/Platform => Platforms}/FlyingLaserCutter.tscn (93%) rename src/{Contraptions/Platform => Platforms}/FlyingPlatform.gd (100%) rename src/{Contraptions/Platform => Platforms}/FlyingPlatform.tscn (86%) rename src/{Contraptions/Platform => Platforms}/FlyingPlatformClean.tscn (92%) rename src/{Contraptions/Platform => Platforms}/Simple.tscn (100%) rename src/{Contraptions/Platform => Platforms}/Spring.tscn (97%) rename src/{Contraptions/Platform => Platforms}/SpringPhysics.gd (97%) rename src/{Contraptions/Platform => Platforms}/SpringPlatform.tscn (83%) diff --git a/src/Actors/Enemies/Beings/WhatAreFrog.tscn b/src/Actors/Enemies/Beings/WhatAreFrog.tscn index 3e1dc6b..ec75aad 100644 --- a/src/Actors/Enemies/Beings/WhatAreFrog.tscn +++ b/src/Actors/Enemies/Beings/WhatAreFrog.tscn @@ -420,26 +420,24 @@ collision_mask = 0 collide_with_bodies = false [node name="Left_Wallcast" type="RayCast2D" parent="."] -visible = false position = Vector2( -10, 6 ) enabled = true cast_to = Vector2( -5, 0 ) -collision_mask = 24 +collision_mask = 40 collide_with_areas = true [node name="Right_Wallcast" type="RayCast2D" parent="."] -visible = false position = Vector2( 10, 6 ) enabled = true cast_to = Vector2( 5, 0 ) -collision_mask = 24 +collision_mask = 40 collide_with_areas = true [node name="VisionRayCast" type="RayCast2D" parent="."] visible = false enabled = true cast_to = Vector2( 0, -1 ) -collision_mask = 265 +collision_mask = 297 collide_with_areas = true [node name="EnemyBody" type="CollisionShape2D" parent="." groups=["harmful"]] diff --git a/src/Levels/01 Level.tscn b/src/Levels/01 Level.tscn index f2020f2..45f4ae8 100644 --- a/src/Levels/01 Level.tscn +++ b/src/Levels/01 Level.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=14 format=2] +[gd_scene load_steps=13 format=2] [ext_resource path="res://src/Environment/AlienShipTileSet.tres" type="TileSet" id=1] [ext_resource path="res://src/Actors/Blobby/Blobby.tscn" type="PackedScene" id=2] @@ -9,7 +9,6 @@ [ext_resource path="res://src/UserInterface/UserInterface.tscn" type="PackedScene" id=7] [ext_resource path="res://src/Utilities/SignalManager.tscn" type="PackedScene" id=8] [ext_resource path="res://src/Utilities/LevelState.tscn" type="PackedScene" id=9] -[ext_resource path="res://src/Utilities/LevelState.gd" type="Script" id=10] [ext_resource path="res://src/Actors/BlobbyCam.tscn" type="PackedScene" id=12] [ext_resource path="res://src/Environment/ShaderGrass.tscn" type="PackedScene" id=13] @@ -25,7 +24,6 @@ __meta__ = { [node name="LevelState" parent="." instance=ExtResource( 9 )] unique_name_in_owner = true -script = ExtResource( 10 ) [node name="UserInterface" parent="." instance=ExtResource( 7 )] @@ -36,10 +34,10 @@ wait_time = 20.0 drag_margin_bottom = 0.3 [node name="AnimatedSprite" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="4"] -frame = 1 +frame = 10 [node name="AnimatedSprite2" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="5"] -frame = 5 +frame = 0 [node name="Blobby" parent="." instance=ExtResource( 2 )] unique_name_in_owner = true diff --git a/src/Levels/02 Level.tscn b/src/Levels/02 Level.tscn index 788a4ef..b396f6f 100644 --- a/src/Levels/02 Level.tscn +++ b/src/Levels/02 Level.tscn @@ -1,13 +1,12 @@ -[gd_scene load_steps=18 format=2] +[gd_scene load_steps=17 format=2] [ext_resource path="res://src/Environment/AlienShipTileSet.tres" type="TileSet" id=1] [ext_resource path="res://src/Actors/Blobby/Blobby.tscn" type="PackedScene" id=2] [ext_resource path="res://src/ObstacleObjects/Spikes.tscn" type="PackedScene" id=3] [ext_resource path="res://src/Levels/03 Level.tscn" type="PackedScene" id=4] -[ext_resource path="res://src/Contraptions/Platform/FlyingPlatform.gd" type="Script" id=5] +[ext_resource path="res://src/Platforms/FlyingPlatform.gd" type="Script" id=5] [ext_resource path="res://src/Contraptions/Portal/Portal.tscn" type="PackedScene" id=6] [ext_resource path="res://src/UserInterface/UserInterface.tscn" type="PackedScene" id=7] -[ext_resource path="res://src/Utilities/LevelState.gd" type="Script" id=8] [ext_resource path="res://assets/contraption/FlyingPlatformClean.png" type="Texture" id=9] [ext_resource path="res://src/Utilities/SignalManager.tscn" type="PackedScene" id=10] [ext_resource path="res://src/Utilities/LevelState.tscn" type="PackedScene" id=11] @@ -79,7 +78,6 @@ __meta__ = { [node name="LevelState" parent="." instance=ExtResource( 11 )] unique_name_in_owner = true -script = ExtResource( 8 ) [node name="UserInterface" parent="." instance=ExtResource( 7 )] @@ -89,10 +87,10 @@ wait_time = 20.0 [node name="BlobbyCam" parent="." instance=ExtResource( 12 )] [node name="AnimatedSprite" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="4"] -frame = 0 +frame = 6 [node name="AnimatedSprite2" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="5"] -frame = 5 +frame = 11 [node name="Blobby" parent="." instance=ExtResource( 2 )] unique_name_in_owner = true diff --git a/src/Levels/03 Level.tscn b/src/Levels/03 Level.tscn index 1228535..7b3c2e5 100644 --- a/src/Levels/03 Level.tscn +++ b/src/Levels/03 Level.tscn @@ -1,10 +1,9 @@ -[gd_scene load_steps=53 format=2] +[gd_scene load_steps=52 format=2] -[ext_resource path="res://src/Utilities/LevelState.gd" type="Script" id=1] [ext_resource path="res://src/Environment/AlienShipTileSet.tres" type="TileSet" id=2] -[ext_resource path="res://src/Contraptions/Platform/DropThroughPlatform.tscn" type="PackedScene" id=3] +[ext_resource path="res://src/Platforms/DropThroughPlatform.tscn" type="PackedScene" id=3] [ext_resource path="res://src/Actors/Blobby/Blobby.tscn" type="PackedScene" id=4] -[ext_resource path="res://src/Contraptions/Platform/SpringPhysics.gd" type="Script" id=5] +[ext_resource path="res://src/Platforms/SpringPhysics.gd" type="Script" id=5] [ext_resource path="res://assets/contraption/SpringHolder/SpringHolder2.png" type="Texture" id=6] [ext_resource path="res://assets/contraption/SpringHolder/SpringHolder17.png" type="Texture" id=7] [ext_resource path="res://assets/contraption/SpringHolder/SpringHolder13.png" type="Texture" id=8] @@ -42,7 +41,7 @@ [ext_resource path="res://assets/contraption/SpringHolder/SpringHolder25.png" type="Texture" id=40] [ext_resource path="res://src/Actors/Enemies/Beings/Flyer.tscn" type="PackedScene" id=41] [ext_resource path="res://src/Contraptions/Portal/Portal.tscn" type="PackedScene" id=42] -[ext_resource path="res://src/Contraptions/Platform/FlyingPlatformClean.tscn" type="PackedScene" id=43] +[ext_resource path="res://src/Platforms/FlyingPlatformClean.tscn" type="PackedScene" id=43] [ext_resource path="res://src/Actors/Enemies/Beings/BoundFrog.tscn" type="PackedScene" id=44] [ext_resource path="res://src/Utilities/SignalManager.tscn" type="PackedScene" id=45] [ext_resource path="res://src/Utilities/LevelState.tscn" type="PackedScene" id=46] @@ -78,7 +77,6 @@ __meta__ = { [node name="LevelState" parent="." instance=ExtResource( 46 )] unique_name_in_owner = true -script = ExtResource( 1 ) [node name="UserInterface" parent="." instance=ExtResource( 9 )] diff --git a/src/Levels/Enemy Test Level.tscn b/src/Levels/Enemy Test Level.tscn index 8fc33f0..98eb7a1 100644 --- a/src/Levels/Enemy Test Level.tscn +++ b/src/Levels/Enemy Test Level.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=15 format=2] +[gd_scene load_steps=14 format=2] [ext_resource path="res://src/Actors/Blobby/Blobby.tscn" type="PackedScene" id=1] [ext_resource path="res://assets/environment/blocks/legacy/24BlockBasic.png" type="Texture" id=2] @@ -9,7 +9,6 @@ [ext_resource path="res://src/Actors/Enemies/Beings/SmortEnemy.tscn" type="PackedScene" id=7] [ext_resource path="res://src/Actors/Enemies/Beings/DartingEnemy.tscn" type="PackedScene" id=8] [ext_resource path="res://src/Actors/BlobbyCam.tscn" type="PackedScene" id=9] -[ext_resource path="res://src/Utilities/LevelState.gd" type="Script" id=10] [ext_resource path="res://src/Utilities/SignalManager.tscn" type="PackedScene" id=11] [ext_resource path="res://src/Utilities/LevelState.tscn" type="PackedScene" id=12] @@ -49,7 +48,6 @@ __meta__ = { [node name="LevelState" parent="." instance=ExtResource( 12 )] unique_name_in_owner = true -script = ExtResource( 10 ) [node name="UserInterface" parent="." instance=ExtResource( 3 )] diff --git a/src/Levels/Flyer Test Level.tscn b/src/Levels/Flyer Test Level.tscn index b6ae140..8aeafe9 100644 --- a/src/Levels/Flyer Test Level.tscn +++ b/src/Levels/Flyer Test Level.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=15 format=2] +[gd_scene load_steps=14 format=2] [ext_resource path="res://src/Environment/AlienShipTileSet.tres" type="TileSet" id=1] -[ext_resource path="res://src/Utilities/LevelState.gd" type="Script" id=2] [ext_resource path="res://src/Contraptions/Triggers/ElevatorButton.tscn" type="PackedScene" id=3] [ext_resource path="res://src/Actors/BlobbyCam.tscn" type="PackedScene" id=4] [ext_resource path="res://src/Utilities/SignalManager.tscn" type="PackedScene" id=5] @@ -27,7 +26,6 @@ __meta__ = { [node name="LevelState" parent="." instance=ExtResource( 9 )] unique_name_in_owner = true -script = ExtResource( 2 ) [node name="TileMap" type="TileMap" parent="."] unique_name_in_owner = true diff --git a/src/Levels/Froggy Test Level.tscn b/src/Levels/Froggy Test Level.tscn index ac0fc80..69c2376 100644 --- a/src/Levels/Froggy Test Level.tscn +++ b/src/Levels/Froggy Test Level.tscn @@ -1,20 +1,19 @@ -[gd_scene load_steps=20 format=2] +[gd_scene load_steps=19 format=2] [ext_resource path="res://src/Environment/AlienShipTileSet.tres" type="TileSet" id=1] -[ext_resource path="res://src/Utilities/LevelState.gd" type="Script" id=2] [ext_resource path="res://src/Contraptions/Triggers/ElevatorButton.tscn" type="PackedScene" id=3] [ext_resource path="res://src/Actors/BlobbyCam.tscn" type="PackedScene" id=4] [ext_resource path="res://src/NeutralObjects/Coin.tscn" type="PackedScene" id=5] [ext_resource path="res://src/Contraptions/Portal/Portal.tscn" type="PackedScene" id=6] [ext_resource path="res://src/Levels/Enemy Test Level.tscn" type="PackedScene" id=7] -[ext_resource path="res://src/Contraptions/Platform/FlyingLaserCutter.tscn" type="PackedScene" id=8] +[ext_resource path="res://src/Platforms/FlyingLaserCutter.tscn" type="PackedScene" id=8] [ext_resource path="res://src/Actors/Enemies/Beings/BoundFrog.tscn" type="PackedScene" id=9] [ext_resource path="res://src/Contraptions/Triggers/ThreeWhyButtons.tscn" type="PackedScene" id=10] [ext_resource path="res://src/ObstacleObjects/Spikes.tscn" type="PackedScene" id=11] [ext_resource path="res://src/Actors/Blobby/Blobby.tscn" type="PackedScene" id=12] [ext_resource path="res://src/UserInterface/UserInterface.tscn" type="PackedScene" id=13] [ext_resource path="res://src/Actors/Enemies/Beings/Flyer.tscn" type="PackedScene" id=14] -[ext_resource path="res://src/Contraptions/Platform/SpringPlatform.tscn" type="PackedScene" id=15] +[ext_resource path="res://src/Platforms/SpringPlatform.tscn" type="PackedScene" id=15] [ext_resource path="res://src/Utilities/SignalManager.tscn" type="PackedScene" id=16] [ext_resource path="res://src/Utilities/LevelState.tscn" type="PackedScene" id=17] @@ -32,7 +31,6 @@ __meta__ = { [node name="LevelState" parent="." instance=ExtResource( 17 )] unique_name_in_owner = true -script = ExtResource( 2 ) [node name="UserInterface" parent="." instance=ExtResource( 13 )] diff --git a/src/Levels/Grass Test Level.tscn b/src/Levels/Grass Test Level.tscn index 4bea81d..d7a191e 100644 --- a/src/Levels/Grass Test Level.tscn +++ b/src/Levels/Grass Test Level.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=10 format=2] +[gd_scene load_steps=9 format=2] [ext_resource path="res://src/Environment/AlienShipTileSet.tres" type="TileSet" id=1] -[ext_resource path="res://src/Utilities/LevelState.gd" type="Script" id=2] [ext_resource path="res://src/Utilities/SignalManager.tscn" type="PackedScene" id=3] [ext_resource path="res://src/Utilities/LevelState.tscn" type="PackedScene" id=4] [ext_resource path="res://src/Environment/ShaderGrass.tscn" type="PackedScene" id=5] @@ -22,7 +21,6 @@ __meta__ = { [node name="LevelState" parent="." instance=ExtResource( 4 )] unique_name_in_owner = true -script = ExtResource( 2 ) [node name="UserInterface" parent="." instance=ExtResource( 6 )] @@ -221,10 +219,10 @@ position = Vector2( 210, -15 ) [node name="BlobbyCam" parent="." instance=ExtResource( 11 )] [node name="AnimatedSprite" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="4"] -frame = 9 +frame = 7 [node name="AnimatedSprite2" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="5"] -frame = 0 +frame = 12 [node name="Blobby" parent="." instance=ExtResource( 10 )] unique_name_in_owner = true diff --git a/src/Levels/LevelTemplate.tscn b/src/Levels/LevelTemplate.tscn index 54d5190..fb24997 100644 --- a/src/Levels/LevelTemplate.tscn +++ b/src/Levels/LevelTemplate.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=12 format=2] +[gd_scene load_steps=11 format=2] [ext_resource path="res://src/Environment/AlienShipTileSet.tres" type="TileSet" id=1] [ext_resource path="res://src/Actors/Blobby/Blobby.tscn" type="PackedScene" id=2] @@ -8,7 +8,6 @@ [ext_resource path="res://src/Utilities/LevelState.tscn" type="PackedScene" id=6] [ext_resource path="res://src/UserInterface/UserInterface.tscn" type="PackedScene" id=7] [ext_resource path="res://src/Utilities/SignalManager.tscn" type="PackedScene" id=8] -[ext_resource path="res://src/Utilities/LevelState.gd" type="Script" id=9] [ext_resource path="res://src/Actors/BlobbyCam.tscn" type="PackedScene" id=12] [sub_resource type="AnimationNodeStateMachinePlayback" id=4] @@ -23,7 +22,6 @@ __meta__ = { [node name="LevelState" parent="." instance=ExtResource( 6 )] unique_name_in_owner = true -script = ExtResource( 9 ) [node name="UserInterface" parent="." instance=ExtResource( 7 )] unique_name_in_owner = true diff --git a/src/Contraptions/Platform/DropThroughPlatform.tscn b/src/Platforms/DropThroughPlatform.tscn similarity index 100% rename from src/Contraptions/Platform/DropThroughPlatform.tscn rename to src/Platforms/DropThroughPlatform.tscn diff --git a/src/Contraptions/Platform/FlyingLaserCutter.gd b/src/Platforms/FlyingLaserCutter.gd similarity index 100% rename from src/Contraptions/Platform/FlyingLaserCutter.gd rename to src/Platforms/FlyingLaserCutter.gd diff --git a/src/Contraptions/Platform/FlyingLaserCutter.png.import b/src/Platforms/FlyingLaserCutter.png.import similarity index 100% rename from src/Contraptions/Platform/FlyingLaserCutter.png.import rename to src/Platforms/FlyingLaserCutter.png.import diff --git a/src/Contraptions/Platform/FlyingLaserCutter.tscn b/src/Platforms/FlyingLaserCutter.tscn similarity index 93% rename from src/Contraptions/Platform/FlyingLaserCutter.tscn rename to src/Platforms/FlyingLaserCutter.tscn index e664274..2ddaa8c 100644 --- a/src/Contraptions/Platform/FlyingLaserCutter.tscn +++ b/src/Platforms/FlyingLaserCutter.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=6 format=2] -[ext_resource path="res://src/Contraptions/Platform/FlyingLaserCutter.gd" type="Script" id=1] -[ext_resource path="res://assets/contraption/FlyingLaserCutterShaded.png" type="Texture" id=2] +[ext_resource path="res://assets/contraption/FlyingLaserCutterShaded.png" type="Texture" id=1] +[ext_resource path="res://src/Platforms/FlyingLaserCutter.gd" type="Script" id=2] [sub_resource type="Animation" id=2] length = 2.4 @@ -26,7 +26,7 @@ extents = Vector2( 11.4921, 11.9129 ) extents = Vector2( 3.067, 10.5 ) [node name="FlyingLaserCutter" type="Node2D"] -script = ExtResource( 1 ) +script = ExtResource( 2 ) [node name="FlyingLaserCutterBody" type="KinematicBody2D" parent="."] collision_layer = 32 @@ -34,7 +34,7 @@ collision_mask = 57 collision/safe_margin = 0.001 [node name="Sprite" type="Sprite" parent="FlyingLaserCutterBody"] -texture = ExtResource( 2 ) +texture = ExtResource( 1 ) hframes = 5 vframes = 5 frame = 21 diff --git a/src/Contraptions/Platform/FlyingPlatform.gd b/src/Platforms/FlyingPlatform.gd similarity index 100% rename from src/Contraptions/Platform/FlyingPlatform.gd rename to src/Platforms/FlyingPlatform.gd diff --git a/src/Contraptions/Platform/FlyingPlatform.tscn b/src/Platforms/FlyingPlatform.tscn similarity index 86% rename from src/Contraptions/Platform/FlyingPlatform.tscn rename to src/Platforms/FlyingPlatform.tscn index df5e432..569a172 100644 --- a/src/Contraptions/Platform/FlyingPlatform.tscn +++ b/src/Platforms/FlyingPlatform.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://assets/contraption/FlyingPlatform.png" type="Texture" id=1] -[ext_resource path="res://src/Contraptions/Platform/FlyingPlatform.gd" type="Script" id=2] +[ext_resource path="res://src/Platforms/FlyingPlatform.gd" type="Script" id=1] +[ext_resource path="res://assets/contraption/FlyingPlatform.png" type="Texture" id=2] [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 24, 6 ) @@ -24,7 +24,7 @@ tracks/0/keys = { } [node name="FlyingPlatform" type="Node2D"] -script = ExtResource( 2 ) +script = ExtResource( 1 ) [node name="KinematicBody2D" type="KinematicBody2D" parent="."] collision_layer = 16 @@ -32,7 +32,7 @@ collision_mask = 0 motion/sync_to_physics = true [node name="Sprite" type="Sprite" parent="KinematicBody2D"] -texture = ExtResource( 1 ) +texture = ExtResource( 2 ) [node name="CollisionShape2D" type="CollisionShape2D" parent="KinematicBody2D"] visible = false diff --git a/src/Contraptions/Platform/FlyingPlatformClean.tscn b/src/Platforms/FlyingPlatformClean.tscn similarity index 92% rename from src/Contraptions/Platform/FlyingPlatformClean.tscn rename to src/Platforms/FlyingPlatformClean.tscn index 6cb4ad4..b73b8d4 100644 --- a/src/Contraptions/Platform/FlyingPlatformClean.tscn +++ b/src/Platforms/FlyingPlatformClean.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=5 format=2] [ext_resource path="res://assets/contraption/FlyingPlatformClean.png" type="Texture" id=1] -[ext_resource path="res://src/Contraptions/Platform/FlyingPlatform.gd" type="Script" id=2] +[ext_resource path="res://src/Platforms/FlyingPlatform.gd" type="Script" id=2] [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 24, 6 ) diff --git a/src/Contraptions/Platform/Simple.tscn b/src/Platforms/Simple.tscn similarity index 100% rename from src/Contraptions/Platform/Simple.tscn rename to src/Platforms/Simple.tscn diff --git a/src/Contraptions/Platform/Spring.tscn b/src/Platforms/Spring.tscn similarity index 97% rename from src/Contraptions/Platform/Spring.tscn rename to src/Platforms/Spring.tscn index 1a8e73f..68a9168 100644 --- a/src/Contraptions/Platform/Spring.tscn +++ b/src/Platforms/Spring.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=35 format=2] -[ext_resource path="res://src/Contraptions/Platform/SpringPlatform.tscn" type="PackedScene" id=1] +[ext_resource path="res://src/Platforms/SpringPlatform.tscn" type="PackedScene" id=1] [ext_resource path="res://assets/contraption/SpringHolder/SpringHolder24.png" type="Texture" id=2] [ext_resource path="res://assets/contraption/SpringHolder/SpringHolder2.png" type="Texture" id=3] [ext_resource path="res://assets/contraption/SpringHolder/SpringHolder17.png" type="Texture" id=4] diff --git a/src/Contraptions/Platform/SpringPhysics.gd b/src/Platforms/SpringPhysics.gd similarity index 97% rename from src/Contraptions/Platform/SpringPhysics.gd rename to src/Platforms/SpringPhysics.gd index 970f93e..8f166ab 100644 --- a/src/Contraptions/Platform/SpringPhysics.gd +++ b/src/Platforms/SpringPhysics.gd @@ -51,7 +51,7 @@ func _physics_process(delta: float) -> void: func _body_contact() -> bool: var areas: Array = $SpringSkin.get_overlapping_areas() for i in range(0, areas.size()): - if areas[i].name == "BlobbySkin": + if ["BlobbySkin","EnemySkin"].has(areas[i].name): coupled_body = areas[i].get_parent() return true coupled_body = null diff --git a/src/Contraptions/Platform/SpringPlatform.tscn b/src/Platforms/SpringPlatform.tscn similarity index 83% rename from src/Contraptions/Platform/SpringPlatform.tscn rename to src/Platforms/SpringPlatform.tscn index fc2c757..ffa5d11 100644 --- a/src/Contraptions/Platform/SpringPlatform.tscn +++ b/src/Platforms/SpringPlatform.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=6 format=2] -[ext_resource path="res://src/Contraptions/Platform/SpringPhysics.gd" type="Script" id=1] -[ext_resource path="res://assets/contraption/SpringPlatform.png" type="Texture" id=2] +[ext_resource path="res://assets/contraption/SpringPlatform.png" type="Texture" id=1] +[ext_resource path="res://src/Platforms/SpringPhysics.gd" type="Script" id=2] [sub_resource type="RectangleShape2D" id=2] extents = Vector2( 11.4863, 2.10568 ) @@ -13,13 +13,13 @@ extents = Vector2( 11.925, 0.0109166 ) extents = Vector2( 11.9158, 2.06284 ) [node name="SpringPlatform" type="Node2D"] -script = ExtResource( 1 ) +script = ExtResource( 2 ) [node name="Platform" type="Sprite" parent="."] -texture = ExtResource( 2 ) +texture = ExtResource( 1 ) [node name="SpringSkin" type="Area2D" parent="."] -collision_layer = 32 +collision_layer = 16 collision_mask = 3 [node name="CollisionShape2D" type="CollisionShape2D" parent="SpringSkin"] @@ -27,8 +27,8 @@ position = Vector2( -0.0412841, -1.27843 ) shape = SubResource( 2 ) [node name="SpringBody" type="KinematicBody2D" parent="."] -collision_layer = 32 -collision_mask = 41 +collision_layer = 16 +collision_mask = 43 [node name="CollisionShape2D" type="CollisionShape2D" parent="SpringBody"] position = Vector2( 0.0109062, -1.5689 ) @@ -37,8 +37,8 @@ one_way_collision = true [node name="EnteringVelocityDetector" type="Area2D" parent="."] position = Vector2( 0, -3.04889 ) -collision_layer = 32 -collision_mask = 41 +collision_layer = 16 +collision_mask = 43 [node name="CollisionShape2D" type="CollisionShape2D" parent="EnteringVelocityDetector"] position = Vector2( 0.00395775, -1.07744 )