Browse Source

:truck: Rearrange folders by components

Instead of file types.

Example : group ball stuff together (image, script, scene) instead of
grouping scripts together.
DricomDragon 3 years ago
parent
commit
32b025b027

godot/scripts/Ball.gd → godot/component/entity/ball/Ball.gd


+ 11 - 11
godot/scenes/Ball.tscn

@@ -1,8 +1,8 @@
 [gd_scene load_steps=9 format=2]
 
-[ext_resource path="res://image/ball.png" type="Texture" id=1]
-[ext_resource path="res://scripts/Ball.gd" type="Script" id=2]
-[ext_resource path="res://image/ball_particle.png" type="Texture" id=3]
+[ext_resource path="res://component/entity/ball/Ball.gd" type="Script" id=1]
+[ext_resource path="res://component/entity/ball/ball.png" type="Texture" id=2]
+[ext_resource path="res://component/entity/ball/ball_particle.png" type="Texture" id=3]
 
 [sub_resource type="PhysicsMaterial" id=1]
 friction = 0.0
@@ -11,13 +11,13 @@ bounce = 1.0
 [sub_resource type="CircleShape2D" id=2]
 radius = 5.0
 
-[sub_resource type="Curve" id=4]
+[sub_resource type="Curve" id=3]
 _data = [ Vector2( 0, 1 ), 0.0, 0.0, 0, 0, Vector2( 1, 0.290909 ), 0.0, 0.0, 0, 0 ]
 
-[sub_resource type="CurveTexture" id=5]
-curve = SubResource( 4 )
+[sub_resource type="CurveTexture" id=4]
+curve = SubResource( 3 )
 
-[sub_resource type="ParticlesMaterial" id=3]
+[sub_resource type="ParticlesMaterial" id=5]
 flag_disable_z = true
 spread = 0.0
 gravity = Vector3( 0, 0, 0 )
@@ -29,7 +29,7 @@ angle = 180.0
 angle_random = 1.0
 scale = 0.5
 scale_random = 0.5
-scale_curve = SubResource( 5 )
+scale_curve = SubResource( 4 )
 
 [node name="Ball" type="RigidBody2D" groups=[
 "ball",
@@ -42,17 +42,17 @@ continuous_cd = 2
 contacts_reported = 2
 linear_velocity = Vector2( 100, 100 )
 linear_damp = 0.0
-script = ExtResource( 2 )
+script = ExtResource( 1 )
 interrupt_color = Color( 0.705882, 0.705882, 0.705882, 1 )
 
 [node name="Circle" type="CollisionShape2D" parent="."]
 shape = SubResource( 2 )
 
 [node name="Sprite" type="Sprite" parent="."]
-texture = ExtResource( 1 )
+texture = ExtResource( 2 )
 
 [node name="Trail" type="Particles2D" parent="."]
 lifetime = 0.1
 local_coords = false
-process_material = SubResource( 3 )
+process_material = SubResource( 5 )
 texture = ExtResource( 3 )

godot/image/ball.png → godot/component/entity/ball/ball.png


+ 3 - 3
godot/image/ball.png.import

@@ -2,15 +2,15 @@
 
 importer="texture"
 type="StreamTexture"
-path="res://.import/ball.png-b3acf1dfede2a018f7f6209b67c11ad3.stex"
+path="res://.import/ball.png-b2548e3b799dcda5f0fc6f1f4cf32ce3.stex"
 metadata={
 "vram_texture": false
 }
 
 [deps]
 
-source_file="res://image/ball.png"
-dest_files=[ "res://.import/ball.png-b3acf1dfede2a018f7f6209b67c11ad3.stex" ]
+source_file="res://component/entity/ball/ball.png"
+dest_files=[ "res://.import/ball.png-b2548e3b799dcda5f0fc6f1f4cf32ce3.stex" ]
 
 [params]
 

godot/image/ball_particle.png → godot/component/entity/ball/ball_particle.png


+ 3 - 3
godot/image/ball_particle.png.import

@@ -2,15 +2,15 @@
 
 importer="texture"
 type="StreamTexture"
-path="res://.import/ball_particle.png-ea9cac2a19e21c5cd5cd785e8d536ab6.stex"
+path="res://.import/ball_particle.png-e3e73ccbc0d9fb737f0f8e1ca3a842de.stex"
 metadata={
 "vram_texture": false
 }
 
 [deps]
 
-source_file="res://image/ball_particle.png"
-dest_files=[ "res://.import/ball_particle.png-ea9cac2a19e21c5cd5cd785e8d536ab6.stex" ]
+source_file="res://component/entity/ball/ball_particle.png"
+dest_files=[ "res://.import/ball_particle.png-e3e73ccbc0d9fb737f0f8e1ca3a842de.stex" ]
 
 [params]
 

godot/resources/decrease_curve.tres → godot/component/entity/ball/decrease_curve.tres


godot/scripts/Grid.gd → godot/component/entity/brick/Grid.gd


+ 24 - 0
godot/component/entity/brick/brick_tileset.tres

@@ -0,0 +1,24 @@
+[gd_resource type="TileSet" load_steps=3 format=2]
+
+[ext_resource path="res://component/entity/brick/brik.png" type="Texture" id=1]
+
+[sub_resource type="RectangleShape2D" id=5]
+extents = Vector2( 20.5, 10.5 )
+
+[resource]
+0/name = "brik.png 0"
+0/texture = ExtResource( 1 )
+0/tex_offset = Vector2( 0, 0 )
+0/modulate = Color( 1, 1, 1, 1 )
+0/region = Rect2( 0, 0, 40, 20 )
+0/tile_mode = 0
+0/occluder_offset = Vector2( 0, 0 )
+0/navigation_offset = Vector2( 0, 0 )
+0/shapes = [ {
+"autotile_coord": Vector2( 0, 0 ),
+"one_way": false,
+"one_way_margin": 1.0,
+"shape": SubResource( 5 ),
+"shape_transform": Transform2D( 1, 0, 0, 1, 20, 10 )
+} ]
+0/z_index = 0

godot/image/brik.png → godot/component/entity/brick/brik.png


+ 3 - 3
godot/image/brik.png.import

@@ -2,15 +2,15 @@
 
 importer="texture"
 type="StreamTexture"
-path="res://.import/brik.png-bec683149e5d552a46f9a4433df62dce.stex"
+path="res://.import/brik.png-5fd73ddbb0ac43d65af90d45baab4a83.stex"
 metadata={
 "vram_texture": false
 }
 
 [deps]
 
-source_file="res://image/brik.png"
-dest_files=[ "res://.import/brik.png-bec683149e5d552a46f9a4433df62dce.stex" ]
+source_file="res://component/entity/brick/brik.png"
+dest_files=[ "res://.import/brik.png-5fd73ddbb0ac43d65af90d45baab4a83.stex" ]
 
 [params]
 

godot/scripts/Catcher.gd → godot/component/entity/catcher/Catcher.gd


godot/scripts/DeadLine.gd → godot/component/entity/death/DeadLine.gd


+ 1 - 1
godot/scripts/Launcher.gd

@@ -21,7 +21,7 @@ export var BULLET_SPEED = 500.0
 const visor_min_heigth = 10
 const visor_start_shift = Vector2(0, -visor_min_heigth)
 
-var _ballScene = preload("res://scenes/Ball.tscn")
+var _ballScene = preload("res://component/entity/ball/Ball.tscn")
 
 var nbAmmo = 0
 var nbStorage = 1

godot/scripts/TargetLine.gd → godot/component/entity/launcher/TargetLine.gd


godot/image/launcher.png → godot/component/entity/launcher/launcher.png


+ 3 - 3
godot/image/launcher.png.import

@@ -2,15 +2,15 @@
 
 importer="texture"
 type="StreamTexture"
-path="res://.import/launcher.png-84f13e2148f4b340ee3f5eae794706e7.stex"
+path="res://.import/launcher.png-55b3a4f4ab6940eb15f731640760b98a.stex"
 metadata={
 "vram_texture": false
 }
 
 [deps]
 
-source_file="res://image/launcher.png"
-dest_files=[ "res://.import/launcher.png-84f13e2148f4b340ee3f5eae794706e7.stex" ]
+source_file="res://component/entity/launcher/launcher.png"
+dest_files=[ "res://.import/launcher.png-55b3a4f4ab6940eb15f731640760b98a.stex" ]
 
 [params]
 

godot/image/visor.png → godot/component/entity/launcher/visor.png


+ 3 - 3
godot/image/visor.png.import

@@ -2,15 +2,15 @@
 
 importer="texture"
 type="StreamTexture"
-path="res://.import/visor.png-c1b70b21df80efcc97fabf2bd085ef7f.stex"
+path="res://.import/visor.png-d68bd218dee7b003e22acb62a10961b5.stex"
 metadata={
 "vram_texture": false
 }
 
 [deps]
 
-source_file="res://image/visor.png"
-dest_files=[ "res://.import/visor.png-c1b70b21df80efcc97fabf2bd085ef7f.stex" ]
+source_file="res://component/entity/launcher/visor.png"
+dest_files=[ "res://.import/visor.png-d68bd218dee7b003e22acb62a10961b5.stex" ]
 
 [params]
 

godot/scripts/BallCounterLabel.gd → godot/component/ui/BallCounterLabel.gd


godot/scripts/LifeContainer.gd → godot/component/ui/LifeContainer.gd


godot/scripts/ScoreCounterLabel.gd → godot/component/ui/ScoreCounterLabel.gd


godot/scripts/UI.gd → godot/component/ui/UI.gd


+ 26 - 47
godot/scenes/main.tscn

@@ -1,17 +1,17 @@
-[gd_scene load_steps=19 format=2]
-
-[ext_resource path="res://image/launcher.png" type="Texture" id=1]
-[ext_resource path="res://image/brik.png" type="Texture" id=2]
-[ext_resource path="res://scripts/Catcher.gd" type="Script" id=3]
-[ext_resource path="res://scripts/Launcher.gd" type="Script" id=4]
-[ext_resource path="res://image/visor.png" type="Texture" id=5]
-[ext_resource path="res://scripts/Grid.gd" type="Script" id=6]
-[ext_resource path="res://scripts/UI.gd" type="Script" id=7]
-[ext_resource path="res://scripts/BallCounterLabel.gd" type="Script" id=8]
-[ext_resource path="res://scripts/ScoreCounterLabel.gd" type="Script" id=9]
-[ext_resource path="res://scripts/LifeContainer.gd" type="Script" id=10]
-[ext_resource path="res://scripts/DeadLine.gd" type="Script" id=11]
-[ext_resource path="res://scripts/TargetLine.gd" type="Script" id=12]
+[gd_scene load_steps=17 format=2]
+
+[ext_resource path="res://component/ui/BallCounterLabel.gd" type="Script" id=1]
+[ext_resource path="res://component/entity/launcher/TargetLine.gd" type="Script" id=2]
+[ext_resource path="res://component/entity/catcher/Catcher.gd" type="Script" id=3]
+[ext_resource path="res://component/ui/LifeContainer.gd" type="Script" id=4]
+[ext_resource path="res://component/ui/UI.gd" type="Script" id=5]
+[ext_resource path="res://component/ui/ScoreCounterLabel.gd" type="Script" id=6]
+[ext_resource path="res://component/entity/death/DeadLine.gd" type="Script" id=7]
+[ext_resource path="res://component/entity/launcher/Launcher.gd" type="Script" id=8]
+[ext_resource path="res://component/entity/brick/brick_tileset.tres" type="TileSet" id=9]
+[ext_resource path="res://component/entity/launcher/visor.png" type="Texture" id=10]
+[ext_resource path="res://component/entity/launcher/launcher.png" type="Texture" id=11]
+[ext_resource path="res://component/entity/brick/Grid.gd" type="Script" id=12]
 
 [sub_resource type="PhysicsMaterial" id=1]
 friction = 0.0
@@ -26,27 +26,6 @@ extents = Vector2( 300, 50 )
 [sub_resource type="RectangleShape2D" id=4]
 extents = Vector2( 200, 50 )
 
-[sub_resource type="RectangleShape2D" id=5]
-extents = Vector2( 20.5, 10.5 )
-
-[sub_resource type="TileSet" id=6]
-0/name = "brik.png 0"
-0/texture = ExtResource( 2 )
-0/tex_offset = Vector2( 0, 0 )
-0/modulate = Color( 1, 1, 1, 1 )
-0/region = Rect2( 0, 0, 40, 20 )
-0/tile_mode = 0
-0/occluder_offset = Vector2( 0, 0 )
-0/navigation_offset = Vector2( 0, 0 )
-0/shapes = [ {
-"autotile_coord": Vector2( 0, 0 ),
-"one_way": false,
-"one_way_margin": 1.0,
-"shape": SubResource( 5 ),
-"shape_transform": Transform2D( 1, 0, 0, 1, 20, 10 )
-} ]
-0/z_index = 0
-
 [node name="Root" type="Node"]
 
 [node name="Background" type="Panel" parent="."]
@@ -82,23 +61,23 @@ script = ExtResource( 3 )
 shape = SubResource( 4 )
 
 [node name="Launcher" type="Node2D" parent="."]
-script = ExtResource( 4 )
+script = ExtResource( 8 )
 visor_ratio = 1.6
 
 [node name="Grid" type="TileMap" parent="Launcher" groups=[
 "grid",
 ]]
 mode = 2
-tile_set = SubResource( 6 )
+tile_set = ExtResource( 9 )
 cell_size = Vector2( 40, 20 )
 cell_custom_transform = Transform2D( 40, 0, 0, 20, 0, 0 )
 collision_layer = 4
 collision_mask = 8
 format = 1
-script = ExtResource( 6 )
+script = ExtResource( 12 )
 
 [node name="LifeContainer" type="Node2D" parent="Launcher/Grid"]
-script = ExtResource( 10 )
+script = ExtResource( 4 )
 
 [node name="MoveDown" type="Tween" parent="Launcher/Grid"]
 __meta__ = {
@@ -108,14 +87,14 @@ __meta__ = {
 [node name="TargetLine" type="RayCast2D" parent="Launcher"]
 position = Vector2( 200, 400 )
 collision_mask = 6
-script = ExtResource( 12 )
+script = ExtResource( 2 )
 
 [node name="TargetVisor" type="Sprite" parent="Launcher/TargetLine"]
-texture = ExtResource( 5 )
+texture = ExtResource( 10 )
 
 [node name="Source" type="Sprite" parent="Launcher"]
 position = Vector2( 200, 400 )
-texture = ExtResource( 1 )
+texture = ExtResource( 11 )
 
 [node name="ShootDelay" type="Timer" parent="Launcher"]
 wait_time = 0.1
@@ -125,12 +104,12 @@ one_shot = true
 position = Vector2( 380, 390 )
 cast_to = Vector2( -360, 0 )
 collision_mask = 4
-script = ExtResource( 11 )
+script = ExtResource( 7 )
 
 [node name="UI" type="Control" parent="."]
 margin_right = 40.0
 margin_bottom = 40.0
-script = ExtResource( 7 )
+script = ExtResource( 5 )
 __meta__ = {
 "_edit_use_anchors_": false
 }
@@ -198,7 +177,7 @@ margin_bottom = 30.0
 text = "0"
 align = 1
 valign = 1
-script = ExtResource( 8 )
+script = ExtResource( 1 )
 __meta__ = {
 "_edit_use_anchors_": false
 }
@@ -229,7 +208,7 @@ margin_bottom = 30.0
 text = "0"
 align = 1
 valign = 1
-script = ExtResource( 9 )
+script = ExtResource( 6 )
 __meta__ = {
 "_edit_use_anchors_": false
 }
@@ -240,8 +219,8 @@ __meta__ = {
 [connection signal="get_firing" from="Launcher" to="UI" method="_on_Launcher_get_firing"]
 [connection signal="is_full" from="Launcher" to="Launcher/Grid" method="_on_Launcher_is_full"]
 [connection signal="move_visor" from="Launcher" to="Launcher/TargetLine" method="_on_Launcher_move_visor"]
-[connection signal="has_moved" from="Launcher/Grid" to="Launcher" method="_on_Grid_has_moved"]
 [connection signal="has_moved" from="Launcher/Grid" to="Launcher/DeadLine" method="_on_Grid_has_moved"]
+[connection signal="has_moved" from="Launcher/Grid" to="Launcher" method="_on_Grid_has_moved"]
 [connection signal="kace_broken" from="Launcher/Grid" to="Launcher" method="_on_Grid_kace_broken"]
 [connection signal="kace_damaged" from="Launcher/Grid" to="UI/ScorePanel/ScoreCounterLabel" method="_on_Grid_kace_damaged"]
 [connection signal="tween_all_completed" from="Launcher/Grid/MoveDown" to="Launcher/Grid" method="_on_MoveDown_tween_all_completed"]

+ 3 - 3
godot/project.godot

@@ -12,12 +12,12 @@ _global_script_classes=[ {
 "base": "RigidBody2D",
 "class": "Ball",
 "language": "GDScript",
-"path": "res://scripts/Ball.gd"
+"path": "res://component/entity/ball/Ball.gd"
 }, {
 "base": "Area2D",
 "class": "Catcher",
 "language": "GDScript",
-"path": "res://scripts/Catcher.gd"
+"path": "res://component/entity/catcher/Catcher.gd"
 } ]
 _global_script_class_icons={
 "Ball": "",
@@ -28,7 +28,7 @@ _global_script_class_icons={
 
 config/name="Kace"
 config/description="The tiny incredible breakout game."
-run/main_scene="res://scenes/main.tscn"
+run/main_scene="res://main.tscn"
 config/icon="res://icon.png"
 
 [display]