player and snake movement
This commit is contained in:
parent
4576c62e4a
commit
50e2dad3e7
7 changed files with 113 additions and 23 deletions
45
test.tscn
45
test.tscn
|
|
@ -1,34 +1,33 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://daqqurdrnk61h"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://daqqurdrnk61h"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://l8x3dp68yyxr" path="res://assets/segement.png" id="1_6uqi0"]
|
||||
[ext_resource type="Script" uid="uid://deq18nev0kwbg" path="res://addons/godot-donut-collision-polygon-2d-7780d026ae3d4a37fe68f43cc1f97ba664dd775d/addons/donut_collision_polygon2D/donut_collision_polygon2D.gd" id="2_ppyta"]
|
||||
[ext_resource type="Script" uid="uid://b48mlxrnte625" path="res://braincell.gd" id="3_ppyta"]
|
||||
[ext_resource type="Texture2D" uid="uid://qyd5e7lb2esx" path="res://assets/braincell.png" id="3_ykrsh"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_g14j6"]
|
||||
radius = 16.0
|
||||
[ext_resource type="Script" uid="uid://bue4xxejdsmqh" path="res://snakeManager.gd" id="1_6uqi0"]
|
||||
[ext_resource type="PackedScene" uid="uid://bwoeu7ask0fck" path="res://prefabs/snake_segment.tscn" id="1_8uh7m"]
|
||||
[ext_resource type="PackedScene" uid="uid://cusdydgg4b1bo" path="res://prefabs/braincell.tscn" id="2_6uqi0"]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
[node name="SnakeSegment" type="AnimatableBody2D" parent="."]
|
||||
[node name="Snake" type="Node2D" parent="."]
|
||||
script = ExtResource("1_6uqi0")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="SnakeSegment"]
|
||||
texture = ExtResource("1_6uqi0")
|
||||
[node name="SnakeSegment" parent="Snake" instance=ExtResource("1_8uh7m")]
|
||||
is_head = true
|
||||
|
||||
[node name="DonutCollisionPolygon2D" type="CollisionPolygon2D" parent="SnakeSegment"]
|
||||
polygon = PackedVector2Array(9.85808e-15, -161, 31.4095, -157.906, 61.612, -148.745, 89.4468, -133.867, 113.844, -113.844, 133.867, -89.4468, 148.745, -61.612, 157.906, -31.4095, 161, 0, 157.906, 31.4095, 148.745, 61.612, 133.867, 89.4468, 113.844, 113.844, 89.4468, 133.867, 61.612, 148.745, 31.4095, 157.906, 9.85808e-15, 161, -31.4095, 157.906, -61.612, 148.745, -89.4468, 133.867, -113.844, 113.844, -133.867, 89.4468, -148.745, 61.612, -157.906, 31.4095, -161, 1.97162e-14, -157.906, -31.4095, -148.745, -61.612, -133.867, -89.4468, -113.844, -113.844, -89.4468, -133.867, -61.612, -148.745, -31.4095, -157.906, -2.95742e-14, -161, -2.92069e-14, -159, -31.0194, -155.945, -60.8467, -146.897, -88.3357, -132.204, -112.43, -112.43, -132.204, -88.3357, -146.897, -60.8467, -155.945, -31.0194, -159, 1.94712e-14, -155.945, 31.0194, -146.897, 60.8467, -132.204, 88.3357, -112.43, 112.43, -88.3357, 132.204, -60.8467, 146.897, -31.0194, 155.945, 9.73562e-15, 159, 31.0194, 155.945, 60.8467, 146.897, 88.3357, 132.204, 112.43, 112.43, 132.204, 88.3357, 146.897, 60.8467, 155.945, 31.0194, 159, 0, 155.945, -31.0194, 146.897, -60.8467, 132.204, -88.3357, 112.43, -112.43, 88.3357, -132.204, 60.8467, -146.897, 31.0194, -155.945, 9.73562e-15, -159, 0.0001, -161)
|
||||
script = ExtResource("2_ppyta")
|
||||
radius = 160.0
|
||||
metadata/_custom_type_script = "uid://deq18nev0kwbg"
|
||||
[node name="Braincell" parent="Snake/SnakeSegment" instance=ExtResource("2_6uqi0")]
|
||||
|
||||
[node name="Braincell" type="CharacterBody2D" parent="."]
|
||||
motion_mode = 1
|
||||
script = ExtResource("3_ppyta")
|
||||
[node name="SnakeSegment2" parent="Snake" node_paths=PackedStringArray("next_segment") instance=ExtResource("1_8uh7m")]
|
||||
next_segment = NodePath("../SnakeSegment")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="Braincell"]
|
||||
texture = ExtResource("3_ykrsh")
|
||||
[node name="SnakeSegment3" parent="Snake" node_paths=PackedStringArray("next_segment") instance=ExtResource("1_8uh7m")]
|
||||
next_segment = NodePath("../SnakeSegment2")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Braincell"]
|
||||
shape = SubResource("CircleShape2D_g14j6")
|
||||
[node name="SnakeSegment4" parent="Snake" node_paths=PackedStringArray("next_segment") instance=ExtResource("1_8uh7m")]
|
||||
next_segment = NodePath("../SnakeSegment2")
|
||||
|
||||
[node name="SnakeSegment5" parent="Snake" node_paths=PackedStringArray("next_segment") instance=ExtResource("1_8uh7m")]
|
||||
next_segment = NodePath("../SnakeSegment2")
|
||||
|
||||
[node name="SnakeSegment6" parent="Snake" node_paths=PackedStringArray("next_segment") instance=ExtResource("1_8uh7m")]
|
||||
next_segment = NodePath("../SnakeSegment2")
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
zoom = Vector2(0.1, 0.1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue