Frogs compatible with springs

This commit is contained in:
Jakob Feldmann 2023-03-13 18:49:22 +01:00
parent d5197ea39e
commit 1fd9f6b690
20 changed files with 43 additions and 61 deletions

View File

@ -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"]]

View File

@ -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

View File

@ -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

View File

@ -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 )]

View File

@ -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 )]

View File

@ -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

View File

@ -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 )]

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 )

View File

@ -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]

View File

@ -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

View File

@ -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 )