From 7d62b37ffcd3535caefefc29de6d90d0fac55d32 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 25 May 2022 16:13:29 -0400 Subject: [PATCH 01/12] add enemy scenes --- .../enemies/blightwing/Blightwing.tscn | 54 +++++++++++++++++++ .../enemies/blockface/Blockface.tscn | 36 +++++++++++++ .../enemies/dreadtooth/Dreadtooth.tscn | 43 +++++++++++++++ .../enemies/gravevine/Gravevine.tscn | 33 ++++++++++++ godot/characters/enemies/shelly/Shelly.tscn | 42 +++++++++++++++ .../enemies/spikeball/Spikeball.tscn | 26 +++++++++ .../enemies/super_shelly/SuperShelly.tscn | 42 +++++++++++++++ 7 files changed, 276 insertions(+) create mode 100644 godot/characters/enemies/blightwing/Blightwing.tscn create mode 100644 godot/characters/enemies/blockface/Blockface.tscn create mode 100644 godot/characters/enemies/dreadtooth/Dreadtooth.tscn create mode 100644 godot/characters/enemies/gravevine/Gravevine.tscn create mode 100644 godot/characters/enemies/shelly/Shelly.tscn create mode 100644 godot/characters/enemies/spikeball/Spikeball.tscn create mode 100644 godot/characters/enemies/super_shelly/SuperShelly.tscn diff --git a/godot/characters/enemies/blightwing/Blightwing.tscn b/godot/characters/enemies/blightwing/Blightwing.tscn new file mode 100644 index 0000000..9292664 --- /dev/null +++ b/godot/characters/enemies/blightwing/Blightwing.tscn @@ -0,0 +1,54 @@ +[gd_scene load_steps=9 format=2] + +[ext_resource path="res://assets/characters/characters.png" type="Texture" id=1] +[ext_resource path="res://characters/enemies/blightwing/Blightwing.gd" type="Script" id=2] + +[sub_resource type="AtlasTexture" id=1] +atlas = ExtResource( 1 ) +region = Rect2( 144, 48, 24, 24 ) + +[sub_resource type="AtlasTexture" id=2] +atlas = ExtResource( 1 ) +region = Rect2( 168, 48, 24, 24 ) + +[sub_resource type="AtlasTexture" id=3] +atlas = ExtResource( 1 ) +region = Rect2( 192, 48, 24, 24 ) + +[sub_resource type="SpriteFrames" id=4] +animations = [ { +"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 2 ) ], +"loop": true, +"name": "fly", +"speed": 6.0 +} ] + +[sub_resource type="RectangleShape2D" id=5] +extents = Vector2( 5, 5 ) + +[sub_resource type="RectangleShape2D" id=6] +extents = Vector2( 6, 5 ) + +[node name="Blightwing" type="KinematicBody2D"] +collision_layer = 4 +collision_mask = 3 +script = ExtResource( 2 ) + +[node name="AnimatedSprite" type="AnimatedSprite" parent="."] +frames = SubResource( 4 ) +animation = "fly" +frame = 3 +playing = true + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2( 3.47893e-06, 0.999998 ) +rotation = 1.5708 +shape = SubResource( 5 ) + +[node name="Area2D" type="Area2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] +position = Vector2( 0, 2 ) +shape = SubResource( 6 ) + +[connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered"] diff --git a/godot/characters/enemies/blockface/Blockface.tscn b/godot/characters/enemies/blockface/Blockface.tscn new file mode 100644 index 0000000..9d2136b --- /dev/null +++ b/godot/characters/enemies/blockface/Blockface.tscn @@ -0,0 +1,36 @@ +[gd_scene load_steps=6 format=2] + +[ext_resource path="res://assets/characters/characters.png" type="Texture" id=1] + +[sub_resource type="AtlasTexture" id=1] +atlas = ExtResource( 1 ) +region = Rect2( 96, 24, 24, 24 ) + +[sub_resource type="AtlasTexture" id=2] +atlas = ExtResource( 1 ) +region = Rect2( 120, 24, 24, 24 ) + +[sub_resource type="SpriteFrames" id=3] +animations = [ { +"frames": [ SubResource( 1 ) ], +"loop": true, +"name": "normal", +"speed": 5.0 +}, { +"frames": [ SubResource( 2 ) ], +"loop": true, +"name": "angry", +"speed": 5.0 +} ] + +[sub_resource type="RectangleShape2D" id=4] +extents = Vector2( 9, 9 ) + +[node name="Blockface" type="KinematicBody2D"] + +[node name="AnimatedSprite" type="AnimatedSprite" parent="."] +frames = SubResource( 3 ) +animation = "normal" + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource( 4 ) diff --git a/godot/characters/enemies/dreadtooth/Dreadtooth.tscn b/godot/characters/enemies/dreadtooth/Dreadtooth.tscn new file mode 100644 index 0000000..eaa6d59 --- /dev/null +++ b/godot/characters/enemies/dreadtooth/Dreadtooth.tscn @@ -0,0 +1,43 @@ +[gd_scene load_steps=7 format=2] + +[ext_resource path="res://assets/characters/characters.png" type="Texture" id=1] + +[sub_resource type="AtlasTexture" id=1] +atlas = ExtResource( 1 ) +region = Rect2( 192, 24, 24, 24 ) + +[sub_resource type="AtlasTexture" id=2] +atlas = ExtResource( 1 ) +region = Rect2( 144, 24, 24, 24 ) + +[sub_resource type="AtlasTexture" id=3] +atlas = ExtResource( 1 ) +region = Rect2( 168, 24, 24, 24 ) + +[sub_resource type="SpriteFrames" id=4] +animations = [ { +"frames": [ SubResource( 1 ) ], +"loop": true, +"name": "hide", +"speed": 5.0 +}, { +"frames": [ SubResource( 2 ), SubResource( 3 ) ], +"loop": true, +"name": "walk", +"speed": 5.0 +} ] + +[sub_resource type="RectangleShape2D" id=5] +extents = Vector2( 7.5, 8.5 ) + +[node name="Dreadtooth" type="KinematicBody2D"] + +[node name="AnimatedSprite" type="AnimatedSprite" parent="."] +frames = SubResource( 4 ) +animation = "walk" +frame = 1 +playing = true + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2( -0.5, 3.5 ) +shape = SubResource( 5 ) diff --git a/godot/characters/enemies/gravevine/Gravevine.tscn b/godot/characters/enemies/gravevine/Gravevine.tscn new file mode 100644 index 0000000..f4250f2 --- /dev/null +++ b/godot/characters/enemies/gravevine/Gravevine.tscn @@ -0,0 +1,33 @@ +[gd_scene load_steps=6 format=2] + +[ext_resource path="res://assets/characters/characters.png" type="Texture" id=1] + +[sub_resource type="AtlasTexture" id=1] +atlas = ExtResource( 1 ) +region = Rect2( 48, 24, 24, 24 ) + +[sub_resource type="AtlasTexture" id=2] +atlas = ExtResource( 1 ) +region = Rect2( 72, 24, 24, 24 ) + +[sub_resource type="SpriteFrames" id=3] +animations = [ { +"frames": [ SubResource( 1 ), SubResource( 2 ) ], +"loop": true, +"name": "default", +"speed": 5.0 +} ] + +[sub_resource type="RectangleShape2D" id=4] +extents = Vector2( 5.5, 7.5 ) + +[node name="Gravevine" type="KinematicBody2D"] + +[node name="AnimatedSprite" type="AnimatedSprite" parent="."] +frames = SubResource( 3 ) +frame = 1 +playing = true + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2( -0.5, 0.5 ) +shape = SubResource( 4 ) diff --git a/godot/characters/enemies/shelly/Shelly.tscn b/godot/characters/enemies/shelly/Shelly.tscn new file mode 100644 index 0000000..1a995a5 --- /dev/null +++ b/godot/characters/enemies/shelly/Shelly.tscn @@ -0,0 +1,42 @@ +[gd_scene load_steps=7 format=2] + +[ext_resource path="res://assets/characters/characters.png" type="Texture" id=1] + +[sub_resource type="AtlasTexture" id=1] +atlas = ExtResource( 1 ) +region = Rect2( 48, 48, 24, 24 ) + +[sub_resource type="AtlasTexture" id=2] +atlas = ExtResource( 1 ) +region = Rect2( 0, 48, 24, 24 ) + +[sub_resource type="AtlasTexture" id=3] +atlas = ExtResource( 1 ) +region = Rect2( 24, 48, 24, 24 ) + +[sub_resource type="SpriteFrames" id=4] +animations = [ { +"frames": [ SubResource( 1 ) ], +"loop": true, +"name": "hide", +"speed": 5.0 +}, { +"frames": [ SubResource( 2 ), SubResource( 3 ) ], +"loop": true, +"name": "walk", +"speed": 3.0 +} ] + +[sub_resource type="RectangleShape2D" id=5] +extents = Vector2( 7.5, 7 ) + +[node name="Shelly" type="KinematicBody2D"] + +[node name="AnimatedSprite" type="AnimatedSprite" parent="."] +frames = SubResource( 4 ) +animation = "walk" +playing = true + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2( 1, 5 ) +shape = SubResource( 5 ) diff --git a/godot/characters/enemies/spikeball/Spikeball.tscn b/godot/characters/enemies/spikeball/Spikeball.tscn new file mode 100644 index 0000000..1ab881e --- /dev/null +++ b/godot/characters/enemies/spikeball/Spikeball.tscn @@ -0,0 +1,26 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://assets/characters/characters.png" type="Texture" id=1] + +[sub_resource type="AtlasTexture" id=1] +atlas = ExtResource( 1 ) +region = Rect2( 192, 0, 24, 24 ) + +[sub_resource type="SpriteFrames" id=2] +animations = [ { +"frames": [ SubResource( 1 ) ], +"loop": true, +"name": "default", +"speed": 5.0 +} ] + +[sub_resource type="CircleShape2D" id=3] +radius = 9.05539 + +[node name="Spikeball" type="KinematicBody2D"] + +[node name="AnimatedSprite" type="AnimatedSprite" parent="."] +frames = SubResource( 2 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource( 3 ) diff --git a/godot/characters/enemies/super_shelly/SuperShelly.tscn b/godot/characters/enemies/super_shelly/SuperShelly.tscn new file mode 100644 index 0000000..f8e1606 --- /dev/null +++ b/godot/characters/enemies/super_shelly/SuperShelly.tscn @@ -0,0 +1,42 @@ +[gd_scene load_steps=7 format=2] + +[ext_resource path="res://assets/characters/characters.png" type="Texture" id=1] + +[sub_resource type="AtlasTexture" id=1] +atlas = ExtResource( 1 ) +region = Rect2( 120, 48, 24, 24 ) + +[sub_resource type="AtlasTexture" id=2] +atlas = ExtResource( 1 ) +region = Rect2( 72, 48, 24, 24 ) + +[sub_resource type="AtlasTexture" id=3] +atlas = ExtResource( 1 ) +region = Rect2( 96, 48, 24, 24 ) + +[sub_resource type="SpriteFrames" id=4] +animations = [ { +"frames": [ SubResource( 1 ) ], +"loop": true, +"name": "hide", +"speed": 5.0 +}, { +"frames": [ SubResource( 2 ), SubResource( 3 ) ], +"loop": true, +"name": "walk", +"speed": 3.0 +} ] + +[sub_resource type="RectangleShape2D" id=5] +extents = Vector2( 12, 11 ) + +[node name="SuperShelly" type="KinematicBody2D"] + +[node name="AnimatedSprite" type="AnimatedSprite" parent="."] +frames = SubResource( 4 ) +animation = "walk" +playing = true + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2( 0, 1 ) +shape = SubResource( 5 ) -- 2.30.2 From 4196f4d9e97069d6cbf63bf24f9d14268687aea1 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Fri, 17 Jun 2022 11:33:58 -0400 Subject: [PATCH 02/12] change collision layers and masks --- .../enemies/blightwing/Blightwing.tscn | 21 ++++--------------- .../enemies/blockface/Blockface.tscn | 2 ++ .../enemies/dreadtooth/Dreadtooth.tscn | 3 ++- .../enemies/gravevine/Gravevine.tscn | 3 ++- godot/characters/enemies/shelly/Shelly.tscn | 2 ++ .../enemies/spikeball/Spikeball.tscn | 2 ++ .../enemies/super_shelly/SuperShelly.tscn | 3 +++ 7 files changed, 17 insertions(+), 19 deletions(-) diff --git a/godot/characters/enemies/blightwing/Blightwing.tscn b/godot/characters/enemies/blightwing/Blightwing.tscn index 9292664..d6cefca 100644 --- a/godot/characters/enemies/blightwing/Blightwing.tscn +++ b/godot/characters/enemies/blightwing/Blightwing.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=7 format=2] [ext_resource path="res://assets/characters/characters.png" type="Texture" id=1] -[ext_resource path="res://characters/enemies/blightwing/Blightwing.gd" type="Script" id=2] [sub_resource type="AtlasTexture" id=1] atlas = ExtResource( 1 ) @@ -26,29 +25,17 @@ animations = [ { [sub_resource type="RectangleShape2D" id=5] extents = Vector2( 5, 5 ) -[sub_resource type="RectangleShape2D" id=6] -extents = Vector2( 6, 5 ) - [node name="Blightwing" type="KinematicBody2D"] -collision_layer = 4 -collision_mask = 3 -script = ExtResource( 2 ) +collision_layer = 8 +collision_mask = 11 [node name="AnimatedSprite" type="AnimatedSprite" parent="."] frames = SubResource( 4 ) animation = "fly" -frame = 3 +frame = 1 playing = true [node name="CollisionShape2D" type="CollisionShape2D" parent="."] position = Vector2( 3.47893e-06, 0.999998 ) rotation = 1.5708 shape = SubResource( 5 ) - -[node name="Area2D" type="Area2D" parent="."] - -[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] -position = Vector2( 0, 2 ) -shape = SubResource( 6 ) - -[connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered"] diff --git a/godot/characters/enemies/blockface/Blockface.tscn b/godot/characters/enemies/blockface/Blockface.tscn index 9d2136b..95d9f42 100644 --- a/godot/characters/enemies/blockface/Blockface.tscn +++ b/godot/characters/enemies/blockface/Blockface.tscn @@ -27,6 +27,8 @@ animations = [ { extents = Vector2( 9, 9 ) [node name="Blockface" type="KinematicBody2D"] +collision_layer = 8 +collision_mask = 11 [node name="AnimatedSprite" type="AnimatedSprite" parent="."] frames = SubResource( 3 ) diff --git a/godot/characters/enemies/dreadtooth/Dreadtooth.tscn b/godot/characters/enemies/dreadtooth/Dreadtooth.tscn index eaa6d59..85f3f7b 100644 --- a/godot/characters/enemies/dreadtooth/Dreadtooth.tscn +++ b/godot/characters/enemies/dreadtooth/Dreadtooth.tscn @@ -31,11 +31,12 @@ animations = [ { extents = Vector2( 7.5, 8.5 ) [node name="Dreadtooth" type="KinematicBody2D"] +collision_layer = 8 +collision_mask = 11 [node name="AnimatedSprite" type="AnimatedSprite" parent="."] frames = SubResource( 4 ) animation = "walk" -frame = 1 playing = true [node name="CollisionShape2D" type="CollisionShape2D" parent="."] diff --git a/godot/characters/enemies/gravevine/Gravevine.tscn b/godot/characters/enemies/gravevine/Gravevine.tscn index f4250f2..734c8c2 100644 --- a/godot/characters/enemies/gravevine/Gravevine.tscn +++ b/godot/characters/enemies/gravevine/Gravevine.tscn @@ -22,10 +22,11 @@ animations = [ { extents = Vector2( 5.5, 7.5 ) [node name="Gravevine" type="KinematicBody2D"] +collision_layer = 8 +collision_mask = 11 [node name="AnimatedSprite" type="AnimatedSprite" parent="."] frames = SubResource( 3 ) -frame = 1 playing = true [node name="CollisionShape2D" type="CollisionShape2D" parent="."] diff --git a/godot/characters/enemies/shelly/Shelly.tscn b/godot/characters/enemies/shelly/Shelly.tscn index 1a995a5..c476a4f 100644 --- a/godot/characters/enemies/shelly/Shelly.tscn +++ b/godot/characters/enemies/shelly/Shelly.tscn @@ -31,6 +31,8 @@ animations = [ { extents = Vector2( 7.5, 7 ) [node name="Shelly" type="KinematicBody2D"] +collision_layer = 8 +collision_mask = 11 [node name="AnimatedSprite" type="AnimatedSprite" parent="."] frames = SubResource( 4 ) diff --git a/godot/characters/enemies/spikeball/Spikeball.tscn b/godot/characters/enemies/spikeball/Spikeball.tscn index 1ab881e..2dc1708 100644 --- a/godot/characters/enemies/spikeball/Spikeball.tscn +++ b/godot/characters/enemies/spikeball/Spikeball.tscn @@ -18,6 +18,8 @@ animations = [ { radius = 9.05539 [node name="Spikeball" type="KinematicBody2D"] +collision_layer = 8 +collision_mask = 11 [node name="AnimatedSprite" type="AnimatedSprite" parent="."] frames = SubResource( 2 ) diff --git a/godot/characters/enemies/super_shelly/SuperShelly.tscn b/godot/characters/enemies/super_shelly/SuperShelly.tscn index f8e1606..e10aa6f 100644 --- a/godot/characters/enemies/super_shelly/SuperShelly.tscn +++ b/godot/characters/enemies/super_shelly/SuperShelly.tscn @@ -31,10 +31,13 @@ animations = [ { extents = Vector2( 12, 11 ) [node name="SuperShelly" type="KinematicBody2D"] +collision_layer = 8 +collision_mask = 11 [node name="AnimatedSprite" type="AnimatedSprite" parent="."] frames = SubResource( 4 ) animation = "walk" +frame = 1 playing = true [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -- 2.30.2 From 9aafc64ba77e52697d1500b274afef88bc0cfe5b Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Fri, 17 Jun 2022 11:35:15 -0400 Subject: [PATCH 03/12] add enemies prototype level --- godot/levels/PrototypeEnemies.tmx | 40 +++++++++++++ godot/levels/PrototypeEnemies.tmx.import | 24 ++++++++ godot/levels/PrototypeEnemies.tscn | 72 ++++++++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 godot/levels/PrototypeEnemies.tmx create mode 100644 godot/levels/PrototypeEnemies.tmx.import create mode 100644 godot/levels/PrototypeEnemies.tscn diff --git a/godot/levels/PrototypeEnemies.tmx b/godot/levels/PrototypeEnemies.tmx new file mode 100644 index 0000000..e817cdf --- /dev/null +++ b/godot/levels/PrototypeEnemies.tmx @@ -0,0 +1,40 @@ + + + + + +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24 + + + diff --git a/godot/levels/PrototypeEnemies.tmx.import b/godot/levels/PrototypeEnemies.tmx.import new file mode 100644 index 0000000..3d78c8b --- /dev/null +++ b/godot/levels/PrototypeEnemies.tmx.import @@ -0,0 +1,24 @@ +[remap] + +importer="vnen.tiled_importer" +type="PackedScene" +path="res://.import/PrototypeEnemies.tmx-5728a1d35b5e3ba88a2df2406b1cd931.scn" + +[deps] + +source_file="res://levels/PrototypeEnemies.tmx" +dest_files=[ "res://.import/PrototypeEnemies.tmx-5728a1d35b5e3ba88a2df2406b1cd931.scn" ] + +[params] + +custom_properties=true +tile_metadata=false +uv_clip=true +y_sort=false +image_flags=7 +collision_layer=2 +collision_mask=0 +embed_internal_images=false +save_tiled_properties=false +add_background=true +post_import_script="" diff --git a/godot/levels/PrototypeEnemies.tscn b/godot/levels/PrototypeEnemies.tscn new file mode 100644 index 0000000..caf427c --- /dev/null +++ b/godot/levels/PrototypeEnemies.tscn @@ -0,0 +1,72 @@ +[gd_scene load_steps=12 format=2] + +[ext_resource path="res://CameraLimit.gdns" type="Script" id=1] +[ext_resource path="res://characters/player/Player.tscn" type="PackedScene" id=2] +[ext_resource path="res://levels/PrototypeEnemies.tmx" type="PackedScene" id=3] +[ext_resource path="res://assets/backgrounds/mountains.png" type="Texture" id=4] +[ext_resource path="res://characters/enemies/gravevine/Gravevine.tscn" type="PackedScene" id=5] +[ext_resource path="res://characters/enemies/dreadtooth/Dreadtooth.tscn" type="PackedScene" id=6] +[ext_resource path="res://characters/enemies/super_shelly/SuperShelly.tscn" type="PackedScene" id=7] +[ext_resource path="res://characters/enemies/spikeball/Spikeball.tscn" type="PackedScene" id=8] +[ext_resource path="res://characters/enemies/shelly/Shelly.tscn" type="PackedScene" id=9] +[ext_resource path="res://characters/enemies/blockface/Blockface.tscn" type="PackedScene" id=10] +[ext_resource path="res://characters/enemies/blightwing/Blightwing.tscn" type="PackedScene" id=11] + +[node name="PrototypeEnemies" type="Node"] + +[node name="Player" parent="." instance=ExtResource( 2 )] +position = Vector2( 80, 488 ) + +[node name="Camera2D" type="Camera2D" parent="Player"] +current = true +limit_left = 0 +limit_top = 0 +limit_right = 512 +limit_bottom = 288 +drag_margin_h_enabled = true +drag_margin_v_enabled = true +__meta__ = { +"_edit_bone_": true +} + +[node name="VisibilityNotifier2D" type="VisibilityNotifier2D" parent="Player/Camera2D"] +rect = Rect2( 0, 0, 24, 24 ) + +[node name="ParallaxBackground" type="ParallaxBackground" parent="."] + +[node name="ParallaxLayer" type="ParallaxLayer" parent="ParallaxBackground"] +motion_scale = Vector2( 0.2, 0.1 ) +motion_offset = Vector2( 0, -288 ) +motion_mirroring = Vector2( 528, 0 ) + +[node name="Sprite" type="Sprite" parent="ParallaxBackground/ParallaxLayer"] +texture = ExtResource( 4 ) +centered = false + +[node name="Map" type="Node" parent="."] + +[node name="PrototypeEnemies" parent="Map" instance=ExtResource( 3 )] +script = ExtResource( 1 ) + +[node name="Enemies" type="Node" parent="."] + +[node name="Spikeball" parent="Enemies" instance=ExtResource( 8 )] +position = Vector2( 106, 547 ) + +[node name="Blightwing" parent="Enemies" instance=ExtResource( 11 )] +position = Vector2( 92, 516 ) + +[node name="Blockface" parent="Enemies" instance=ExtResource( 10 )] +position = Vector2( 169, 518 ) + +[node name="Dreadtooth" parent="Enemies" instance=ExtResource( 6 )] +position = Vector2( 212, 546 ) + +[node name="Gravevine" parent="Enemies" instance=ExtResource( 5 )] +position = Vector2( 250, 550 ) + +[node name="Shelly" parent="Enemies" instance=ExtResource( 9 )] +position = Vector2( 138, 546 ) + +[node name="SuperShelly" parent="Enemies" instance=ExtResource( 7 )] +position = Vector2( 62, 546 ) -- 2.30.2 From 28f7af6c735d047612837d0aa17f80277a15f70e Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Fri, 17 Jun 2022 11:35:56 -0400 Subject: [PATCH 04/12] add enemies collision name to project --- godot/project.godot | 1 + 1 file changed, 1 insertion(+) diff --git a/godot/project.godot b/godot/project.godot index 52b2be8..ca6017b 100644 --- a/godot/project.godot +++ b/godot/project.godot @@ -95,6 +95,7 @@ right={ 2d_physics/layer_1="Player" 2d_physics/layer_2="Tiles" +2d_physics/layer_4="Enemies" [physics] -- 2.30.2 From 948f4ce91197643c8b555169856a97be48a7cf5b Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Thu, 21 Jul 2022 00:05:08 -0400 Subject: [PATCH 05/12] add some enemy behavior prototypes --- godot/characters/enemies/WalkingEnemy.gd | 38 ++++++++++ .../enemies/blightwing/Blightwing.gd | 27 +++++++ .../enemies/blightwing/Blightwing.tscn | 3 +- .../characters/enemies/blockface/Blockface.gd | 27 +++++++ .../enemies/blockface/Blockface.tscn | 6 +- .../enemies/dreadtooth/Dreadtooth.gd | 1 + .../enemies/dreadtooth/Dreadtooth.tscn | 20 +++-- .../enemies/gravevine/Gravevine.tscn | 3 +- godot/characters/enemies/shelly/Shelly.gd | 1 + godot/characters/enemies/shelly/Shelly.tscn | 15 +++- .../enemies/spikeball/Spikeball.tscn | 2 +- .../enemies/super_shelly/SuperShelly.gd | 1 + .../enemies/super_shelly/SuperShelly.tscn | 15 +++- godot/characters/player/Player.tscn | 12 ++- godot/levels/PrototypeEnemies.tmx | 8 +- godot/levels/PrototypeEnemies.tmx.import | 4 +- godot/levels/PrototypeEnemies.tscn | 19 ++++- godot/project.godot | 1 + src/player/Player.cpp | 73 ++++++++++++++++++- src/player/Player.h | 26 +++++++ 20 files changed, 268 insertions(+), 34 deletions(-) create mode 100644 godot/characters/enemies/WalkingEnemy.gd create mode 100644 godot/characters/enemies/blightwing/Blightwing.gd create mode 100644 godot/characters/enemies/blockface/Blockface.gd create mode 100644 godot/characters/enemies/dreadtooth/Dreadtooth.gd create mode 100644 godot/characters/enemies/shelly/Shelly.gd create mode 100644 godot/characters/enemies/super_shelly/SuperShelly.gd diff --git a/godot/characters/enemies/WalkingEnemy.gd b/godot/characters/enemies/WalkingEnemy.gd new file mode 100644 index 0000000..c1c54b5 --- /dev/null +++ b/godot/characters/enemies/WalkingEnemy.gd @@ -0,0 +1,38 @@ +extends KinematicBody2D + + +signal player_touched + + +var velocity = Vector2() +export var direction = -1 +export var detect_edges = true +export var speed = 25 +export var gravity = 9.8 + + +func _ready() -> void: + if direction == 1: + $AnimatedSprite.flip_h = true + $FloorChecker.position.x = $CollisionShape2D.shape.get_extents().x * direction + $FloorChecker.enabled = detect_edges + + +func _physics_process(_delta: float) -> void: + if is_on_wall() or not $FloorChecker.is_colliding() and is_on_floor() and $FloorChecker.enabled: + direction *= -1 + $AnimatedSprite.flip_h = not $AnimatedSprite.flip_h + $FloorChecker.position.x = $CollisionShape2D.shape.get_extents().x * direction + + velocity.y += gravity + velocity.x = speed * direction + velocity = move_and_slide(velocity, Vector2.UP) + + for i in get_slide_count(): + var collision = get_slide_collision(i) + if collision.collider.name == "Player": + emit_signal("player_touched") + + +func squash() -> void: + queue_free() diff --git a/godot/characters/enemies/blightwing/Blightwing.gd b/godot/characters/enemies/blightwing/Blightwing.gd new file mode 100644 index 0000000..0258748 --- /dev/null +++ b/godot/characters/enemies/blightwing/Blightwing.gd @@ -0,0 +1,27 @@ +extends KinematicBody2D + + +# Declare member variables here. Examples: +# var a: int = 2 +# var b: String = "text" + + +# 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 _physics_process(delta: float) -> void: + var velocity = Vector2() + velocity.x += 1 * 50 + #velocity.y -= 1 * 50 + velocity = move_and_slide(velocity, Vector2(0, 0), true, 2) + for i in get_slide_count(): + var collision = get_slide_collision(i) + #if collision.collider.name == "Player": + # print("Blightwing: " + String(OS.get_unix_time()) + " " + collision.collider.name) + + +func _on_Area2D_body_entered(body: Node) -> void: + print(body.name) diff --git a/godot/characters/enemies/blightwing/Blightwing.tscn b/godot/characters/enemies/blightwing/Blightwing.tscn index d6cefca..b6b52af 100644 --- a/godot/characters/enemies/blightwing/Blightwing.tscn +++ b/godot/characters/enemies/blightwing/Blightwing.tscn @@ -25,14 +25,13 @@ animations = [ { [sub_resource type="RectangleShape2D" id=5] extents = Vector2( 5, 5 ) -[node name="Blightwing" type="KinematicBody2D"] +[node name="Blightwing" type="KinematicBody2D" groups=["enemy"]] collision_layer = 8 collision_mask = 11 [node name="AnimatedSprite" type="AnimatedSprite" parent="."] frames = SubResource( 4 ) animation = "fly" -frame = 1 playing = true [node name="CollisionShape2D" type="CollisionShape2D" parent="."] diff --git a/godot/characters/enemies/blockface/Blockface.gd b/godot/characters/enemies/blockface/Blockface.gd new file mode 100644 index 0000000..b307882 --- /dev/null +++ b/godot/characters/enemies/blockface/Blockface.gd @@ -0,0 +1,27 @@ +extends KinematicBody2D + + +signal player_touched + + +onready var start_position = position +var velocity = Vector2() +export var speed = 50.0 +export var fall_speed = 75.0 +var return_to_start: bool = false + + +func _physics_process(delta: float) -> void: + if return_to_start: + position = position.move_toward(start_position, speed * delta) + else: + var collision = move_and_collide(Vector2(0, (position.y + fall_speed) * delta)) + if collision: + return_to_start = true + $AnimatedSprite.play("normal") + if collision.collider.name == "Player": + emit_signal("player_touched") + + if position.y <= start_position.y: + return_to_start = false + $AnimatedSprite.play("angry") diff --git a/godot/characters/enemies/blockface/Blockface.tscn b/godot/characters/enemies/blockface/Blockface.tscn index 95d9f42..afd9d0d 100644 --- a/godot/characters/enemies/blockface/Blockface.tscn +++ b/godot/characters/enemies/blockface/Blockface.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=6 format=2] +[gd_scene load_steps=7 format=2] [ext_resource path="res://assets/characters/characters.png" type="Texture" id=1] +[ext_resource path="res://characters/enemies/blockface/Blockface.gd" type="Script" id=2] [sub_resource type="AtlasTexture" id=1] atlas = ExtResource( 1 ) @@ -26,9 +27,10 @@ animations = [ { [sub_resource type="RectangleShape2D" id=4] extents = Vector2( 9, 9 ) -[node name="Blockface" type="KinematicBody2D"] +[node name="Blockface" type="KinematicBody2D" groups=["enemy", "rideable"]] collision_layer = 8 collision_mask = 11 +script = ExtResource( 2 ) [node name="AnimatedSprite" type="AnimatedSprite" parent="."] frames = SubResource( 3 ) diff --git a/godot/characters/enemies/dreadtooth/Dreadtooth.gd b/godot/characters/enemies/dreadtooth/Dreadtooth.gd new file mode 100644 index 0000000..32e2fdf --- /dev/null +++ b/godot/characters/enemies/dreadtooth/Dreadtooth.gd @@ -0,0 +1 @@ +extends "res://characters/enemies/WalkingEnemy.gd" diff --git a/godot/characters/enemies/dreadtooth/Dreadtooth.tscn b/godot/characters/enemies/dreadtooth/Dreadtooth.tscn index 85f3f7b..8ff0f88 100644 --- a/godot/characters/enemies/dreadtooth/Dreadtooth.tscn +++ b/godot/characters/enemies/dreadtooth/Dreadtooth.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=7 format=2] +[gd_scene load_steps=8 format=2] [ext_resource path="res://assets/characters/characters.png" type="Texture" id=1] +[ext_resource path="res://characters/enemies/dreadtooth/Dreadtooth.gd" type="Script" id=2] [sub_resource type="AtlasTexture" id=1] atlas = ExtResource( 1 ) @@ -28,17 +29,26 @@ animations = [ { } ] [sub_resource type="RectangleShape2D" id=5] -extents = Vector2( 7.5, 8.5 ) +extents = Vector2( 7.5, 6.5 ) -[node name="Dreadtooth" type="KinematicBody2D"] +[node name="Dreadtooth" type="KinematicBody2D" groups=["enemy"]] collision_layer = 8 collision_mask = 11 +script = ExtResource( 2 ) [node name="AnimatedSprite" type="AnimatedSprite" parent="."] frames = SubResource( 4 ) animation = "walk" -playing = true +frame = 1 [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -position = Vector2( -0.5, 3.5 ) +position = Vector2( -0.5, 5.5 ) shape = SubResource( 5 ) + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."] +polygon = PoolVector2Array( 0, -7, 3, -4, 3, -1, -4, -1, -4, -4, -1, -7 ) + +[node name="FloorChecker" type="RayCast2D" parent="."] +enabled = true +cast_to = Vector2( 0, 20 ) +collision_mask = 10 diff --git a/godot/characters/enemies/gravevine/Gravevine.tscn b/godot/characters/enemies/gravevine/Gravevine.tscn index 734c8c2..386a83f 100644 --- a/godot/characters/enemies/gravevine/Gravevine.tscn +++ b/godot/characters/enemies/gravevine/Gravevine.tscn @@ -21,12 +21,13 @@ animations = [ { [sub_resource type="RectangleShape2D" id=4] extents = Vector2( 5.5, 7.5 ) -[node name="Gravevine" type="KinematicBody2D"] +[node name="Gravevine" type="KinematicBody2D" groups=["enemy"]] collision_layer = 8 collision_mask = 11 [node name="AnimatedSprite" type="AnimatedSprite" parent="."] frames = SubResource( 3 ) +frame = 1 playing = true [node name="CollisionShape2D" type="CollisionShape2D" parent="."] diff --git a/godot/characters/enemies/shelly/Shelly.gd b/godot/characters/enemies/shelly/Shelly.gd new file mode 100644 index 0000000..32e2fdf --- /dev/null +++ b/godot/characters/enemies/shelly/Shelly.gd @@ -0,0 +1 @@ +extends "res://characters/enemies/WalkingEnemy.gd" diff --git a/godot/characters/enemies/shelly/Shelly.tscn b/godot/characters/enemies/shelly/Shelly.tscn index c476a4f..0b23ae6 100644 --- a/godot/characters/enemies/shelly/Shelly.tscn +++ b/godot/characters/enemies/shelly/Shelly.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=7 format=2] +[gd_scene load_steps=8 format=2] [ext_resource path="res://assets/characters/characters.png" type="Texture" id=1] +[ext_resource path="res://characters/enemies/shelly/Shelly.gd" type="Script" id=2] [sub_resource type="AtlasTexture" id=1] atlas = ExtResource( 1 ) @@ -28,11 +29,12 @@ animations = [ { } ] [sub_resource type="RectangleShape2D" id=5] -extents = Vector2( 7.5, 7 ) +extents = Vector2( 7.5, 6.5 ) -[node name="Shelly" type="KinematicBody2D"] +[node name="Shelly" type="KinematicBody2D" groups=["enemy", "squashable"]] collision_layer = 8 collision_mask = 11 +script = ExtResource( 2 ) [node name="AnimatedSprite" type="AnimatedSprite" parent="."] frames = SubResource( 4 ) @@ -40,5 +42,10 @@ animation = "walk" playing = true [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -position = Vector2( 1, 5 ) +position = Vector2( 1, 5.5 ) shape = SubResource( 5 ) + +[node name="FloorChecker" type="RayCast2D" parent="."] +enabled = true +cast_to = Vector2( 0, 20 ) +collision_mask = 10 diff --git a/godot/characters/enemies/spikeball/Spikeball.tscn b/godot/characters/enemies/spikeball/Spikeball.tscn index 2dc1708..ce2caad 100644 --- a/godot/characters/enemies/spikeball/Spikeball.tscn +++ b/godot/characters/enemies/spikeball/Spikeball.tscn @@ -17,7 +17,7 @@ animations = [ { [sub_resource type="CircleShape2D" id=3] radius = 9.05539 -[node name="Spikeball" type="KinematicBody2D"] +[node name="Spikeball" type="KinematicBody2D" groups=["enemy"]] collision_layer = 8 collision_mask = 11 diff --git a/godot/characters/enemies/super_shelly/SuperShelly.gd b/godot/characters/enemies/super_shelly/SuperShelly.gd new file mode 100644 index 0000000..32e2fdf --- /dev/null +++ b/godot/characters/enemies/super_shelly/SuperShelly.gd @@ -0,0 +1 @@ +extends "res://characters/enemies/WalkingEnemy.gd" diff --git a/godot/characters/enemies/super_shelly/SuperShelly.tscn b/godot/characters/enemies/super_shelly/SuperShelly.tscn index e10aa6f..a7259db 100644 --- a/godot/characters/enemies/super_shelly/SuperShelly.tscn +++ b/godot/characters/enemies/super_shelly/SuperShelly.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=7 format=2] +[gd_scene load_steps=8 format=2] [ext_resource path="res://assets/characters/characters.png" type="Texture" id=1] +[ext_resource path="res://characters/enemies/super_shelly/SuperShelly.gd" type="Script" id=2] [sub_resource type="AtlasTexture" id=1] atlas = ExtResource( 1 ) @@ -28,11 +29,12 @@ animations = [ { } ] [sub_resource type="RectangleShape2D" id=5] -extents = Vector2( 12, 11 ) +extents = Vector2( 12, 10.5 ) -[node name="SuperShelly" type="KinematicBody2D"] +[node name="SuperShelly" type="KinematicBody2D" groups=["enemy", "squashable"]] collision_layer = 8 collision_mask = 11 +script = ExtResource( 2 ) [node name="AnimatedSprite" type="AnimatedSprite" parent="."] frames = SubResource( 4 ) @@ -41,5 +43,10 @@ frame = 1 playing = true [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -position = Vector2( 0, 1 ) +position = Vector2( 0, 1.5 ) shape = SubResource( 5 ) + +[node name="FloorChecker" type="RayCast2D" parent="."] +enabled = true +cast_to = Vector2( 0, 20 ) +collision_mask = 10 diff --git a/godot/characters/player/Player.tscn b/godot/characters/player/Player.tscn index 858efb3..d748fc2 100644 --- a/godot/characters/player/Player.tscn +++ b/godot/characters/player/Player.tscn @@ -9,10 +9,10 @@ [ext_resource path="res://characters/player/states/Fall.gdns" type="Script" id=7] [sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 7, 12 ) +extents = Vector2( 6.5, 11.5 ) [node name="Player" type="KinematicBody2D"] -collision_mask = 2 +collision_mask = 10 script = ExtResource( 5 ) [node name="AnimatedSprite" type="AnimatedSprite" parent="."] @@ -22,7 +22,7 @@ centered = false flip_h = true [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -position = Vector2( 12, 12 ) +position = Vector2( 12.5, 12.5 ) shape = SubResource( 1 ) [node name="StateMachine" type="Node" parent="."] @@ -40,3 +40,9 @@ script = ExtResource( 6 ) [node name="Fall" type="Node" parent="StateMachine"] script = ExtResource( 7 ) + +[node name="PlatformDetector" type="RayCast2D" parent="."] +position = Vector2( 12, 0 ) +enabled = true +cast_to = Vector2( 0, 32 ) +collision_mask = 24 diff --git a/godot/levels/PrototypeEnemies.tmx b/godot/levels/PrototypeEnemies.tmx index e817cdf..1fd225b 100644 --- a/godot/levels/PrototypeEnemies.tmx +++ b/godot/levels/PrototypeEnemies.tmx @@ -22,16 +22,16 @@ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,2,3,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24 diff --git a/godot/levels/PrototypeEnemies.tmx.import b/godot/levels/PrototypeEnemies.tmx.import index 3d78c8b..2113587 100644 --- a/godot/levels/PrototypeEnemies.tmx.import +++ b/godot/levels/PrototypeEnemies.tmx.import @@ -13,9 +13,9 @@ dest_files=[ "res://.import/PrototypeEnemies.tmx-5728a1d35b5e3ba88a2df2406b1cd93 custom_properties=true tile_metadata=false -uv_clip=true +uv_clip=false y_sort=false -image_flags=7 +image_flags=0 collision_layer=2 collision_mask=0 embed_internal_images=false diff --git a/godot/levels/PrototypeEnemies.tscn b/godot/levels/PrototypeEnemies.tscn index caf427c..1ecb459 100644 --- a/godot/levels/PrototypeEnemies.tscn +++ b/godot/levels/PrototypeEnemies.tscn @@ -15,7 +15,8 @@ [node name="PrototypeEnemies" type="Node"] [node name="Player" parent="." instance=ExtResource( 2 )] -position = Vector2( 80, 488 ) +position = Vector2( 156, 438 ) +collision/safe_margin = 0.12 [node name="Camera2D" type="Camera2D" parent="Player"] current = true @@ -49,6 +50,7 @@ centered = false script = ExtResource( 1 ) [node name="Enemies" type="Node" parent="."] +unique_name_in_owner = true [node name="Spikeball" parent="Enemies" instance=ExtResource( 8 )] position = Vector2( 106, 547 ) @@ -57,16 +59,25 @@ position = Vector2( 106, 547 ) position = Vector2( 92, 516 ) [node name="Blockface" parent="Enemies" instance=ExtResource( 10 )] -position = Vector2( 169, 518 ) +position = Vector2( 206, 404 ) [node name="Dreadtooth" parent="Enemies" instance=ExtResource( 6 )] -position = Vector2( 212, 546 ) +position = Vector2( 316, 379 ) + +[node name="Dreadtooth2" parent="Enemies" instance=ExtResource( 6 )] +position = Vector2( 350, 263 ) +direction = 1 +detect_edges = false [node name="Gravevine" parent="Enemies" instance=ExtResource( 5 )] position = Vector2( 250, 550 ) [node name="Shelly" parent="Enemies" instance=ExtResource( 9 )] -position = Vector2( 138, 546 ) +position = Vector2( 247, 439 ) [node name="SuperShelly" parent="Enemies" instance=ExtResource( 7 )] position = Vector2( 62, 546 ) + +[connection signal="player_touched" from="Enemies/Blockface" to="Player" method="_on_player_touched"] +[connection signal="player_touched" from="Enemies/Shelly" to="Player" method="_on_player_touched"] +[connection signal="player_touched" from="Enemies/SuperShelly" to="Player" method="_on_player_touched"] diff --git a/godot/project.godot b/godot/project.godot index ffda9d8..3e8af38 100644 --- a/godot/project.godot +++ b/godot/project.godot @@ -101,6 +101,7 @@ Send={ 2d_physics/layer_1="Player" 2d_physics/layer_2="Tiles" 2d_physics/layer_4="Enemies" +2d_physics/layer_5="Platforms" [physics] diff --git a/src/player/Player.cpp b/src/player/Player.cpp index b820fdf..02467d6 100644 --- a/src/player/Player.cpp +++ b/src/player/Player.cpp @@ -6,6 +6,8 @@ #include #include #include +#include +#include using namespace godot; using namespace player; @@ -16,9 +18,11 @@ void Player::_register_methods() register_method("_physics_process", &Player::_physics_process); register_method("set_velocity", &Player::set_velocity); register_method("get_velocity", &Player::get_velocity); + register_method("_on_player_touched", &Player::_on_player_touched); //register_property>("sprite_frames", &Player::set_sprite_frames, &Player::get_sprite_frames, Ref(), GODOT_METHOD_RPC_MODE_DISABLED, GODOT_PROPERTY_USAGE_DEFAULT, GODOT_PROPERTY_HINT_RESOURCE_TYPE, String("SpriteFrames")); register_property("speed", &Player::set_speed, &Player::get_speed, player::speed); register_property("jump_force", &Player::set_jump_force, &Player::get_jump_force, player::jump_force); + register_property("bounce_force", &Player::set_bounce_force, &Player::get_bounce_force, player::bounce_force); register_property("gravity", &Player::set_gravity, &Player::get_gravity, player::gravity); register_property("run_speed", &Player::set_run_speed, &Player::get_run_speed, player::run_speed); register_property("double_jump", &Player::set_double_jump, &Player::get_double_jump, player::double_jump); @@ -42,6 +46,7 @@ void Player::_init() //sprite_frames = _resource_loader->load(player::sprite_frames); set_speed(player::speed); set_jump_force(player::jump_force); + set_bounce_force(player::bounce_force); set_gravity(player::gravity); set_run_speed(player::run_speed); set_double_jump(player::double_jump); @@ -73,7 +78,7 @@ void Player::_ready() WARN_PRINT("Middleground not found!"); } - auto object_node = get_tree()->get_root()->get_node("Main")->find_node("Monitor"); + auto object_node = get_tree()->get_root()->get_node("Main")->find_node("Monitor", true); if (object_node != nullptr) { auto state = get_node("StateMachine")->get_child(0); @@ -99,9 +104,54 @@ void Player::_physics_process(float delta) { velocity.y += get_gravity(); - velocity = move_and_slide(velocity, Vector2::UP, true); + auto snap_vector = Vector2::ZERO; + if (!is_on_floor()) + { + snap_vector = Vector2::DOWN * 20.0; + } + + auto platform_detector = get_node("PlatformDetector"); + auto is_on_platform = platform_detector->is_colliding(); + + velocity = move_and_slide_with_snap(velocity, snap_vector, Vector2::UP, !is_on_platform, 4, 0.9, false); + //velocity = move_and_slide(velocity, Vector2::UP, !is_on_platform); velocity.x = Math::lerp((float) velocity.x, (float) 0, (float) 0.2); + auto count = get_slide_count(); + for (int64_t i = 0; i < count; i++) + { + auto collision = get_slide_collision(i); + auto collision_object = collision->get_collider(); + auto collider = Object::cast_to(collision_object); + if (collider->is_in_group("squashable") && Vector2::UP.dot(collision->get_normal()) > 0.1) + { + collider->call_deferred("squash"); + /*auto dup_node = collider->duplicate(); + auto dup = Object::cast_to(dup_node); + auto dup_pos = dup->get_position(); + dup_pos.x += 24; + dup->set_position(dup_pos); + auto enemies = get_tree()->get_root()->get_node("Main")->find_node("Enemies", true, false); + if (enemies != nullptr) { + enemies->add_child(dup); + } + else + { + WARN_PRINT("Enemies not found!"); + dup->queue_free(); + }*/ + velocity.y = -get_bounce_force(); + } + else if (collider->is_in_group("enemy") && (collider->is_in_group("rideable") && Vector2::DOWN.dot(collision->get_normal()) > 0.1)) + { + _on_player_touched(); + } + else if (collider->is_in_group("enemy") && !collider->is_in_group("rideable")) + { + _on_player_touched(); + } + } + // Clamp the player's position inside the camera's limits auto camera = get_node("Camera2D"); auto position = get_global_position(); @@ -176,6 +226,16 @@ float Player::get_jump_force() return this->jump_force; } +void Player::set_bounce_force(float bounce_force) +{ + this->bounce_force = bounce_force; +} + +float Player::get_bounce_force() +{ + return this->bounce_force; +} + void Player::set_gravity(float gravity) { this->gravity = gravity; @@ -215,3 +275,12 @@ Vector2 Player::get_velocity() { return this->velocity; } + +void Player::_on_player_touched() +{ + auto error = get_tree()->change_scene("res://Main.tscn"); + if (error != Error::OK) + { + ERR_PRINT(String().num((int) error) + " Could not load scene!"); + } +} diff --git a/src/player/Player.h b/src/player/Player.h index ee710ae..867de6d 100644 --- a/src/player/Player.h +++ b/src/player/Player.h @@ -31,6 +31,11 @@ namespace godot * */ const float jump_force = 300.0; + /** + * @brief The default bounce force applied when bouncing on something. + * + */ + const float bounce_force = 200.0; /** * @brief The default gravity applied to the player. * @@ -93,6 +98,11 @@ namespace godot * */ float jump_force; + /** + * @brief The force applied to the player when bouncing off something. + * + */ + float bounce_force; /** * @brief The gravity applied to the player. * @@ -194,6 +204,20 @@ namespace godot */ float get_jump_force(); + /** + * @brief Set the bounce force object. + * + * @param[in] bounce_force The new force applied to the player to make him bounce. + */ + void set_bounce_force(float bounce_force); + + /** + * @brief Get the bounce force object. + * + * @return float The current force being applied to the player. + */ + float get_bounce_force(); + /** * @brief Set the gravity object. * @@ -250,6 +274,8 @@ namespace godot * @return Vector2 Returns the velocity of the player. */ Vector2 get_velocity(); + + void _on_player_touched(); }; } } -- 2.30.2 From edd24b6798fd2670f59c9146af9fb7d755641201 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Thu, 21 Jul 2022 00:17:12 -0400 Subject: [PATCH 06/12] undo accidental collision extents change --- godot/characters/player/Player.tscn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/godot/characters/player/Player.tscn b/godot/characters/player/Player.tscn index d748fc2..3209ffa 100644 --- a/godot/characters/player/Player.tscn +++ b/godot/characters/player/Player.tscn @@ -9,7 +9,7 @@ [ext_resource path="res://characters/player/states/Fall.gdns" type="Script" id=7] [sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 6.5, 11.5 ) +extents = Vector2( 7, 12 ) [node name="Player" type="KinematicBody2D"] collision_mask = 10 -- 2.30.2 From d35993d0720d3e7d6167434f18ddeb28ff893ce1 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Thu, 21 Jul 2022 20:54:06 -0400 Subject: [PATCH 07/12] add comment to _on_player_touched --- src/player/Player.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/player/Player.h b/src/player/Player.h index 867de6d..cde3e9f 100644 --- a/src/player/Player.h +++ b/src/player/Player.h @@ -275,6 +275,10 @@ namespace godot */ Vector2 get_velocity(); + /** + * @brief This function is called when an enemy touches the player. + * + */ void _on_player_touched(); }; } -- 2.30.2 From f9e70eae01d1bb5edcbf54335fe1d783e1595427 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 27 Jul 2022 00:03:18 -0400 Subject: [PATCH 08/12] connect signals to the dreadteeth --- godot/levels/PrototypeEnemies.tscn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/godot/levels/PrototypeEnemies.tscn b/godot/levels/PrototypeEnemies.tscn index 1ecb459..0662c19 100644 --- a/godot/levels/PrototypeEnemies.tscn +++ b/godot/levels/PrototypeEnemies.tscn @@ -79,5 +79,7 @@ position = Vector2( 247, 439 ) position = Vector2( 62, 546 ) [connection signal="player_touched" from="Enemies/Blockface" to="Player" method="_on_player_touched"] +[connection signal="player_touched" from="Enemies/Dreadtooth" to="Player" method="_on_player_touched"] +[connection signal="player_touched" from="Enemies/Dreadtooth2" to="Player" method="_on_player_touched"] [connection signal="player_touched" from="Enemies/Shelly" to="Player" method="_on_player_touched"] [connection signal="player_touched" from="Enemies/SuperShelly" to="Player" method="_on_player_touched"] -- 2.30.2 From 18a7cac06806a81bcd56776a41745d12afc82a0e Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 27 Jul 2022 00:03:59 -0400 Subject: [PATCH 09/12] change dot vector check to be greater than 0 --- src/player/Player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/player/Player.cpp b/src/player/Player.cpp index 02467d6..11aa417 100644 --- a/src/player/Player.cpp +++ b/src/player/Player.cpp @@ -142,7 +142,7 @@ void Player::_physics_process(float delta) }*/ velocity.y = -get_bounce_force(); } - else if (collider->is_in_group("enemy") && (collider->is_in_group("rideable") && Vector2::DOWN.dot(collision->get_normal()) > 0.1)) + else if (collider->is_in_group("enemy") && (collider->is_in_group("rideable") && Vector2::DOWN.dot(collision->get_normal()) > 0)) { _on_player_touched(); } -- 2.30.2 From 89f1ac5303760a5b0a53a64066707ee75626d28c Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Thu, 4 Aug 2022 00:56:14 -0400 Subject: [PATCH 10/12] make dreadtooth animation start automatically --- godot/characters/enemies/dreadtooth/Dreadtooth.tscn | 1 + 1 file changed, 1 insertion(+) diff --git a/godot/characters/enemies/dreadtooth/Dreadtooth.tscn b/godot/characters/enemies/dreadtooth/Dreadtooth.tscn index 8ff0f88..0315c52 100644 --- a/godot/characters/enemies/dreadtooth/Dreadtooth.tscn +++ b/godot/characters/enemies/dreadtooth/Dreadtooth.tscn @@ -40,6 +40,7 @@ script = ExtResource( 2 ) frames = SubResource( 4 ) animation = "walk" frame = 1 +playing = true [node name="CollisionShape2D" type="CollisionShape2D" parent="."] position = Vector2( -0.5, 5.5 ) -- 2.30.2 From a72954b578ab4152202dc9ef59efbef504f08b5f Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Thu, 4 Aug 2022 00:59:10 -0400 Subject: [PATCH 11/12] add blightwing's behavior --- .../enemies/blightwing/Blightwing.gd | 87 +++++++++++++++---- .../enemies/blightwing/Blightwing.tscn | 23 ++++- 2 files changed, 90 insertions(+), 20 deletions(-) diff --git a/godot/characters/enemies/blightwing/Blightwing.gd b/godot/characters/enemies/blightwing/Blightwing.gd index 0258748..6186bea 100644 --- a/godot/characters/enemies/blightwing/Blightwing.gd +++ b/godot/characters/enemies/blightwing/Blightwing.gd @@ -1,27 +1,82 @@ extends KinematicBody2D -# Declare member variables here. Examples: -# var a: int = 2 -# var b: String = "text" +signal player_touched + + +export var direction = -1 +export var speed = 50 +export var follow_path = false +var target: Vector2 = Vector2(0, 0) +var target_id = 0 +var start_position = Vector2() -# Called when the node enters the scene tree for the first time. func _ready() -> void: - pass # Replace with function body. + start_position = position + if follow_path: + if $Path.get_child_count() == 0: + follow_path = false + else: + target = $Path.get_child(0).position + if direction == 1: + $AnimatedSprite.flip_h = true -# Called every frame. 'delta' is the elapsed time since the previous frame. func _physics_process(delta: float) -> void: - var velocity = Vector2() - velocity.x += 1 * 50 - #velocity.y -= 1 * 50 - velocity = move_and_slide(velocity, Vector2(0, 0), true, 2) - for i in get_slide_count(): - var collision = get_slide_collision(i) - #if collision.collider.name == "Player": - # print("Blightwing: " + String(OS.get_unix_time()) + " " + collision.collider.name) + if $LeftWallChecker.is_colliding(): + wall_checker_collided($LeftWallChecker) + elif $RightWallChecker.is_colliding(): + wall_checker_collided($RightWallChecker) + + if not follow_path: + var target_position = position + target_position.x *= 2 * direction + position = position.move_toward(target_position, round(speed * delta)) + + var velocity = get_velocity_towards_target(delta) + var collision = move_and_collide(velocity, true, true, true) + if collision and collision.collider.name != "Player": + var _collision = move_and_collide(velocity) + else: + var velocity = get_velocity_towards_target(delta) + + var collision = move_and_collide(velocity, true, true, true) + if collision and collision.collider.name != "Player": + var _collision = move_and_collide(velocity) + else: + position = position.move_toward(start_position + target, round(speed * delta)) + + if position == start_position + target: + if $Path.get_child_count() - 1 == target_id: + target_id = -1 + target = $Path.position + else: + target_id += 1 + target = $Path.get_child(target_id).position + + if start_position.x + target.x > position.x: + $AnimatedSprite.flip_h = true + elif start_position.x + target.x < position.x: + $AnimatedSprite.flip_h = false -func _on_Area2D_body_entered(body: Node) -> void: - print(body.name) +func get_velocity_towards_target(delta: float) -> Vector2: + var velocity = Vector2(0, 0) + if start_position.x + target.x > position.x: + velocity.x = speed * delta + elif start_position.x + target.x < position.x: + velocity.x = -speed * delta + + if start_position.y + target.y > position.y: + velocity.y = speed * delta + elif start_position.y + target.y < position.y: + velocity.y = -speed * delta + return velocity + + +func wall_checker_collided(wall_checker: RayCast2D) -> void: + if wall_checker.get_collider().name == "Player": + emit_signal("player_touched") + direction *= -1 + $AnimatedSprite.flip_h = not $AnimatedSprite.flip_h diff --git a/godot/characters/enemies/blightwing/Blightwing.tscn b/godot/characters/enemies/blightwing/Blightwing.tscn index b6b52af..4173207 100644 --- a/godot/characters/enemies/blightwing/Blightwing.tscn +++ b/godot/characters/enemies/blightwing/Blightwing.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=7 format=2] +[gd_scene load_steps=8 format=2] [ext_resource path="res://assets/characters/characters.png" type="Texture" id=1] +[ext_resource path="res://characters/enemies/blightwing/Blightwing.gd" type="Script" id=2] [sub_resource type="AtlasTexture" id=1] atlas = ExtResource( 1 ) @@ -23,18 +24,32 @@ animations = [ { } ] [sub_resource type="RectangleShape2D" id=5] -extents = Vector2( 5, 5 ) +extents = Vector2( 4.5, 5 ) -[node name="Blightwing" type="KinematicBody2D" groups=["enemy"]] +[node name="Blightwing" type="KinematicBody2D" groups=["enemy", "rideable"]] collision_layer = 8 collision_mask = 11 +script = ExtResource( 2 ) [node name="AnimatedSprite" type="AnimatedSprite" parent="."] frames = SubResource( 4 ) animation = "fly" +frame = 3 playing = true [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -position = Vector2( 3.47893e-06, 0.999998 ) +position = Vector2( 1.66894e-06, 1.5 ) rotation = 1.5708 shape = SubResource( 5 ) + +[node name="LeftWallChecker" type="RayCast2D" parent="."] +rotation = 1.5708 +enabled = true +cast_to = Vector2( 0, 10 ) +collision_mask = 11 + +[node name="RightWallChecker" type="RayCast2D" parent="."] +rotation = -1.5708 +enabled = true +cast_to = Vector2( 0, 10 ) +collision_mask = 11 -- 2.30.2 From 5ce3a2f37c2ec9afbcca588d6e59e449ec3f09e7 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Thu, 4 Aug 2022 00:59:48 -0400 Subject: [PATCH 12/12] add blightwing prototype example --- godot/levels/PrototypeEnemies.tmx | 2 +- godot/levels/PrototypeEnemies.tscn | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/godot/levels/PrototypeEnemies.tmx b/godot/levels/PrototypeEnemies.tmx index 1fd225b..34a536c 100644 --- a/godot/levels/PrototypeEnemies.tmx +++ b/godot/levels/PrototypeEnemies.tmx @@ -26,7 +26,7 @@ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, diff --git a/godot/levels/PrototypeEnemies.tscn b/godot/levels/PrototypeEnemies.tscn index 0662c19..d53033f 100644 --- a/godot/levels/PrototypeEnemies.tscn +++ b/godot/levels/PrototypeEnemies.tscn @@ -56,7 +56,19 @@ unique_name_in_owner = true position = Vector2( 106, 547 ) [node name="Blightwing" parent="Enemies" instance=ExtResource( 11 )] -position = Vector2( 92, 516 ) +position = Vector2( 488, 400 ) +follow_path = true + +[node name="Path" type="Node2D" parent="Enemies/Blightwing"] + +[node name="Node2D" type="Node2D" parent="Enemies/Blightwing/Path"] +position = Vector2( 0, 96 ) + +[node name="Node2D2" type="Node2D" parent="Enemies/Blightwing/Path"] +position = Vector2( -128, 96 ) + +[node name="Node2D3" type="Node2D" parent="Enemies/Blightwing/Path"] +position = Vector2( -128, 0 ) [node name="Blockface" parent="Enemies" instance=ExtResource( 10 )] position = Vector2( 206, 404 ) @@ -78,6 +90,7 @@ position = Vector2( 247, 439 ) [node name="SuperShelly" parent="Enemies" instance=ExtResource( 7 )] position = Vector2( 62, 546 ) +[connection signal="player_touched" from="Enemies/Blightwing" to="Player" method="_on_player_touched"] [connection signal="player_touched" from="Enemies/Blockface" to="Player" method="_on_player_touched"] [connection signal="player_touched" from="Enemies/Dreadtooth" to="Player" method="_on_player_touched"] [connection signal="player_touched" from="Enemies/Dreadtooth2" to="Player" method="_on_player_touched"] -- 2.30.2