adjusted roller fiend raycasts
This commit is contained in:
parent
74bf75b6e8
commit
d6547b61d4
6 changed files with 101 additions and 11 deletions
|
@ -1,8 +1,14 @@
|
|||
[gd_scene load_steps=8 format=2]
|
||||
[gd_scene load_steps=10 format=2]
|
||||
|
||||
[ext_resource path="res://objects/enemy/enemy.tscn" type="PackedScene" id=1]
|
||||
[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="ShaderMaterial" id=5]
|
||||
shader = ExtResource( 4 )
|
||||
shader_param/border_color = Color( 0, 0, 0, 1 )
|
||||
shader_param/border_corners = false
|
||||
|
||||
[sub_resource type="AtlasTexture" id=1]
|
||||
atlas = ExtResource( 2 )
|
||||
|
@ -29,8 +35,10 @@ score_for_killing = 40
|
|||
move_speed = 50.0
|
||||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="." index="0"]
|
||||
material = SubResource( 5 )
|
||||
position = Vector2( 0, 1 )
|
||||
frames = SubResource( 3 )
|
||||
frame = 1
|
||||
playing = true
|
||||
|
||||
[node name="Hitbox" type="Area2D" parent="." index="1"]
|
||||
|
@ -46,11 +54,11 @@ position = Vector2( 0, 1 )
|
|||
[node name="WallCast" type="RayCast2D" parent="Raycasts" index="0"]
|
||||
position = Vector2( -7, 7 )
|
||||
enabled = true
|
||||
cast_to = Vector2( 0, -14 )
|
||||
cast_to = Vector2( 0, -11 )
|
||||
|
||||
[node name="FloorCast" type="RayCast2D" parent="Raycasts" index="1"]
|
||||
position = Vector2( -7, 8 )
|
||||
enabled = true
|
||||
cast_to = Vector2( 14, 0 )
|
||||
cast_to = Vector2( 11, 0 )
|
||||
|
||||
[connection signal="area_entered" from="Hitbox" to="." method="_on_Area2D_area_entered"]
|
||||
|
|
39
objects/enemy/tentacle.tscn
Normal file
39
objects/enemy/tentacle.tscn
Normal file
|
@ -0,0 +1,39 @@
|
|||
[gd_scene load_steps=7 format=2]
|
||||
|
||||
[ext_resource path="res://objects/enemy/enemy.gd" type="Script" id=1]
|
||||
[ext_resource path="res://graphics/enemy/tentacle.png" type="Texture" id=2]
|
||||
|
||||
[sub_resource type="AtlasTexture" id=1]
|
||||
atlas = ExtResource( 2 )
|
||||
region = Rect2( 0, 0, 8, 24 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=2]
|
||||
atlas = ExtResource( 2 )
|
||||
region = Rect2( 8, 0, 8, 24 )
|
||||
|
||||
[sub_resource type="SpriteFrames" id=3]
|
||||
animations = [ {
|
||||
"frames": [ SubResource( 1 ), SubResource( 2 ) ],
|
||||
"loop": true,
|
||||
"name": "default",
|
||||
"speed": 7.0
|
||||
} ]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=4]
|
||||
extents = Vector2( 4, 12 )
|
||||
|
||||
[node name="Tentacle" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||
position = Vector2( 4, 12 )
|
||||
frames = SubResource( 3 )
|
||||
playing = true
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
position = Vector2( 4, 12 )
|
||||
shape = SubResource( 4 )
|
||||
|
||||
[connection signal="area_entered" from="Area2D" to="." method="_on_Area2D_area_entered"]
|
Loading…
Add table
Add a link
Reference in a new issue