fix rolling fiend jank, but can only walk around convex paths now :(

This commit is contained in:
Haze Weathers 2023-01-16 06:54:38 -05:00
parent 88b4135315
commit 863961cc92
4 changed files with 32 additions and 42 deletions

View file

@ -1,9 +1,12 @@
[gd_scene load_steps=9 format=2]
[gd_scene load_steps=10 format=2]
[ext_resource path="res://graphics/enemy/roller_fiend.png" type="Texture" id=2]
[ext_resource path="res://objects/enemy/rolling_fiend.gd" type="Script" id=3]
[ext_resource path="res://scripts/1px_border.gdshader" type="Shader" id=4]
[sub_resource type="RectangleShape2D" id=8]
extents = Vector2( 4, 4 )
[sub_resource type="ShaderMaterial" id=5]
shader = ExtResource( 4 )
shader_param/border_color = Color( 0, 0, 0, 1 )
@ -26,38 +29,25 @@ animations = [ {
} ]
[sub_resource type="RectangleShape2D" id=4]
extents = Vector2( 4.0094, 4.0094 )
extents = Vector2( 4, 4 )
[node name="RollingFiend" type="Node2D" groups=["enemy"]]
script = ExtResource( 3 )
score_for_killing = 40
move_speed = 50.0
[node name="FloorTestShape" type="CollisionShape2D" parent="."]
shape = SubResource( 8 )
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
material = SubResource( 5 )
position = Vector2( 0, 1 )
frames = SubResource( 3 )
frame = 1
playing = true
[node name="Hitbox" type="Area2D" parent="."]
position = Vector2( 0, 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
position = Vector2( -0.010025, 0.0104442 )
rotation = -0.020475
shape = SubResource( 4 )
[node name="Raycasts" type="Node2D" parent="."]
position = Vector2( 0, 1 )
[node name="WallCast" type="RayCast2D" parent="Raycasts"]
position = Vector2( -7, 7 )
enabled = true
cast_to = Vector2( 0, -10 )
[node name="FloorCast" type="RayCast2D" parent="Raycasts"]
position = Vector2( -7, 8 )
enabled = true
cast_to = Vector2( 10, 0 )
[connection signal="area_entered" from="Hitbox" to="." method="_on_Area2D_area_entered"]