rearengement
This commit is contained in:
25
scene/asteroidx1.tscn
Normal file
25
scene/asteroidx1.tscn
Normal file
@@ -0,0 +1,25 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://ditud5veuxqyb"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b8a23hkmesx0l" path="res://script/asteroid.gd" id="1_p0ukn"]
|
||||
[ext_resource type="Texture2D" uid="uid://dbingmvgsgvfv" path="res://assets/asteroidx1.png" id="1_u87q6"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_p0ukn"]
|
||||
radius = 14.0357
|
||||
|
||||
[node name="asteroid" type="RigidBody2D"]
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
mass = 5.0
|
||||
contact_monitor = true
|
||||
max_contacts_reported = 4
|
||||
script = ExtResource("1_p0ukn")
|
||||
|
||||
[node name="Asteroid" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("1_u87q6")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
light_mask = 2
|
||||
visibility_layer = 2
|
||||
shape = SubResource("CircleShape2D_p0ukn")
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
20
scene/asteroidx2.tscn
Normal file
20
scene/asteroidx2.tscn
Normal file
@@ -0,0 +1,20 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://d2jxc24g18ab1"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b8a23hkmesx0l" path="res://script/asteroid.gd" id="1_ka8bu"]
|
||||
[ext_resource type="Texture2D" uid="uid://bby053xsfn3cp" path="res://assets/asteroidx2.png" id="2_e2m2r"]
|
||||
|
||||
[node name="asteroid" type="RigidBody2D"]
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
mass = 10.0
|
||||
contact_monitor = true
|
||||
max_contacts_reported = 4
|
||||
script = ExtResource("1_ka8bu")
|
||||
|
||||
[node name="Asteroid" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("2_e2m2r")
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
|
||||
polygon = PackedVector2Array(16, -23, 3, -29, -11, -27, -22, -12, -27, 2, -25, 21, -6, 30, 17, 23, 23, 10, 29, 1, 20, -8)
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
20
scene/asteroidx3.tscn
Normal file
20
scene/asteroidx3.tscn
Normal file
@@ -0,0 +1,20 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://buy8yafwaicq8"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b8a23hkmesx0l" path="res://script/asteroid.gd" id="1_e451a"]
|
||||
[ext_resource type="Texture2D" uid="uid://dt08ism4ulfay" path="res://assets/asteroidx3.png" id="2_beklf"]
|
||||
|
||||
[node name="asteroid" type="RigidBody2D"]
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
mass = 20.0
|
||||
contact_monitor = true
|
||||
max_contacts_reported = 4
|
||||
script = ExtResource("1_e451a")
|
||||
|
||||
[node name="Asteroid" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("2_beklf")
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
|
||||
polygon = PackedVector2Array(23, 10, 36, -11, 22, -32, 8, -43, -32, -40, -40, -25, -43, 1, -40, 23, -24, 41, 3, 43, 38, 19)
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
20
scene/asteroidx4.tscn
Normal file
20
scene/asteroidx4.tscn
Normal file
@@ -0,0 +1,20 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://xldavgivpb3j"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b8a23hkmesx0l" path="res://script/asteroid.gd" id="1_pojcu"]
|
||||
[ext_resource type="Texture2D" uid="uid://bs836c8u5j3y6" path="res://assets/asteroidx4.png" id="2_gv6mu"]
|
||||
|
||||
[node name="asteroid" type="RigidBody2D"]
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
mass = 40.0
|
||||
contact_monitor = true
|
||||
max_contacts_reported = 4
|
||||
script = ExtResource("1_pojcu")
|
||||
|
||||
[node name="Asteroid" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("2_gv6mu")
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
|
||||
polygon = PackedVector2Array(55, 3, 35, -20, 34, -40, 1, -49, -35, -52, -55, -29, -58, -1, -48, 30, -22, 53, 13, 58, 40, 30)
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
22
scene/destroy.tscn
Normal file
22
scene/destroy.tscn
Normal file
@@ -0,0 +1,22 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://bl3ans3gkp8ll"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ckgjtmh5asu4w" path="res://assets/shoot.png" id="1_4xjek"]
|
||||
[ext_resource type="Script" uid="uid://bgbncoa145y1l" path="res://script/destroy.gd" id="2_owou8"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_owou8"]
|
||||
offsets = PackedFloat32Array(0, 0.553333, 1)
|
||||
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0.772549, 1, 1, 1, 0)
|
||||
|
||||
[node name="CPUParticles2D" type="CPUParticles2D"]
|
||||
emitting = false
|
||||
amount = 16
|
||||
texture = ExtResource("1_4xjek")
|
||||
lifetime = 2.5
|
||||
one_shot = true
|
||||
explosiveness = 0.5
|
||||
randomness = 0.46
|
||||
spread = 180.0
|
||||
gravity = Vector2(0, 0)
|
||||
initial_velocity_max = 50.0
|
||||
color_ramp = SubResource("Gradient_owou8")
|
||||
script = ExtResource("2_owou8")
|
||||
19
scene/main_game.tscn
Normal file
19
scene/main_game.tscn
Normal file
@@ -0,0 +1,19 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://btcb75wp78ory"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://d1ugwu6dqomtg" path="res://scene/wall.tscn" id="1_u115g"]
|
||||
[ext_resource type="PackedScene" uid="uid://36q833dx6dmq" path="res://scene/ship.tscn" id="2_02eqj"]
|
||||
[ext_resource type="PackedScene" uid="uid://b6hqwxrexoa2n" path="res://scene/spawner.tscn" id="3_50rem"]
|
||||
|
||||
[node name="main_game" type="Node2D"]
|
||||
|
||||
[node name="wall" parent="." instance=ExtResource("1_u115g")]
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
position = Vector2(320, 320)
|
||||
|
||||
[node name="CharacterBody2D" parent="." instance=ExtResource("2_02eqj")]
|
||||
position = Vector2(156, 206)
|
||||
|
||||
[node name="spawner" parent="." node_paths=PackedStringArray("player") instance=ExtResource("3_50rem")]
|
||||
player = NodePath("../CharacterBody2D")
|
||||
distance = 500.0
|
||||
21
scene/ship.tscn
Normal file
21
scene/ship.tscn
Normal file
@@ -0,0 +1,21 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://36q833dx6dmq"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c3i2bhlectmoo" path="res://script/ship.gd" id="1_4cq66"]
|
||||
[ext_resource type="Texture2D" uid="uid://b037piy3tkefs" path="res://assets/ship.png" id="1_l3rv8"]
|
||||
[ext_resource type="PackedScene" uid="uid://b1jtii12cqye1" path="res://scene/shoot.tscn" id="2_v4325"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_4cq66"]
|
||||
size = Vector2(16, 28)
|
||||
|
||||
[node name="CharacterBody2D" type="CharacterBody2D"]
|
||||
script = ExtResource("1_4cq66")
|
||||
SHOOT_NODE = ExtResource("2_v4325")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
rotation = 1.5708
|
||||
shape = SubResource("RectangleShape2D_4cq66")
|
||||
|
||||
[node name="Ship" type="Sprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
rotation = 1.5708
|
||||
texture = ExtResource("1_l3rv8")
|
||||
22
scene/shoot.tscn
Normal file
22
scene/shoot.tscn
Normal file
@@ -0,0 +1,22 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://b1jtii12cqye1"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ckgjtmh5asu4w" path="res://assets/shoot.png" id="1_ttj7r"]
|
||||
[ext_resource type="Script" uid="uid://dsd0opfd8kyow" path="res://script/shoot.gd" id="1_vnmmp"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_yt1ub"]
|
||||
radius = 5.0
|
||||
|
||||
[node name="shoot" type="RigidBody2D"]
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
mass = 0.001
|
||||
gravity_scale = 0.0
|
||||
script = ExtResource("1_vnmmp")
|
||||
SPEED = 400.0
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
texture = ExtResource("1_ttj7r")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("CircleShape2D_yt1ub")
|
||||
16
scene/spawner.tscn
Normal file
16
scene/spawner.tscn
Normal file
@@ -0,0 +1,16 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://b6hqwxrexoa2n"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bclp1tkc2npvv" path="res://script/spawner.gd" id="1_yp5lu"]
|
||||
[ext_resource type="PackedScene" uid="uid://ditud5veuxqyb" path="res://scene/asteroidx1.tscn" id="2_7ocbr"]
|
||||
[ext_resource type="PackedScene" uid="uid://d2jxc24g18ab1" path="res://scene/asteroidx2.tscn" id="3_mv5bd"]
|
||||
[ext_resource type="PackedScene" uid="uid://buy8yafwaicq8" path="res://scene/asteroidx3.tscn" id="4_h3fkd"]
|
||||
[ext_resource type="PackedScene" uid="uid://xldavgivpb3j" path="res://scene/asteroidx4.tscn" id="5_qmymf"]
|
||||
|
||||
[node name="spawner" type="Node2D"]
|
||||
script = ExtResource("1_yp5lu")
|
||||
asteroidx1 = ExtResource("2_7ocbr")
|
||||
asteroidx2 = ExtResource("3_mv5bd")
|
||||
asteroidx3 = ExtResource("4_h3fkd")
|
||||
asteroidx4 = ExtResource("5_qmymf")
|
||||
|
||||
[connection signal="add_collision" from="." to="." method="_add_collision"]
|
||||
55
scene/wall.tscn
Normal file
55
scene/wall.tscn
Normal file
@@ -0,0 +1,55 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://d1ugwu6dqomtg"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b6422kdu30lo4" path="res://script/wall.gd" id="1_xxgf6"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_oh6kn"]
|
||||
size = Vector2(20, 640)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_xxgf6"]
|
||||
size = Vector2(640, 20)
|
||||
|
||||
[node name="wall" type="Node2D"]
|
||||
script = ExtResource("1_xxgf6")
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
offset_right = 640.0
|
||||
offset_bottom = 640.0
|
||||
color = Color(0, 0, 0, 1)
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D" parent="."]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
|
||||
position = Vector2(0, 320)
|
||||
shape = SubResource("RectangleShape2D_oh6kn")
|
||||
|
||||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="StaticBody2D"]
|
||||
position = Vector2(640, 320)
|
||||
shape = SubResource("RectangleShape2D_oh6kn")
|
||||
|
||||
[node name="CollisionShape2D3" type="CollisionShape2D" parent="StaticBody2D"]
|
||||
position = Vector2(320, 0)
|
||||
shape = SubResource("RectangleShape2D_xxgf6")
|
||||
|
||||
[node name="CollisionShape2D4" type="CollisionShape2D" parent="StaticBody2D"]
|
||||
position = Vector2(320, 640)
|
||||
shape = SubResource("RectangleShape2D_xxgf6")
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
position = Vector2(0, 320)
|
||||
shape = SubResource("RectangleShape2D_oh6kn")
|
||||
|
||||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="Area2D"]
|
||||
position = Vector2(640, 320)
|
||||
shape = SubResource("RectangleShape2D_oh6kn")
|
||||
|
||||
[node name="CollisionShape2D3" type="CollisionShape2D" parent="Area2D"]
|
||||
position = Vector2(320, 0)
|
||||
shape = SubResource("RectangleShape2D_xxgf6")
|
||||
|
||||
[node name="CollisionShape2D4" type="CollisionShape2D" parent="Area2D"]
|
||||
position = Vector2(320, 640)
|
||||
shape = SubResource("RectangleShape2D_xxgf6")
|
||||
|
||||
[connection signal="body_entered" from="Area2D" to="." method="_body_entered_for_multiple"]
|
||||
Reference in New Issue
Block a user