[gd_scene load_steps=13 format=3 uid="uid://yqtgkxjjexag"] [ext_resource type="Script" uid="uid://v6ovq4snxruc" path="res://Main.cs" id="1_0xm2m"] [ext_resource type="Texture2D" uid="uid://20l58n0ih2w8" path="res://art/enemyFlyingAlt_1.png" id="2_5vw27"] [ext_resource type="PackedScene" uid="uid://c8n4lue2bn25n" path="res://marble.tscn" id="2_h2yge"] [ext_resource type="Texture2D" uid="uid://j3he7mqxqv3u" path="res://art/enemyFlyingAlt_2.png" id="3_kek77"] [ext_resource type="Texture2D" uid="uid://oagj5757wwts" path="res://art/enemySwimming_1.png" id="4_4c57u"] [ext_resource type="Texture2D" uid="uid://b0ricy0343hpo" path="res://art/enemySwimming_2.png" id="5_efxa6"] [ext_resource type="Texture2D" uid="uid://cfuwipiglerup" path="res://art/enemyWalking_1.png" id="6_dg77c"] [ext_resource type="Texture2D" uid="uid://doayjemlvuit1" path="res://art/enemyWalking_2.png" id="7_ycdy4"] [sub_resource type="CSharpScript" id="CSharpScript_w48qg"] script/source = "using Godot; using System; public partial class Mob : RigidBody2D { public override void _Ready() { var animatedSprite2D = GetNode(\"AnimatedSprite2D\"); string[] mobTypes = animatedSprite2D.SpriteFrames.GetAnimationNames(); animatedSprite2D.Play(mobTypes[GD.Randi() % mobTypes.Length]); } // We also specified this function name in PascalCase in the editor's connection window. private void OnVisibleOnScreenNotifier2DScreenExited() { QueueFree(); } } " [sub_resource type="SpriteFrames" id="SpriteFrames_pcqmr"] animations = [{ "frames": [{ "duration": 1.0, "texture": ExtResource("2_5vw27") }, { "duration": 1.0, "texture": ExtResource("3_kek77") }], "loop": true, "name": &"fly", "speed": 3.0 }, { "frames": [{ "duration": 1.0, "texture": ExtResource("4_4c57u") }, { "duration": 1.0, "texture": ExtResource("5_efxa6") }], "loop": true, "name": &"swim", "speed": 3.0 }, { "frames": [{ "duration": 1.0, "texture": ExtResource("6_dg77c") }, { "duration": 1.0, "texture": ExtResource("7_ycdy4") }], "loop": true, "name": &"walk", "speed": 3.0 }] [sub_resource type="CapsuleShape2D" id="CapsuleShape2D_jbnni"] radius = 36.0 height = 90.0 [sub_resource type="PackedScene" id="PackedScene_vivmo"] _bundled = { "conn_count": 0, "conns": PackedInt32Array(), "editable_instances": [], "names": PackedStringArray("Mob", "collision_mask", "gravity_scale", "script", "metadata/_edit_group_", "mobs", "RigidBody2D", "AnimatedSprite2D", "scale", "sprite_frames", "animation", "CollisionShape2D", "rotation", "shape", "VisibleOnScreenEnabler2D", "enable_node_path"), "node_count": 4, "node_paths": [], "nodes": PackedInt32Array(-1, -1, 6, 0, -1, 4, 1, 0, 2, 1, 3, 2, 4, 3, 1, 5, 0, 0, 7, 7, -1, 3, 8, 4, 9, 5, 10, 6, 0, 0, 0, 11, 11, -1, 2, 12, 7, 13, 8, 0, 0, 0, 14, 14, -1, 1, 15, 9, 0), "variants": [0, 0.0, SubResource("CSharpScript_w48qg"), true, Vector2(0.75, 0.75), SubResource("SpriteFrames_pcqmr"), &"fly", 1.5708, SubResource("CapsuleShape2D_jbnni"), NodePath("../CollisionShape2D")], "version": 3 } [node name="Main" type="Node"] script = ExtResource("1_0xm2m") MobScene = SubResource("PackedScene_vivmo") [node name="Marble" parent="." instance=ExtResource("2_h2yge")] [connection signal="Hit" from="Marble" to="." method="GameOver"]