implement blue turtle logic
This commit is contained in:
parent
3dfc4dd04d
commit
d902a35bcd
19
scenes/enemies/turtle/blue/BlueTurtle.cs
Normal file
19
scenes/enemies/turtle/blue/BlueTurtle.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public class BlueTurtle : EnemyWalking
|
||||
{
|
||||
private AnimatedSprite _sprite;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
base._Ready();
|
||||
_sprite = GetNode<AnimatedSprite>("AnimatedSprite");
|
||||
_sprite.Play("walk");
|
||||
}
|
||||
|
||||
public void OnVisibilityNotifier2DScreenExited()
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
}
|
@ -1,7 +1,8 @@
|
||||
[gd_scene load_steps=10 format=2]
|
||||
[gd_scene load_steps=11 format=2]
|
||||
|
||||
[ext_resource path="res://assets/turtle/blue_walking.png" type="Texture" id=1]
|
||||
[ext_resource path="res://assets/turtle/blue_shell.png" type="Texture" id=2]
|
||||
[ext_resource path="res://scenes/enemies/turtle/blue/BlueTurtle.cs" type="Script" id=3]
|
||||
|
||||
[sub_resource type="AtlasTexture" id=6]
|
||||
atlas = ExtResource( 2 )
|
||||
@ -40,6 +41,7 @@ extents = Vector2( 5.5, 6 )
|
||||
|
||||
[node name="BlueTurtle" type="KinematicBody2D"]
|
||||
collision_layer = 4
|
||||
script = ExtResource( 3 )
|
||||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||
frames = SubResource( 4 )
|
||||
@ -55,3 +57,9 @@ visible = false
|
||||
position = Vector2( -0.5, 2 )
|
||||
shape = SubResource( 7 )
|
||||
disabled = true
|
||||
|
||||
[node name="VisibilityEnabler2D" type="VisibilityEnabler2D" parent="."]
|
||||
process_parent = true
|
||||
physics_process_parent = true
|
||||
|
||||
[connection signal="screen_exited" from="VisibilityEnabler2D" to="." method="OnVisibilityNotifier2DScreenExited"]
|
||||
|
Loading…
Reference in New Issue
Block a user