Add files via upload
parent
a18b56d663
commit
444f627be3
|
@ -0,0 +1,353 @@
|
|||
[gd_scene load_steps=22 format=2]
|
||||
|
||||
[ext_resource path="res://Textures/bg.png" type="Texture" id=1]
|
||||
[ext_resource path="res://Scripts/fin/Ganar.gd" type="Script" id=2]
|
||||
[ext_resource path="res://Textures/Black.png" type="Texture" id=3]
|
||||
[ext_resource path="res://Font/pixeled/Pixeled.ttf" type="DynamicFontData" id=4]
|
||||
[ext_resource path="res://Textures/restart.png" type="Texture" id=5]
|
||||
[ext_resource path="res://Textures/exit.png" type="Texture" id=6]
|
||||
[ext_resource path="res://Music/Music3.ogg" type="AudioStream" id=7]
|
||||
[ext_resource path="res://Escenas/SFX/SFX.tscn" type="PackedScene" id=8]
|
||||
[ext_resource path="res://Escenas/Guardar/NG.tscn" type="PackedScene" id=9]
|
||||
|
||||
[sub_resource type="Animation" id=1]
|
||||
resource_name = "anim"
|
||||
length = 10.0
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("Canvas/black:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.5 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/path = NodePath("Control/ScoreRed:rect_position")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/keys = {
|
||||
"times": PoolRealArray( 0, 0.1, 1.5, 2, 3, 4 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 0, 320 ), Vector2( 0, 320 ), Vector2( 0, 320 ), Vector2( 0, 70 ), Vector2( 0, 70 ), Vector2( 192, 70 ) ]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/path = NodePath("Control/ScoreBlue:rect_position")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/keys = {
|
||||
"times": PoolRealArray( 0, 0.1, 1.5, 2, 3, 4 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 384, 320 ), Vector2( 384, 320 ), Vector2( 384, 320 ), Vector2( 384, 70 ), Vector2( 384, 70 ), Vector2( 192, 70 ) ]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/path = NodePath("Control/Title:modulate")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/keys = {
|
||||
"times": PoolRealArray( 0, 0.5, 1.5, 2 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/path = NodePath("Control/ScoreRed:modulate")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/keys = {
|
||||
"times": PoolRealArray( 0, 3.8, 4 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
|
||||
}
|
||||
tracks/5/type = "value"
|
||||
tracks/5/path = NodePath("Control/ScoreBlue:modulate")
|
||||
tracks/5/interp = 1
|
||||
tracks/5/loop_wrap = true
|
||||
tracks/5/imported = false
|
||||
tracks/5/enabled = true
|
||||
tracks/5/keys = {
|
||||
"times": PoolRealArray( 0, 3.8, 4 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
|
||||
}
|
||||
tracks/6/type = "value"
|
||||
tracks/6/path = NodePath("Control/ScoreTotal:visible")
|
||||
tracks/6/interp = 1
|
||||
tracks/6/loop_wrap = true
|
||||
tracks/6/imported = false
|
||||
tracks/6/enabled = true
|
||||
tracks/6/keys = {
|
||||
"times": PoolRealArray( 0, 3.8, 4 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1 ),
|
||||
"update": 1,
|
||||
"values": [ false, false, true ]
|
||||
}
|
||||
tracks/7/type = "value"
|
||||
tracks/7/path = NodePath("Control/ScoreTotal:rect_position")
|
||||
tracks/7/interp = 1
|
||||
tracks/7/loop_wrap = true
|
||||
tracks/7/imported = false
|
||||
tracks/7/enabled = true
|
||||
tracks/7/keys = {
|
||||
"times": PoolRealArray( 0, 4.3, 4.5, 5 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 128, 72 ), Vector2( 128, 72 ), Vector2( 128, 76 ), Vector2( 128, -50 ) ]
|
||||
}
|
||||
tracks/8/type = "value"
|
||||
tracks/8/path = NodePath("Control/buttons:rect_position")
|
||||
tracks/8/interp = 1
|
||||
tracks/8/loop_wrap = true
|
||||
tracks/8/imported = false
|
||||
tracks/8/enabled = true
|
||||
tracks/8/keys = {
|
||||
"times": PoolRealArray( 0, 5.8, 6.2 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 0, 0 ), Vector2( 0, 0 ), Vector2( 0, -160 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="DynamicFont" id=2]
|
||||
font_data = ExtResource( 4 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=3]
|
||||
font_data = ExtResource( 4 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=4]
|
||||
font_data = ExtResource( 4 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=5]
|
||||
font_data = ExtResource( 4 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=6]
|
||||
font_data = ExtResource( 4 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=7]
|
||||
font_data = ExtResource( 4 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=8]
|
||||
font_data = ExtResource( 4 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=9]
|
||||
extents = Vector2( 8, 8 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=10]
|
||||
extents = Vector2( 8, 8 )
|
||||
|
||||
[sub_resource type="Animation" id=11]
|
||||
resource_name = "anim"
|
||||
length = 0.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0.1, 0.5 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=12]
|
||||
extents = Vector2( 300, 200 )
|
||||
|
||||
[node name="Ganar" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="fondo" type="Sprite" parent="."]
|
||||
position = Vector2( 992, -144 )
|
||||
scale = Vector2( 4.11404, 4.11404 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="start" type="AnimationPlayer" parent="."]
|
||||
anims/anim = SubResource( 1 )
|
||||
|
||||
[node name="Control" type="Control" parent="."]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Title" type="Control" parent="Control"]
|
||||
modulate = Color( 1, 1, 1, 0 )
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="YouWin" type="Label" parent="Control/Title"]
|
||||
margin_left = 128.0
|
||||
margin_top = 64.0
|
||||
margin_right = 256.0
|
||||
margin_bottom = 192.0
|
||||
custom_fonts/font = SubResource( 2 )
|
||||
text = "You Win"
|
||||
align = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="red" type="Label" parent="Control/Title"]
|
||||
margin_left = 256.0
|
||||
margin_top = 64.0
|
||||
margin_right = 384.0
|
||||
margin_bottom = 192.0
|
||||
custom_fonts/font = SubResource( 3 )
|
||||
custom_colors/font_color = Color( 1, 0, 0, 1 )
|
||||
text = "Red"
|
||||
align = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="blue" type="Label" parent="Control/Title"]
|
||||
margin_left = 256.0
|
||||
margin_top = 64.0
|
||||
margin_right = 384.0
|
||||
margin_bottom = 192.0
|
||||
custom_fonts/font = SubResource( 3 )
|
||||
custom_colors/font_color = Color( 0, 0.0156863, 1, 1 )
|
||||
text = "Blue"
|
||||
align = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="tie" type="Label" parent="Control/Title"]
|
||||
margin_left = 128.0
|
||||
margin_top = 64.0
|
||||
margin_right = 384.0
|
||||
margin_bottom = 223.0
|
||||
custom_fonts/font = SubResource( 3 )
|
||||
custom_colors/font_color = Color( 1, 1, 1, 1 )
|
||||
text = "emm...
|
||||
tie"
|
||||
align = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ScoreRed" type="Label" parent="Control"]
|
||||
modulate = Color( 1, 1, 1, 0 )
|
||||
margin_left = 192.0
|
||||
margin_top = 70.0
|
||||
margin_right = 320.001
|
||||
margin_bottom = 134.0
|
||||
custom_fonts/font = SubResource( 4 )
|
||||
text = "0"
|
||||
align = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ScoreBlue" type="Label" parent="Control"]
|
||||
modulate = Color( 1, 1, 1, 0 )
|
||||
margin_left = 192.0
|
||||
margin_top = 70.0
|
||||
margin_right = 319.999
|
||||
margin_bottom = 134.0
|
||||
custom_fonts/font = SubResource( 5 )
|
||||
text = "0"
|
||||
align = 1
|
||||
|
||||
[node name="ScoreTotal" type="Label" parent="Control"]
|
||||
margin_left = 128.0
|
||||
margin_top = -50.0
|
||||
margin_right = 384.0
|
||||
margin_bottom = 262.0
|
||||
custom_fonts/font = SubResource( 6 )
|
||||
text = "0"
|
||||
align = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="buttons" type="Control" parent="Control"]
|
||||
margin_top = -160.0
|
||||
margin_right = 40.0
|
||||
margin_bottom = -120.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="SR" type="Label" parent="Control/buttons"]
|
||||
margin_left = 128.0
|
||||
margin_top = 392.0
|
||||
margin_right = 192.0
|
||||
margin_bottom = 448.0
|
||||
custom_fonts/font = SubResource( 7 )
|
||||
text = "0"
|
||||
align = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="SB" type="Label" parent="Control/buttons"]
|
||||
margin_left = 320.0
|
||||
margin_top = 392.0
|
||||
margin_right = 384.0
|
||||
margin_bottom = 448.0
|
||||
custom_fonts/font = SubResource( 8 )
|
||||
text = "0"
|
||||
align = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="back" type="TouchScreenButton" parent="Control/buttons"]
|
||||
position = Vector2( 192, 384 )
|
||||
scale = Vector2( 4, 4 )
|
||||
normal = ExtResource( 5 )
|
||||
shape = SubResource( 9 )
|
||||
|
||||
[node name="exit" type="TouchScreenButton" parent="Control/buttons"]
|
||||
position = Vector2( 256, 384 )
|
||||
scale = Vector2( 4, 4 )
|
||||
normal = ExtResource( 6 )
|
||||
shape = SubResource( 10 )
|
||||
|
||||
[node name="Canvas" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="black" type="Sprite" parent="Canvas"]
|
||||
visible = false
|
||||
modulate = Color( 1, 1, 1, 0 )
|
||||
position = Vector2( 284, 144 )
|
||||
scale = Vector2( 9.875, 5.5 )
|
||||
texture = ExtResource( 3 )
|
||||
|
||||
[node name="end" type="AnimationPlayer" parent="Canvas/black"]
|
||||
anims/anim = SubResource( 11 )
|
||||
|
||||
[node name="speed" type="TouchScreenButton" parent="."]
|
||||
shape = SubResource( 12 )
|
||||
|
||||
[node name="music" type="AudioStreamPlayer2D" parent="."]
|
||||
stream = ExtResource( 7 )
|
||||
|
||||
[node name="SFX" parent="." instance=ExtResource( 8 )]
|
||||
|
||||
[node name="NG" parent="." instance=ExtResource( 9 )]
|
||||
[connection signal="pressed" from="Control/buttons/back" to="." method="_on_back_pressed"]
|
||||
[connection signal="pressed" from="Control/buttons/exit" to="." method="_on_exit_pressed"]
|
||||
[connection signal="animation_finished" from="Canvas/black/end" to="." method="_on_end_animation_finished"]
|
||||
[connection signal="pressed" from="speed" to="." method="_on_speed_pressed"]
|
||||
[connection signal="released" from="speed" to="." method="_on_speed_released"]
|
|
@ -0,0 +1,10 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://addons/PersistenceNode/persistence_node.gd" type="Script" id=1]
|
||||
|
||||
[node name="NG" type="Node2D"]
|
||||
|
||||
[node name="Guardar" type="Node" parent="."]
|
||||
script = ExtResource( 1 )
|
||||
mode = 1
|
||||
folder_name = "save"
|
|
@ -0,0 +1,477 @@
|
|||
[gd_scene load_steps=42 format=2]
|
||||
|
||||
[ext_resource path="res://Textures/g.png" type="Texture" id=1]
|
||||
[ext_resource path="res://Escenas/aro.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://Textures/RedButton.png" type="Texture" id=3]
|
||||
[ext_resource path="res://Textures/r3.png" type="Texture" id=4]
|
||||
[ext_resource path="res://Scripts/Game/Juego.gd" type="Script" id=7]
|
||||
[ext_resource path="res://Textures/BlueButton.png" type="Texture" id=8]
|
||||
[ext_resource path="res://Textures/BlueButton_pressed.png" type="Texture" id=9]
|
||||
[ext_resource path="res://Textures/RedButton_pressed.png" type="Texture" id=10]
|
||||
[ext_resource path="res://Textures/bg.png" type="Texture" id=11]
|
||||
[ext_resource path="res://Font/pixeled/Pixeled.ttf" type="DynamicFontData" id=12]
|
||||
[ext_resource path="res://Textures/Black.png" type="Texture" id=13]
|
||||
[ext_resource path="res://Scripts/Menus/pausa.gd" type="Script" id=14]
|
||||
[ext_resource path="res://Textures/menu.png" type="Texture" id=15]
|
||||
[ext_resource path="res://Textures/exit.png" type="Texture" id=16]
|
||||
[ext_resource path="res://Textures/music.png" type="Texture" id=17]
|
||||
[ext_resource path="res://Textures/fx.png" type="Texture" id=18]
|
||||
[ext_resource path="res://Textures/restart.png" type="Texture" id=19]
|
||||
[ext_resource path="res://Music/Music1.wav" type="AudioStream" id=20]
|
||||
[ext_resource path="res://Escenas/SFX/SFX.tscn" type="PackedScene" id=21]
|
||||
|
||||
[sub_resource type="SpriteFrames" id=1]
|
||||
animations = [ {
|
||||
"frames": [ ExtResource( 1 ) ],
|
||||
"loop": true,
|
||||
"name": "default",
|
||||
"speed": 5.0
|
||||
} ]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id=2]
|
||||
radius = 2.17232
|
||||
height = 38.2286
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id=3]
|
||||
radius = 9.10106
|
||||
height = 24.9725
|
||||
|
||||
[sub_resource type="SpriteFrames" id=4]
|
||||
animations = [ {
|
||||
"frames": [ ExtResource( 4 ) ],
|
||||
"loop": true,
|
||||
"name": "normal",
|
||||
"speed": 20.0
|
||||
} ]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=5]
|
||||
extents = Vector2( 73.4001, 2.62866 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=6]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=7]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=8]
|
||||
extents = Vector2( 152, 24 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=9]
|
||||
extents = Vector2( 263.86, 30.3732 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=10]
|
||||
extents = Vector2( 46.5574, 10 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=11]
|
||||
extents = Vector2( 165.358, 10 )
|
||||
|
||||
[sub_resource type="Curve2D" id=12]
|
||||
_data = {
|
||||
"points": PoolVector2Array( 0, 0, 0, 0, 512, 0, 0, 0, 0, 0, 0, 0 )
|
||||
}
|
||||
|
||||
[sub_resource type="DynamicFont" id=13]
|
||||
font_data = ExtResource( 12 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=14]
|
||||
font_data = ExtResource( 12 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=15]
|
||||
size = 12
|
||||
font_data = ExtResource( 12 )
|
||||
|
||||
[sub_resource type="Animation" id=16]
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0.2, 1 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 0, 0, 0, 1 ), Color( 1, 1, 1, 0 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=17]
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.6 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 0 ), Color( 0, 0, 0, 1 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=18]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=19]
|
||||
extents = Vector2( 5, 5 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=20]
|
||||
extents = Vector2( 5, 5 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=21]
|
||||
extents = Vector2( 5, 5 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=22]
|
||||
extents = Vector2( 5, 5 )
|
||||
|
||||
[node name="Juego" type="Node2D"]
|
||||
script = ExtResource( 7 )
|
||||
aro = ExtResource( 2 )
|
||||
|
||||
[node name="fondo" type="Sprite" parent="."]
|
||||
position = Vector2( 1375, -269.728 )
|
||||
scale = Vector2( 5.50138, 5.50138 )
|
||||
texture = ExtResource( 11 )
|
||||
|
||||
[node name="Blue" type="StaticBody2D" parent="." groups=[
|
||||
"bluepa",
|
||||
"pa",
|
||||
]]
|
||||
position = Vector2( 288, 104 )
|
||||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="Blue"]
|
||||
position = Vector2( 0.981689, -0.00418854 )
|
||||
scale = Vector2( 3, 3 )
|
||||
frames = SubResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Blue"]
|
||||
position = Vector2( -0.899765, 1.11069 )
|
||||
rotation = 0.811578
|
||||
shape = SubResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="Red" type="StaticBody2D" parent="." groups=[
|
||||
"pa",
|
||||
"redpa",
|
||||
]]
|
||||
position = Vector2( 224, 104 )
|
||||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="Red"]
|
||||
position = Vector2( 0.840912, 0 )
|
||||
scale = Vector2( 3, 3 )
|
||||
frames = SubResource( 1 )
|
||||
flip_h = true
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Red"]
|
||||
position = Vector2( 1.33786, 2.45273 )
|
||||
rotation = 2.43299
|
||||
shape = SubResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="protector" type="StaticBody2D" parent="."]
|
||||
position = Vector2( 256, 88 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="protector"]
|
||||
position = Vector2( 28.5962, 20.9498 )
|
||||
rotation = 0.698132
|
||||
shape = SubResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="protector"]
|
||||
position = Vector2( -26.9602, 21.5251 )
|
||||
rotation = -0.788889
|
||||
shape = SubResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="protector"]
|
||||
polygon = PoolVector2Array( -41.3202, 1.34836, -31.0671, 4.70712, -41.6737, 12.4853 )
|
||||
|
||||
[node name="CollisionPolygon2D2" type="CollisionPolygon2D" parent="protector"]
|
||||
position = Vector2( 77.0746, -0.707108 )
|
||||
polygon = PoolVector2Array( -44.8557, 4.53033, -36.3704, 1.17159, -41.6737, 12.4853 )
|
||||
|
||||
[node name="aro" type="Node2D" parent="."]
|
||||
|
||||
[node name="blueh" type="StaticBody2D" parent="." groups=[
|
||||
"blue",
|
||||
"h",
|
||||
]]
|
||||
position = Vector2( 392, 144 )
|
||||
scale = Vector2( 2, 2 )
|
||||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="blueh"]
|
||||
position = Vector2( -0.943878, 0 )
|
||||
rotation = -0.541052
|
||||
scale = Vector2( 2.5, 2.5 )
|
||||
frames = SubResource( 4 )
|
||||
animation = "normal"
|
||||
playing = true
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="blueh"]
|
||||
position = Vector2( 5.24016, 7.6393 )
|
||||
rotation = -0.558505
|
||||
shape = SubResource( 5 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="redh" type="StaticBody2D" parent="." groups=[
|
||||
"h",
|
||||
"red",
|
||||
]]
|
||||
position = Vector2( 112, 152 )
|
||||
scale = Vector2( 2, 2 )
|
||||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="redh"]
|
||||
position = Vector2( 5.15906, -3.96849 )
|
||||
rotation = 0.541052
|
||||
scale = Vector2( 2.5, 2.5 )
|
||||
frames = SubResource( 4 )
|
||||
animation = "click"
|
||||
frame = 4
|
||||
playing = true
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="redh"]
|
||||
position = Vector2( -0.63826, 1.66628 )
|
||||
rotation = 0.558505
|
||||
shape = SubResource( 5 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="bluebutton" type="TouchScreenButton" parent="."]
|
||||
position = Vector2( 448, 216 )
|
||||
scale = Vector2( 3.5, 3.5 )
|
||||
normal = ExtResource( 8 )
|
||||
pressed = ExtResource( 9 )
|
||||
shape = SubResource( 6 )
|
||||
|
||||
[node name="redbutton" type="TouchScreenButton" parent="."]
|
||||
position = Vector2( 8, 216 )
|
||||
scale = Vector2( 3.5, 3.5 )
|
||||
normal = ExtResource( 3 )
|
||||
pressed = ExtResource( 10 )
|
||||
shape = SubResource( 7 )
|
||||
|
||||
[node name="htimerblue" type="Timer" parent="."]
|
||||
|
||||
[node name="htimerred" type="Timer" parent="."]
|
||||
|
||||
[node name="paredes" type="StaticBody2D" parent="."]
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="paredes"]
|
||||
polygon = PoolVector2Array( 88, -8, 520, -8, 511.102, 288.465, -0.646973, 287.534, -8, -8, 72, -8, 88, -8, 63.0984, -69.9342, -55.7024, -53.9161, -66.0534, 348.184, 541.306, 313.005, 540.363, -21.1262, 38.3415, -57.3069 )
|
||||
|
||||
[node name="killarea" type="Area2D" parent="." groups=[
|
||||
"killarea",
|
||||
]]
|
||||
position = Vector2( 256, 280 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="killarea"]
|
||||
position = Vector2( -3.05176e-05, 8 )
|
||||
shape = SubResource( 8 )
|
||||
|
||||
[node name="Help" type="Area2D" parent="." groups=[
|
||||
"help",
|
||||
]]
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Help"]
|
||||
polygon = PoolVector2Array( 512, 64, 256, 224, 0, 56, -32, 72, -24, 104, 256, 256, 528, 96 )
|
||||
|
||||
[node name="exit" type="Area2D" parent="." groups=[
|
||||
"exit",
|
||||
]]
|
||||
position = Vector2( 256, 232 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="exit"]
|
||||
modulate = Color( 0, 0, 0, 1 )
|
||||
self_modulate = Color( 0, 0, 0, 1 )
|
||||
position = Vector2( 0.14006, 5.34988 )
|
||||
shape = SubResource( 9 )
|
||||
|
||||
[node name="exit2" type="Area2D" parent="." groups=[
|
||||
"exit2",
|
||||
]]
|
||||
position = Vector2( 256, 0 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="exit2"]
|
||||
modulate = Color( 0, 0, 0, 1 )
|
||||
self_modulate = Color( 0, 0, 0, 1 )
|
||||
position = Vector2( 0.14006, 5.34988 )
|
||||
shape = SubResource( 9 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="2" type="CollisionShape2D" parent="exit2"]
|
||||
position = Vector2( 0, 128 )
|
||||
shape = SubResource( 10 )
|
||||
|
||||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="exit2"]
|
||||
position = Vector2( 0, 80 )
|
||||
shape = SubResource( 11 )
|
||||
|
||||
[node name="Path2D" type="Path2D" parent="."]
|
||||
curve = SubResource( 12 )
|
||||
|
||||
[node name="PathFollow2D" type="PathFollow2D" parent="Path2D"]
|
||||
position = Vector2( 512, 0 )
|
||||
rotation = 3.14159
|
||||
|
||||
[node name="timetospawn" type="Timer" parent="Path2D"]
|
||||
|
||||
[node name="Control" type="Control" parent="."]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="redscore" type="Label" parent="Control"]
|
||||
margin_left = 200.0
|
||||
margin_top = 8.0
|
||||
margin_right = 232.0
|
||||
margin_bottom = 54.0
|
||||
custom_fonts/font = SubResource( 13 )
|
||||
text = "0"
|
||||
align = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="bluescore" type="Label" parent="Control"]
|
||||
margin_left = 280.0
|
||||
margin_top = 8.0
|
||||
margin_right = 312.0
|
||||
margin_bottom = 54.0
|
||||
custom_fonts/font = SubResource( 14 )
|
||||
text = "0"
|
||||
align = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="timeorscore" type="Label" parent="Control"]
|
||||
margin_left = 232.0
|
||||
margin_right = 280.0
|
||||
margin_bottom = 35.0
|
||||
custom_fonts/font = SubResource( 15 )
|
||||
text = "000"
|
||||
align = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Canvas2" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="black" type="Sprite" parent="Canvas2"]
|
||||
visible = false
|
||||
modulate = Color( 0, 0, 0, 1 )
|
||||
position = Vector2( 258.801, 149.907 )
|
||||
scale = Vector2( 9.08753, 5.68458 )
|
||||
texture = ExtResource( 13 )
|
||||
|
||||
[node name="Animation" type="AnimationPlayer" parent="Canvas2/black"]
|
||||
anims/anim = SubResource( 16 )
|
||||
|
||||
[node name="Animation2" type="AnimationPlayer" parent="Canvas2/black"]
|
||||
anims/anim = SubResource( 17 )
|
||||
|
||||
[node name="Canvas" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="pausa" type="Node2D" parent="Canvas"]
|
||||
pause_mode = 2
|
||||
script = ExtResource( 14 )
|
||||
|
||||
[node name="Pause" type="TouchScreenButton" parent="Canvas/pausa"]
|
||||
pause_mode = 2
|
||||
scale = Vector2( 2, 2 )
|
||||
normal = ExtResource( 15 )
|
||||
shape = SubResource( 18 )
|
||||
|
||||
[node name="back" type="Sprite" parent="Canvas/pausa"]
|
||||
pause_mode = 2
|
||||
position = Vector2( 256, 128 )
|
||||
scale = Vector2( 2, 2 )
|
||||
texture = ExtResource( 13 )
|
||||
|
||||
[node name="Music" type="TouchScreenButton" parent="Canvas/pausa/back"]
|
||||
position = Vector2( -4, -32 )
|
||||
scale = Vector2( 2.25, 2.25 )
|
||||
normal = ExtResource( 17 )
|
||||
shape = SubResource( 19 )
|
||||
|
||||
[node name="x" type="Sprite" parent="Canvas/pausa/back/Music"]
|
||||
visible = false
|
||||
modulate = Color( 1, 0, 0, 1 )
|
||||
position = Vector2( 8, 8 )
|
||||
texture = ExtResource( 16 )
|
||||
|
||||
[node name="MainMenu" type="TouchScreenButton" parent="Canvas/pausa/back"]
|
||||
position = Vector2( -4, -4 )
|
||||
scale = Vector2( 2.25, 2.25 )
|
||||
normal = ExtResource( 16 )
|
||||
shape = SubResource( 20 )
|
||||
|
||||
[node name="FX" type="TouchScreenButton" parent="Canvas/pausa/back"]
|
||||
pause_mode = 2
|
||||
position = Vector2( -31.6031, -31.4047 )
|
||||
scale = Vector2( 2.25, 2.25 )
|
||||
normal = ExtResource( 18 )
|
||||
shape = SubResource( 21 )
|
||||
|
||||
[node name="x" type="Sprite" parent="Canvas/pausa/back/FX"]
|
||||
pause_mode = 2
|
||||
visible = false
|
||||
modulate = Color( 1, 0, 0, 1 )
|
||||
position = Vector2( 8.04582, 8.04583 )
|
||||
texture = ExtResource( 16 )
|
||||
|
||||
[node name="Restart" type="TouchScreenButton" parent="Canvas/pausa/back"]
|
||||
position = Vector2( -32, -4 )
|
||||
scale = Vector2( 2.25, 2.25 )
|
||||
normal = ExtResource( 19 )
|
||||
shape = SubResource( 22 )
|
||||
|
||||
[node name="SFX" parent="Canvas/pausa" instance=ExtResource( 21 )]
|
||||
pause_mode = 2
|
||||
|
||||
[node name="Music" type="Node" parent="."]
|
||||
|
||||
[node name="Music" type="AudioStreamPlayer2D" parent="Music"]
|
||||
pause_mode = 2
|
||||
position = Vector2( 256, 128 )
|
||||
stream = ExtResource( 20 )
|
||||
|
||||
[node name="Time" type="Timer" parent="."]
|
||||
|
||||
[node name="SFX" parent="." instance=ExtResource( 21 )]
|
||||
[connection signal="pressed" from="bluebutton" to="." method="_on_bluebutton_pressed"]
|
||||
[connection signal="pressed" from="redbutton" to="." method="_on_redbutton_pressed"]
|
||||
[connection signal="timeout" from="htimerblue" to="." method="_on_htimerblue_timeout"]
|
||||
[connection signal="timeout" from="htimerred" to="." method="_on_htimerred_timeout"]
|
||||
[connection signal="timeout" from="Path2D/timetospawn" to="." method="_on_timetospawn_timeout"]
|
||||
[connection signal="animation_finished" from="Canvas2/black/Animation2" to="." method="_on_Animation2_animation_finished"]
|
||||
[connection signal="pressed" from="Canvas/pausa/Pause" to="Canvas/pausa" method="_on_Pause_pressed"]
|
||||
[connection signal="pressed" from="Canvas/pausa/back/Music" to="." method="_on_Music_pressed"]
|
||||
[connection signal="pressed" from="Canvas/pausa/back/MainMenu" to="Canvas/pausa" method="_on_MainMenu_pressed"]
|
||||
[connection signal="pressed" from="Canvas/pausa/back/FX" to="Canvas/pausa" method="_on_FX_pressed"]
|
||||
[connection signal="pressed" from="Canvas/pausa/back/Restart" to="Canvas/pausa" method="_on_Restart_pressed"]
|
||||
[connection signal="finished" from="Music/Music" to="." method="_on_Music_finished"]
|
||||
[connection signal="timeout" from="Time" to="." method="_on_Time_timeout"]
|
|
@ -0,0 +1,364 @@
|
|||
[gd_scene load_steps=28 format=2]
|
||||
|
||||
[ext_resource path="res://Textures/bg.png" type="Texture" id=1]
|
||||
[ext_resource path="res://Scripts/Menus/MenuModeGame.gd" type="Script" id=2]
|
||||
[ext_resource path="res://Font/pixeled/Pixeled.ttf" type="DynamicFontData" id=3]
|
||||
[ext_resource path="res://Textures/Black.png" type="Texture" id=4]
|
||||
[ext_resource path="res://Music/Music3.ogg" type="AudioStream" id=5]
|
||||
[ext_resource path="res://Escenas/SFX/SFX.tscn" type="PackedScene" id=6]
|
||||
[ext_resource path="res://Textures/restart.png" type="Texture" id=7]
|
||||
[ext_resource path="res://Textures/restartright.png" type="Texture" id=8]
|
||||
[ext_resource path="res://Textures/best.png" type="Texture" id=9]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=2]
|
||||
|
||||
[sub_resource type="Animation" id=3]
|
||||
resource_name = "15s byL"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("../Choose:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.19, 0.202 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 0, 0 ), Vector2( 450, 0 ), Vector2( -1407, 0 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=4]
|
||||
resource_name = "15s byR"
|
||||
length = 0.2
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("../Choose:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.2 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( -900, 0 ), Vector2( -1407, 0 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=5]
|
||||
resource_name = "1m byL"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("../Choose:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.2 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( -450, 0 ), Vector2( 0, 0 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=6]
|
||||
resource_name = "1m byR"
|
||||
length = 0.2
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("../Choose:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.19, 0.2 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( -1407, 0 ), Vector2( -1800, 0 ), Vector2( 0, 0 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=7]
|
||||
resource_name = "5m byL"
|
||||
length = 0.2
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("../Choose:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.2 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( -900, 0 ), Vector2( -450, 0 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=8]
|
||||
resource_name = "5m byL"
|
||||
length = 0.2
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("../Choose:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.2 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 0, 0 ), Vector2( -450, 0 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=9]
|
||||
resource_name = "5s byL"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("../Choose:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.2 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( -1407, 0 ), Vector2( -900, 0 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=10]
|
||||
resource_name = "5s byR"
|
||||
length = 0.2
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("../Choose:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.2 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( -450, 0 ), Vector2( -900, 0 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=11]
|
||||
extents = Vector2( 64, 33 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=12]
|
||||
font_data = ExtResource( 3 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=13]
|
||||
extents = Vector2( 64, 33 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=14]
|
||||
|
||||
[sub_resource type="Animation" id=15]
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0.1, 0.2, 0.6 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=16]
|
||||
length = 0.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0.1, 0.5 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=17]
|
||||
length = 0.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0.1, 0.5 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=18]
|
||||
resource_name = "anim"
|
||||
loop = true
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("Choose/1m/Sprite:rotation_degrees")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.3, 0.7, 1 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ 0.0, 5.0, -5.0, 0.0 ]
|
||||
}
|
||||
|
||||
[node name="MMG" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="fondo" type="Sprite" parent="."]
|
||||
position = Vector2( 968, -120 )
|
||||
scale = Vector2( 3.95175, 3.95175 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="ModeChoose" type="Node2D" parent="."]
|
||||
|
||||
[node name="left" type="TouchScreenButton" parent="ModeChoose"]
|
||||
position = Vector2( 64, 128 )
|
||||
scale = Vector2( 4, 4 )
|
||||
normal = ExtResource( 7 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="right" type="TouchScreenButton" parent="ModeChoose"]
|
||||
position = Vector2( 384, 128 )
|
||||
scale = Vector2( 4, 4 )
|
||||
normal = ExtResource( 8 )
|
||||
shape = SubResource( 2 )
|
||||
|
||||
[node name="choosean" type="AnimationPlayer" parent="ModeChoose"]
|
||||
"anims/15s byL" = SubResource( 3 )
|
||||
"anims/15s byR" = SubResource( 4 )
|
||||
"anims/1m byL" = SubResource( 5 )
|
||||
"anims/1m byR" = SubResource( 6 )
|
||||
"anims/5m byL" = SubResource( 7 )
|
||||
"anims/5m byR" = SubResource( 8 )
|
||||
"anims/5s byL" = SubResource( 9 )
|
||||
"anims/5s byR" = SubResource( 10 )
|
||||
|
||||
[node name="Choose" type="Node2D" parent="."]
|
||||
|
||||
[node name="1m" type="TouchScreenButton" parent="Choose"]
|
||||
position = Vector2( 192, 128 )
|
||||
shape = SubResource( 11 )
|
||||
|
||||
[node name="Label" type="Label" parent="Choose/1m"]
|
||||
margin_right = 128.0
|
||||
margin_bottom = 64.0
|
||||
custom_fonts/font = SubResource( 12 )
|
||||
text = "1 min"
|
||||
align = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="1m" type="VisibilityNotifier2D" parent="Choose/1m"]
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="Choose/1m"]
|
||||
position = Vector2( 61.5714, -22 )
|
||||
rotation = 0.0855877
|
||||
scale = Vector2( 4.16071, 4.16071 )
|
||||
texture = ExtResource( 9 )
|
||||
|
||||
[node name="5m" type="TouchScreenButton" parent="Choose"]
|
||||
position = Vector2( 640, 128 )
|
||||
shape = SubResource( 11 )
|
||||
__meta__ = {
|
||||
"_edit_group_": true
|
||||
}
|
||||
|
||||
[node name="Label" type="Label" parent="Choose/5m"]
|
||||
margin_right = 128.0
|
||||
margin_bottom = 64.0
|
||||
custom_fonts/font = SubResource( 12 )
|
||||
text = "5 min"
|
||||
align = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="5m" type="VisibilityNotifier2D" parent="Choose/5m"]
|
||||
|
||||
[node name="5s" type="TouchScreenButton" parent="Choose"]
|
||||
position = Vector2( 1088, 128 )
|
||||
shape = SubResource( 13 )
|
||||
__meta__ = {
|
||||
"_edit_group_": true
|
||||
}
|
||||
|
||||
[node name="Label" type="Label" parent="Choose/5s"]
|
||||
margin_right = 128.0
|
||||
margin_bottom = 64.0
|
||||
custom_fonts/font = SubResource( 12 )
|
||||
text = " 5 Score"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="5s" type="VisibilityNotifier2D" parent="Choose/5s"]
|
||||
|
||||
[node name="15s" type="TouchScreenButton" parent="Choose"]
|
||||
position = Vector2( 1600, 128 )
|
||||
shape = SubResource( 13 )
|
||||
__meta__ = {
|
||||
"_edit_group_": true
|
||||
}
|
||||
|
||||
[node name="Label" type="Label" parent="Choose/15s"]
|
||||
margin_right = 128.0
|
||||
margin_bottom = 64.0
|
||||
custom_fonts/font = SubResource( 12 )
|
||||
text = " 15 Score"
|
||||
align = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="15s" type="VisibilityNotifier2D" parent="Choose/15s"]
|
||||
|
||||
[node name="back" type="TouchScreenButton" parent="."]
|
||||
scale = Vector2( 2, 2 )
|
||||
normal = ExtResource( 7 )
|
||||
shape = SubResource( 14 )
|
||||
|
||||
[node name="black" type="Sprite" parent="."]
|
||||
visible = false
|
||||
position = Vector2( 292, 172 )
|
||||
scale = Vector2( 10.125, 6.375 )
|
||||
texture = ExtResource( 4 )
|
||||
|
||||
[node name="start" type="AnimationPlayer" parent="black"]
|
||||
anims/anim = SubResource( 15 )
|
||||
|
||||
[node name="end" type="AnimationPlayer" parent="black"]
|
||||
anims/anim = SubResource( 16 )
|
||||
|
||||
[node name="end2" type="AnimationPlayer" parent="black"]
|
||||
anims/anim = SubResource( 17 )
|
||||
|
||||
[node name="music" type="AudioStreamPlayer2D" parent="."]
|
||||
stream = ExtResource( 5 )
|
||||
|
||||
[node name="SFX" parent="." instance=ExtResource( 6 )]
|
||||
|
||||
[node name="animate" type="AnimationPlayer" parent="."]
|
||||
anims/anim = SubResource( 18 )
|
||||
[connection signal="pressed" from="ModeChoose/left" to="." method="_on_left_pressed"]
|
||||
[connection signal="pressed" from="ModeChoose/right" to="." method="_on_right_pressed"]
|
||||
[connection signal="pressed" from="Choose/1m" to="." method="_on_1m_pressed"]
|
||||
[connection signal="screen_entered" from="Choose/1m/1m" to="." method="_on_1m_screen_entered"]
|
||||
[connection signal="pressed" from="Choose/5m" to="." method="_on_5m_pressed"]
|
||||
[connection signal="screen_entered" from="Choose/5m/5m" to="." method="_on_5m_screen_entered"]
|
||||
[connection signal="pressed" from="Choose/5s" to="." method="_on_5s_pressed"]
|
||||
[connection signal="screen_entered" from="Choose/5s/5s" to="." method="_on_5s_screen_entered"]
|
||||
[connection signal="pressed" from="Choose/15s" to="." method="_on_15s_pressed"]
|
||||
[connection signal="screen_entered" from="Choose/15s/15s" to="." method="_on_15s_screen_entered"]
|
||||
[connection signal="pressed" from="back" to="." method="_on_back_pressed"]
|
||||
[connection signal="animation_finished" from="black/end" to="." method="_on_end_animation_finished"]
|
||||
[connection signal="animation_finished" from="black/end2" to="." method="_on_end2_animation_finished"]
|
|
@ -0,0 +1,253 @@
|
|||
[gd_scene load_steps=22 format=2]
|
||||
|
||||
[ext_resource path="res://Textures/bg.png" type="Texture" id=1]
|
||||
[ext_resource path="res://Font/pixeled/Pixeled.ttf" type="DynamicFontData" id=2]
|
||||
[ext_resource path="res://Scripts/Menus/MenuPrincipal.gd" type="Script" id=3]
|
||||
[ext_resource path="res://Escenas/Guardar/NG.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://Textures/score.png" type="Texture" id=5]
|
||||
[ext_resource path="res://Textures/Black.png" type="Texture" id=6]
|
||||
[ext_resource path="res://Textures/exit.png" type="Texture" id=7]
|
||||
[ext_resource path="res://Music/Music2.wav" type="AudioStream" id=8]
|
||||
[ext_resource path="res://Textures/info.png" type="Texture" id=9]
|
||||
[ext_resource path="res://Escenas/SFX/SFX.tscn" type="PackedScene" id=10]
|
||||
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
size = 48
|
||||
font_data = ExtResource( 2 )
|
||||
|
||||
[sub_resource type="Animation" id=2]
|
||||
resource_name = "megacolor"
|
||||
length = 5.0
|
||||
loop = true
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0.1, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1.10957, 1, 1, 1, 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 1 ), Color( 0, 0.25098, 1, 1 ), Color( 0, 1, 0.929412, 1 ), Color( 0, 0, 0, 1 ), Color( 0.313726, 1, 0, 1 ), Color( 0.478431, 0, 1, 1 ), Color( 1, 0.890196, 0, 1 ), Color( 0, 1, 0.788235, 1 ), Color( 1, 1, 1, 1 ), Color( 1, 0.701961, 0, 1 ), Color( 1, 1, 1, 1 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=3]
|
||||
extents = Vector2( 50, 30 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=4]
|
||||
font_data = ExtResource( 2 )
|
||||
|
||||
[sub_resource type="Animation" id=5]
|
||||
loop = true
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.5, 1 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=6]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=7]
|
||||
|
||||
[sub_resource type="Animation" id=8]
|
||||
length = 0.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.5 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 0 ), Color( 0, 0, 0, 1 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=9]
|
||||
length = 0.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.5 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 0 ), Color( 0, 0, 0, 1 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=10]
|
||||
length = 0.6
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.2, 0.5 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=11]
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:volume_db")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0.1, 0.4 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ 0.0, -80.0 ]
|
||||
}
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
script = ExtResource( 3 )
|
||||
|
||||
[node name="fondo" type="Sprite" parent="."]
|
||||
position = Vector2( 1037.51, -163.989 )
|
||||
scale = Vector2( 4.17015, 4.17015 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="Arar" type="Control" parent="."]
|
||||
margin_left = -474.877
|
||||
margin_top = -141.831
|
||||
margin_right = -434.877
|
||||
margin_bottom = -101.831
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="black" type="Label" parent="Arar"]
|
||||
margin_left = 522.296
|
||||
margin_top = 155.683
|
||||
margin_right = 714.296
|
||||
margin_bottom = 290.683
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "Arar"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="white" type="Label" parent="Arar"]
|
||||
margin_left = 519.296
|
||||
margin_top = 153.433
|
||||
margin_right = 711.296
|
||||
margin_bottom = 288.433
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
text = "Arar"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Animation" type="AnimationPlayer" parent="Arar"]
|
||||
anims/megacolor = SubResource( 2 )
|
||||
|
||||
[node name="TouchScreenButton" type="TouchScreenButton" parent="."]
|
||||
position = Vector2( -84.2998, 38.7794 )
|
||||
scale = Vector2( 7.08687, 7.08687 )
|
||||
shape = SubResource( 3 )
|
||||
passby_press = true
|
||||
|
||||
[node name="Play" type="Node2D" parent="."]
|
||||
modulate = Color( 1, 1, 1, 0.515438 )
|
||||
position = Vector2( 128, 192 )
|
||||
|
||||
[node name="black" type="Label" parent="Play"]
|
||||
modulate = Color( 0, 0, 0, 1 )
|
||||
anchor_top = -0.121
|
||||
margin_left = 2.0
|
||||
margin_top = 2.0
|
||||
margin_right = 339.0
|
||||
margin_bottom = 48.0
|
||||
custom_fonts/font = SubResource( 4 )
|
||||
text = "Touch the Screen to play"
|
||||
align = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="white" type="Label" parent="Play"]
|
||||
anchor_top = -0.121
|
||||
margin_right = 337.0
|
||||
margin_bottom = 46.0
|
||||
custom_fonts/font = SubResource( 4 )
|
||||
text = "Touch the Screen to play"
|
||||
align = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Animation" type="AnimationPlayer" parent="Play"]
|
||||
anims/anim = SubResource( 5 )
|
||||
|
||||
[node name="exit" type="TouchScreenButton" parent="."]
|
||||
scale = Vector2( 2, 2 )
|
||||
normal = ExtResource( 7 )
|
||||
shape = SubResource( 6 )
|
||||
|
||||
[node name="info" type="TouchScreenButton" parent="."]
|
||||
position = Vector2( 48, 0 )
|
||||
scale = Vector2( 2, 2 )
|
||||
normal = ExtResource( 9 )
|
||||
shape = SubResource( 7 )
|
||||
|
||||
[node name="scoreandother" type="TouchScreenButton" parent="."]
|
||||
position = Vector2( 96, 0 )
|
||||
scale = Vector2( 2, 2 )
|
||||
normal = ExtResource( 5 )
|
||||
shape = SubResource( 7 )
|
||||
|
||||
[node name="canvas" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="black" type="Sprite" parent="canvas"]
|
||||
visible = false
|
||||
position = Vector2( 260, 150 )
|
||||
scale = Vector2( 9.25, 5.6875 )
|
||||
texture = ExtResource( 6 )
|
||||
|
||||
[node name="Animation" type="AnimationPlayer" parent="canvas/black"]
|
||||
anims/anim = SubResource( 8 )
|
||||
|
||||
[node name="Animation3" type="AnimationPlayer" parent="canvas/black"]
|
||||
anims/anim = SubResource( 9 )
|
||||
|
||||
[node name="Animation2" type="AnimationPlayer" parent="canvas/black"]
|
||||
anims/anim = SubResource( 10 )
|
||||
|
||||
[node name="Music" type="Node" parent="."]
|
||||
|
||||
[node name="Music" type="AudioStreamPlayer2D" parent="Music"]
|
||||
stream = ExtResource( 8 )
|
||||
volume_db = -53.3333
|
||||
|
||||
[node name="Animation" type="AnimationPlayer" parent="Music/Music"]
|
||||
anims/anim = SubResource( 11 )
|
||||
|
||||
[node name="SFX" parent="." instance=ExtResource( 10 )]
|
||||
|
||||
[node name="NG" parent="." instance=ExtResource( 4 )]
|
||||
[connection signal="pressed" from="TouchScreenButton" to="." method="_on_TouchScreenButton_pressed"]
|
||||
[connection signal="pressed" from="exit" to="." method="_on_exit_pressed"]
|
||||
[connection signal="pressed" from="info" to="." method="_on_info_pressed"]
|
||||
[connection signal="pressed" from="scoreandother" to="." method="_on_info2_pressed"]
|
||||
[connection signal="animation_finished" from="canvas/black/Animation" to="." method="_on_Animation_animation_finished"]
|
||||
[connection signal="animation_finished" from="canvas/black/Animation3" to="." method="_on_Animation3_animation_finished"]
|
||||
[connection signal="animation_finished" from="canvas/black/Animation2" to="." method="_on_Animation2_animation_finished"]
|
||||
[connection signal="finished" from="Music/Music" to="." method="_on_Music_finished"]
|
|
@ -0,0 +1,126 @@
|
|||
[gd_scene load_steps=15 format=2]
|
||||
|
||||
[ext_resource path="res://Escenas/Guardar/NG.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://Textures/bg.png" type="Texture" id=2]
|
||||
[ext_resource path="res://Escenas/SFX/SFX.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://Font/pixeled/Pixeled.ttf" type="DynamicFontData" id=4]
|
||||
[ext_resource path="res://Scripts/Menus/MenuScore.gd" type="Script" id=5]
|
||||
[ext_resource path="res://Textures/restart.png" type="Texture" id=6]
|
||||
[ext_resource path="res://Music/Music3.ogg" type="AudioStream" id=7]
|
||||
[ext_resource path="res://Textures/Black.png" type="Texture" id=8]
|
||||
[ext_resource path="res://Textures/trash.png" type="Texture" id=9]
|
||||
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
font_data = ExtResource( 4 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=2]
|
||||
|
||||
[sub_resource type="DynamicFont" id=3]
|
||||
size = 6
|
||||
font_data = ExtResource( 4 )
|
||||
|
||||
[sub_resource type="Animation" id=4]
|
||||
length = 0.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.5 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=5]
|
||||
length = 0.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.5 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
|
||||
}
|
||||
|
||||
[node name="MenuScore" type="Node2D"]
|
||||
script = ExtResource( 5 )
|
||||
|
||||
[node name="fondo" type="Sprite" parent="."]
|
||||
position = Vector2( 1496, -328 )
|
||||
scale = Vector2( 6, 6 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="NG" parent="." instance=ExtResource( 1 )]
|
||||
|
||||
[node name="SFX" parent="." instance=ExtResource( 3 )]
|
||||
|
||||
[node name="music" type="AudioStreamPlayer2D" parent="."]
|
||||
position = Vector2( 240, 136 )
|
||||
stream = ExtResource( 7 )
|
||||
|
||||
[node name="info" type="Node2D" parent="."]
|
||||
|
||||
[node name="Label" type="Label" parent="info"]
|
||||
margin_right = 512.0
|
||||
margin_bottom = 128.0
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
text = "Total Score"
|
||||
align = 1
|
||||
valign = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="score" type="Label" parent="info"]
|
||||
margin_top = 56.0
|
||||
margin_right = 512.0
|
||||
margin_bottom = 128.0
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
text = "0"
|
||||
align = 1
|
||||
valign = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="exit" type="TouchScreenButton" parent="."]
|
||||
scale = Vector2( 2, 2 )
|
||||
normal = ExtResource( 6 )
|
||||
shape = SubResource( 2 )
|
||||
|
||||
[node name="removescore" type="TouchScreenButton" parent="."]
|
||||
position = Vector2( 432, 240 )
|
||||
normal = ExtResource( 9 )
|
||||
shape = SubResource( 2 )
|
||||
|
||||
[node name="Label2" type="Label" parent="."]
|
||||
margin_left = 363.0
|
||||
margin_top = 200.0
|
||||
margin_right = 523.0
|
||||
margin_bottom = 260.0
|
||||
custom_fonts/font = SubResource( 3 )
|
||||
text = "Delete your Score"
|
||||
align = 1
|
||||
valign = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="black" type="Sprite" parent="."]
|
||||
position = Vector2( 304, 200 )
|
||||
scale = Vector2( 10.5, 7.25 )
|
||||
texture = ExtResource( 8 )
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="black"]
|
||||
anims/end = SubResource( 4 )
|
||||
anims/start = SubResource( 5 )
|
||||
[connection signal="pressed" from="exit" to="." method="_on_exit_pressed"]
|
||||
[connection signal="pressed" from="removescore" to="." method="_on_removescore_pressed"]
|
||||
[connection signal="animation_finished" from="black/AnimationPlayer" to="." method="_on_AnimationPlayer_animation_finished"]
|
|
@ -0,0 +1,29 @@
|
|||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://SFX/fx7.wav" type="AudioStream" id=1]
|
||||
[ext_resource path="res://SFX/fx2.wav" type="AudioStream" id=2]
|
||||
[ext_resource path="res://SFX/fx1.wav" type="AudioStream" id=3]
|
||||
[ext_resource path="res://SFX/fx3.wav" type="AudioStream" id=4]
|
||||
[ext_resource path="res://SFX/fx5.wav" type="AudioStream" id=5]
|
||||
|
||||
[node name="SFX" type="Node2D"]
|
||||
|
||||
[node name="play" type="AudioStreamPlayer2D" parent="."]
|
||||
stream = ExtResource( 1 )
|
||||
volume_db = -10.0
|
||||
|
||||
[node name="touch" type="AudioStreamPlayer2D" parent="."]
|
||||
stream = ExtResource( 2 )
|
||||
volume_db = -5.0
|
||||
|
||||
[node name="button" type="AudioStreamPlayer2D" parent="."]
|
||||
stream = ExtResource( 3 )
|
||||
volume_db = -15.0
|
||||
|
||||
[node name="movewater" type="AudioStreamPlayer2D" parent="."]
|
||||
stream = ExtResource( 4 )
|
||||
volume_db = -20.0
|
||||
|
||||
[node name="toc" type="AudioStreamPlayer2D" parent="."]
|
||||
stream = ExtResource( 5 )
|
||||
volume_db = -20.0
|
|
@ -0,0 +1,91 @@
|
|||
[gd_scene load_steps=8 format=2]
|
||||
|
||||
[ext_resource path="res://Textures/aro.png" type="Texture" id=1]
|
||||
[ext_resource path="res://Scripts/Aro/aro.gd" type="Script" id=2]
|
||||
[ext_resource path="res://Escenas/SFX/SFX.tscn" type="PackedScene" id=3]
|
||||
|
||||
[sub_resource type="SpriteFrames" id=1]
|
||||
animations = [ {
|
||||
"frames": [ ExtResource( 1 ) ],
|
||||
"loop": true,
|
||||
"name": "default",
|
||||
"speed": 5.0
|
||||
} ]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=2]
|
||||
extents = Vector2( 13.3792, 10.43 )
|
||||
|
||||
[sub_resource type="Animation" id=3]
|
||||
resource_name = "kill"
|
||||
length = 0.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("AnimatedSprite:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.5 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=4]
|
||||
extents = Vector2( 5.17464, 3.96033 )
|
||||
|
||||
[node name="Aro" type="RigidBody2D"]
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||
frames = SubResource( 1 )
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
|
||||
position = Vector2( 0, -0.0468225 )
|
||||
polygon = PoolVector2Array( 6.38676, 2.17306, 7.00277, 2.11212, 7.9375, 0.9375, 8.0625, -6.0625, 6.75, -6, 6.8756, -6.9144, 6.38676, -6.91172, 6.44576, -3.78514, 7.125, -3.9375, 7.0625, -1.625, 6.38676, -1.89739 )
|
||||
|
||||
[node name="CollisionPolygon2D2" type="CollisionPolygon2D" parent="."]
|
||||
position = Vector2( 0, -0.0468225 )
|
||||
polygon = PoolVector2Array( -6.41453, 2.05508, -7.02969, 2.05957, -8, 1.0625, -8, -5.9375, -7, -6, -7, -6.9375, -6.35554, -6.67576, -6.35554, -4.02111, -6.9375, -4, -7, -2.125, -6.23755, -2.01538 )
|
||||
|
||||
[node name="VisibilityNotifier2D" type="VisibilityNotifier2D" parent="."]
|
||||
position = Vector2( -0.157669, -2.57524 )
|
||||
scale = Vector2( 0.805543, 0.500718 )
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
modulate = Color( 0, 0, 0, 1 )
|
||||
position = Vector2( -0.210224, -2.73291 )
|
||||
shape = SubResource( 2 )
|
||||
|
||||
[node name="timeqf" type="Timer" parent="."]
|
||||
wait_time = 2.0
|
||||
|
||||
[node name="timetoup" type="Timer" parent="."]
|
||||
wait_time = 0.2
|
||||
|
||||
[node name="timetokill" type="Timer" parent="."]
|
||||
wait_time = 15.0
|
||||
|
||||
[node name="killanim" type="AnimationPlayer" parent="."]
|
||||
anims/kill = SubResource( 3 )
|
||||
|
||||
[node name="areap" type="Area2D" parent="."]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="areap"]
|
||||
position = Vector2( -0.0589924, -2.47767 )
|
||||
shape = SubResource( 4 )
|
||||
|
||||
[node name="SFX" parent="." instance=ExtResource( 3 )]
|
||||
[connection signal="screen_exited" from="VisibilityNotifier2D" to="." method="_on_VisibilityNotifier2D_screen_exited"]
|
||||
[connection signal="area_exited" from="Area2D" to="." method="_on_Area2D_area_exited"]
|
||||
[connection signal="area_shape_entered" from="Area2D" to="." method="_on_Area2D_area_shape_entered"]
|
||||
[connection signal="body_exited" from="Area2D" to="." method="_on_Area2D_body_exited"]
|
||||
[connection signal="body_shape_entered" from="Area2D" to="." method="_on_Area2D_body_shape_entered"]
|
||||
[connection signal="timeout" from="timeqf" to="." method="_on_timeqf_timeout"]
|
||||
[connection signal="timeout" from="timetoup" to="." method="_on_timetoup_timeout"]
|
||||
[connection signal="timeout" from="timetokill" to="." method="_on_timetokill_timeout"]
|
||||
[connection signal="animation_finished" from="killanim" to="." method="_on_killanim_animation_finished"]
|
||||
[connection signal="body_entered" from="areap" to="." method="_on_areap_body_entered"]
|
||||
[connection signal="body_exited" from="areap" to="." method="_on_areap_body_exited"]
|
|
@ -0,0 +1,212 @@
|
|||
[gd_scene load_steps=15 format=2]
|
||||
|
||||
[ext_resource path="res://Textures/bg.png" type="Texture" id=1]
|
||||
[ext_resource path="res://Scripts/info/info.gd" type="Script" id=2]
|
||||
[ext_resource path="res://Music/Music3.ogg" type="AudioStream" id=3]
|
||||
[ext_resource path="res://Textures/restart.png" type="Texture" id=4]
|
||||
[ext_resource path="res://Font/pixeled/Pixeled.ttf" type="DynamicFontData" id=5]
|
||||
[ext_resource path="res://Textures/Black.png" type="Texture" id=6]
|
||||
[ext_resource path="res://Escenas/SFX/SFX.tscn" type="PackedScene" id=7]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
|
||||
[sub_resource type="DynamicFont" id=2]
|
||||
font_data = ExtResource( 5 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=3]
|
||||
size = 10
|
||||
font_data = ExtResource( 5 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=4]
|
||||
size = 11
|
||||
font_data = ExtResource( 5 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=5]
|
||||
size = 8
|
||||
font_data = ExtResource( 5 )
|
||||
|
||||
[sub_resource type="Animation" id=6]
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.2, 0.5 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=7]
|
||||
length = 0.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.4 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ) ]
|
||||
}
|
||||
|
||||
[node name="info" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="fondo" type="Sprite" parent="."]
|
||||
position = Vector2( 1488, -248 )
|
||||
scale = Vector2( 6.58333, 6.58333 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="music" type="AudioStreamPlayer2D" parent="."]
|
||||
stream = ExtResource( 3 )
|
||||
|
||||
[node name="back" type="TouchScreenButton" parent="."]
|
||||
scale = Vector2( 2, 2 )
|
||||
normal = ExtResource( 4 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="Credits" type="Node" parent="."]
|
||||
|
||||
[node name="Label" type="Label" parent="Credits"]
|
||||
margin_top = 56.0
|
||||
margin_right = 40.0
|
||||
margin_bottom = 102.0
|
||||
custom_fonts/font = SubResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="SpecialThanksto" type="Label" parent="Credits"]
|
||||
margin_left = 256.0
|
||||
margin_top = 66.0
|
||||
margin_right = 512.0
|
||||
margin_bottom = 112.0
|
||||
custom_fonts/font = SubResource( 2 )
|
||||
text = "Special Thanks to"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Araceli" type="Label" parent="Credits/SpecialThanksto"]
|
||||
margin_top = 46.0
|
||||
margin_right = 256.0
|
||||
margin_bottom = 158.0
|
||||
custom_fonts/font = SubResource( 3 )
|
||||
text = "Araceli (Correction and Ideas)"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Eduardo" type="Label" parent="Credits/SpecialThanksto"]
|
||||
margin_top = 70.0
|
||||
margin_right = 256.0
|
||||
margin_bottom = 158.0
|
||||
custom_fonts/font = SubResource( 3 )
|
||||
text = "Eduardo (Main Idea)"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="BetaTesters" type="Label" parent="Credits"]
|
||||
margin_left = 256.0
|
||||
margin_top = 160.0
|
||||
margin_right = 512.0
|
||||
margin_bottom = 227.0
|
||||
rect_scale = Vector2( 0.8, 0.8 )
|
||||
custom_fonts/font = SubResource( 2 )
|
||||
text = "Beta Testers"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="allbt" type="Label" parent="Credits/BetaTesters"]
|
||||
margin_top = 40.0
|
||||
margin_right = 256.0
|
||||
margin_bottom = 112.0
|
||||
custom_fonts/font = SubResource( 3 )
|
||||
text = "Tomas - Araceli - Can202"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Me" type="Label" parent="Credits"]
|
||||
margin_left = 16.0
|
||||
margin_top = 72.0
|
||||
margin_right = 221.0
|
||||
margin_bottom = 168.0
|
||||
custom_fonts/font = SubResource( 4 )
|
||||
text = "Programming,
|
||||
pixel art, music,
|
||||
fx and Design"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="me" type="Label" parent="Credits/Me"]
|
||||
margin_top = 97.0
|
||||
margin_right = 256.0
|
||||
margin_bottom = 240.0
|
||||
custom_fonts/font = SubResource( 3 )
|
||||
text = "Can202 (me)"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Credits" type="Label" parent="Credits"]
|
||||
margin_left = 192.0
|
||||
margin_right = 320.0
|
||||
margin_bottom = 64.0
|
||||
custom_fonts/font = SubResource( 2 )
|
||||
text = "Credits"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="programs" type="Label" parent="Credits"]
|
||||
margin_left = 16.0
|
||||
margin_top = 204.0
|
||||
margin_right = 272.0
|
||||
margin_bottom = 312.0
|
||||
custom_fonts/font = SubResource( 5 )
|
||||
text = "Pixel Art Editor: Pixelorama
|
||||
Music and Fx: Lmms - Audacity
|
||||
Design: Krita"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="programs2" type="Label" parent="Credits"]
|
||||
margin_left = 256.0
|
||||
margin_top = 223.0
|
||||
margin_right = 492.0
|
||||
margin_bottom = 312.0
|
||||
custom_fonts/font = SubResource( 5 )
|
||||
text = "Font: pixeled
|
||||
Engine: Godot Engine"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="CL" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="black" type="Sprite" parent="CL"]
|
||||
visible = false
|
||||
position = Vector2( 264.298, 146.165 )
|
||||
scale = Vector2( 9.25932, 5.56766 )
|
||||
texture = ExtResource( 6 )
|
||||
|
||||
[node name="start" type="AnimationPlayer" parent="CL/black"]
|
||||
anims/anim = SubResource( 6 )
|
||||
|
||||
[node name="end" type="AnimationPlayer" parent="CL/black"]
|
||||
anims/anim = SubResource( 7 )
|
||||
|
||||
[node name="SFX" parent="." instance=ExtResource( 7 )]
|
||||
[connection signal="finished" from="music" to="." method="_on_music_finished"]
|
||||
[connection signal="pressed" from="back" to="." method="_on_back_pressed"]
|
||||
[connection signal="animation_finished" from="CL/black/end" to="." method="_on_end_animation_finished"]
|
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 860 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/icon.png-c1606e7bd9af7e3161f7d63f5e647d5d.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/PersistenceNode/icon.png"
|
||||
dest_files=[ "res://.import/icon.png-c1606e7bd9af7e3161f7d63f5e647d5d.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
|
@ -0,0 +1,432 @@
|
|||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2018-2020 Matías Muñoz Espinoza
|
||||
# Copyright (c) 2019 Ren Project
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
extends Node
|
||||
|
||||
class_name Persistence, "icon.png"
|
||||
|
||||
enum Mode {ENCRYPTED, TEXT}
|
||||
export (Mode) var mode : int = Mode.ENCRYPTED setget set_mode, get_mode
|
||||
export (String) var password := "" setget set_password, get_password
|
||||
export (String) var folder_name := "PersistenceNode" setget set_folder_name, get_folder_name
|
||||
export (Array) var no_valid_names := ["default", "example"] setget _private_set, get_no_valid_names
|
||||
export (bool) var debug_on := false setget set_debug, get_debug
|
||||
|
||||
var beautifier setget _private_set, _private_get
|
||||
export (bool) var beautifier_active := true setget set_beautifier_active, get_beautifier_active
|
||||
|
||||
export (int) var profile_name_min_size := 3 setget set_profile_name_min_size, get_profile_name_min_size
|
||||
export (int) var profile_name_max_size := 15 setget set_profile_name_max_size, get_profile_name_max_size
|
||||
|
||||
# Data del profile actual, esta data se puede modificar y luego usar
|
||||
# save_data()
|
||||
var data := {} setget _private_set
|
||||
|
||||
signal saved
|
||||
signal loaded
|
||||
|
||||
func _init() -> void:
|
||||
if beautifier_active:
|
||||
beautifier = JSONBeautifier.new()
|
||||
|
||||
func _ready() -> void:
|
||||
connect("saved", self, "_on_saved")
|
||||
connect("loaded", self, "_on_loaded")
|
||||
|
||||
func _on_saved() -> void:
|
||||
# Muestra los datos en la salida una vez que se graba el archivo.
|
||||
if beautifier_active and mode == Mode.TEXT:
|
||||
debug("_on_saved()")
|
||||
print_json(to_json(data))
|
||||
|
||||
func _on_loaded() -> void:
|
||||
# Muestra los datos en la salida una vez que se graba el archivo.
|
||||
if beautifier_active and mode == Mode.TEXT:
|
||||
debug("_on_loaded()")
|
||||
print_json(to_json(data))
|
||||
|
||||
func _private_set(val = null) -> void:
|
||||
debug("Set access is private")
|
||||
|
||||
func _private_get() -> void:
|
||||
debug("Get access is private")
|
||||
|
||||
# Métodos públicos
|
||||
#
|
||||
|
||||
func debug(message, something1 = "", something2 = "") -> void:
|
||||
if debug_on:
|
||||
print("[PersistenceNode] ", message, " ", something1, " ", something2)
|
||||
|
||||
# Salva el juego con el profile indicado en el parámetro profile_name.
|
||||
# Si no hay profile crea un profile por defecto llamado default.
|
||||
func save_data(profile_name : String = "") -> bool:
|
||||
var result
|
||||
|
||||
# Crea la carpeta principal si esta no existe
|
||||
create_main_folder()
|
||||
|
||||
# Crea el profile por defecto, en el caso de que no se quiera
|
||||
# utilizar profiles.
|
||||
if profile_name == "":
|
||||
if save_profile_default():
|
||||
emit_signal("saved")
|
||||
debug("save_profile_default() retorna true")
|
||||
return true
|
||||
else:
|
||||
debug("save_profile_default() retorna falso")
|
||||
return false
|
||||
|
||||
if validate_profile(profile_name):
|
||||
match mode:
|
||||
Mode.ENCRYPTED:
|
||||
result = save_profile_encripted(profile_name)
|
||||
Mode.TEXT:
|
||||
result = save_profile_text(profile_name)
|
||||
else:
|
||||
debug("No ha pasado la validación")
|
||||
result = false
|
||||
|
||||
if result:
|
||||
emit_signal("saved")
|
||||
|
||||
return result
|
||||
|
||||
# Remueve el profile indicado como argumento. Tome en cuenta que para
|
||||
# eliminar el encriptado o el texto, debe establecer primero el modo
|
||||
# con set_mode().
|
||||
func remove_profile(profile_name : String) -> bool:
|
||||
var dir = Directory.new()
|
||||
var path
|
||||
|
||||
match mode:
|
||||
Mode.ENCRYPTED:
|
||||
path = str("user://", folder_name, "/", profile_name, ".save")
|
||||
Mode.TEXT:
|
||||
path = str("user://", folder_name, "/", profile_name, ".txt")
|
||||
|
||||
var err = dir.remove(path)
|
||||
|
||||
if err != OK:
|
||||
debug("Error al remover el profile: ", err)
|
||||
return false
|
||||
else:
|
||||
data = {}
|
||||
|
||||
return true
|
||||
|
||||
# Remueve toda la data dentro de la carpeta "folder_name" sin importar
|
||||
# si esta encriptada o no. Devuelve true si la remueve y false si no
|
||||
# existe data o hay un error.
|
||||
func remove_all_data() -> bool:
|
||||
var dir = Directory.new()
|
||||
var profiles = get_profiles(true)
|
||||
|
||||
if profiles != null:
|
||||
var path = "user://" + folder_name + "/"
|
||||
var err
|
||||
|
||||
for i in range(profiles.size()):
|
||||
err = dir.remove(str(path + profiles[i]))
|
||||
|
||||
if err != OK:
|
||||
debug("Un error al elimnar el archivo: ", err)
|
||||
return false
|
||||
|
||||
data = {}
|
||||
|
||||
return true
|
||||
else:
|
||||
debug("No se a removido ningún archivo.")
|
||||
return false
|
||||
|
||||
# Setters/Getters
|
||||
#
|
||||
|
||||
# Mode.TEXT : Guarda la data en texto en formato json
|
||||
# Mode.ENCRYPTED : Guarda la data de forma encriptada
|
||||
func set_mode(_mode) -> void:
|
||||
mode = _mode
|
||||
|
||||
func get_mode() -> int:
|
||||
return mode
|
||||
|
||||
# Se obtiene la data, esta data puede ser modificada para luego ser guardada
|
||||
# con save_data(). Si esta usando profiles, no olvide indicarle el profile.
|
||||
func get_data(profile_name : String = "") -> Dictionary:
|
||||
data = {}
|
||||
load_data(profile_name)
|
||||
return data
|
||||
|
||||
# Retorna los perfiles existentes, por defecto los devuelve sin
|
||||
# extension.
|
||||
func get_profiles(with_extension : bool = false) -> Array:
|
||||
var dir = Directory.new()
|
||||
var profiles = []
|
||||
|
||||
if dir.open("user://" + folder_name) == OK:
|
||||
dir.list_dir_begin()
|
||||
var file_name = dir.get_next()
|
||||
|
||||
while (file_name != ""):
|
||||
if file_name != "." and file_name != "..":
|
||||
if not with_extension:
|
||||
profiles.append(file_name.get_basename())
|
||||
else:
|
||||
profiles.append(file_name)
|
||||
|
||||
file_name = dir.get_next()
|
||||
else:
|
||||
debug("Un error ha ocurrido al intentar entrar al path.")
|
||||
|
||||
return profiles
|
||||
|
||||
# Retorna los nombres no validos
|
||||
func get_no_valid_names() -> Array:
|
||||
return no_valid_names
|
||||
|
||||
func set_password(_password : String) -> void:
|
||||
password = _password
|
||||
|
||||
func get_password() -> String:
|
||||
return password
|
||||
|
||||
func set_folder_name(_folder_name : String) -> void:
|
||||
folder_name = _folder_name
|
||||
|
||||
func get_folder_name() -> String:
|
||||
return folder_name
|
||||
|
||||
func set_debug(_debug : bool) -> void:
|
||||
debug_on = _debug
|
||||
|
||||
func get_debug() -> bool:
|
||||
return debug_on
|
||||
|
||||
func set_beautifier_active(_beautifier_active : bool) -> void:
|
||||
beautifier_active = _beautifier_active
|
||||
|
||||
func get_beautifier_active() -> bool:
|
||||
return beautifier_active
|
||||
|
||||
func set_profile_name_min_size(_profile_name_min_size : int) -> void:
|
||||
profile_name_min_size = _profile_name_min_size
|
||||
|
||||
func get_profile_name_min_size() -> int:
|
||||
return profile_name_min_size
|
||||
|
||||
func set_profile_name_max_size(_profile_name_max_size : int) -> void:
|
||||
profile_name_max_size = _profile_name_max_size
|
||||
|
||||
func get_profile_name_max_size() -> int:
|
||||
return profile_name_max_size
|
||||
|
||||
# Métodos "privados" (No usar)
|
||||
#
|
||||
|
||||
# Valida:
|
||||
# 1) No puede tener nombres no validos según no_valid_names[]
|
||||
# 2) El nombre no puede ser "default"
|
||||
# 3) El nombre debe estar dentro del rango del tamaño de nombre mínimo o
|
||||
# máximo.
|
||||
func validate_profile(profile_name : String) -> bool:
|
||||
var profiles = get_profiles()
|
||||
|
||||
# 1)
|
||||
if no_valid_names != null and no_valid_names.has(profile_name):
|
||||
debug("Nombre invalido: ", profile_name)
|
||||
return false
|
||||
|
||||
# 2)
|
||||
if profile_name == "default":
|
||||
debug("No se puede usar el nombre default")
|
||||
return false
|
||||
|
||||
# 3)
|
||||
if profile_name.length() < profile_name_min_size or profile_name.length() > profile_name_max_size:
|
||||
debug("El profile_name no esta dentro del rango")
|
||||
return false
|
||||
|
||||
return true
|
||||
|
||||
func save_profile_default() -> bool:
|
||||
match mode:
|
||||
Mode.ENCRYPTED:
|
||||
return save_profile_encripted("default")
|
||||
Mode.TEXT:
|
||||
return save_profile_text("default")
|
||||
|
||||
return false
|
||||
|
||||
func load_profile_default() -> bool:
|
||||
match mode:
|
||||
Mode.ENCRYPTED:
|
||||
return load_profile_encripted("default")
|
||||
Mode.TEXT:
|
||||
return load_profile_text("default")
|
||||
|
||||
return false
|
||||
|
||||
func save_profile_encripted(profile_name : String) -> bool:
|
||||
var file_path
|
||||
file_path = str("user://" + folder_name + "/" + profile_name + ".save")
|
||||
|
||||
erase_profile_encripted(profile_name, file_path)
|
||||
|
||||
var file = File.new()
|
||||
var err = file.open_encrypted_with_pass(file_path, File.WRITE, password)
|
||||
|
||||
if err == OK:
|
||||
file.store_var(data)
|
||||
file.close()
|
||||
|
||||
return true
|
||||
else:
|
||||
debug("Error al crear/guardar el archivo: ", err)
|
||||
debug("Path: ", file_path)
|
||||
return false
|
||||
|
||||
func save_profile_text(profile_name : String) -> bool:
|
||||
var file_path
|
||||
file_path = str("user://" + folder_name + "/" + profile_name + ".txt")
|
||||
|
||||
var file = File.new()
|
||||
var err = file.open(file_path, File.WRITE_READ)
|
||||
|
||||
if err == OK:
|
||||
file.get_line() # Borrar la data anterior
|
||||
file.store_string(beautifier.beautify_json(to_json(data)))
|
||||
file.close()
|
||||
|
||||
return true
|
||||
else:
|
||||
debug("Error al crear/leer el archivo: ", err)
|
||||
return false
|
||||
|
||||
func load_profile_encripted(profile_name : String) -> bool:
|
||||
var file_path
|
||||
file_path = str("user://" + folder_name + "/" + profile_name + ".save")
|
||||
|
||||
var file = File.new()
|
||||
|
||||
if not file.file_exists(file_path):
|
||||
debug("El archivo no existe: " + file_path)
|
||||
return false
|
||||
|
||||
var err = file.open_encrypted_with_pass(file_path, File.READ, password)
|
||||
|
||||
if err == OK:
|
||||
data = file.get_var()
|
||||
file.close()
|
||||
# Se guarda la data después de cargarla ya que, al cargar la data
|
||||
# se borran los datos en disco.
|
||||
save_profile_encripted(profile_name)
|
||||
|
||||
debug("Se a cargado el archivo con éxito: ")
|
||||
return true
|
||||
else:
|
||||
debug("Error al leer el archivo: ", err)
|
||||
return false
|
||||
|
||||
func load_profile_text(profile_name : String) -> bool:
|
||||
var file_path = str("user://" + folder_name + "/" + profile_name + ".txt")
|
||||
var file = File.new()
|
||||
|
||||
if not file.file_exists(file_path):
|
||||
debug("El archivo no existe: " + file_path)
|
||||
return false
|
||||
|
||||
var err = file.open(file_path, File.READ)
|
||||
|
||||
if err == OK:
|
||||
var data_str := ""
|
||||
|
||||
# Mientras no alcance el final de linea
|
||||
while not file.eof_reached():
|
||||
# Se va concatenando el texto del json
|
||||
data_str = data_str + file.get_line()
|
||||
data = parse_json(data_str)
|
||||
|
||||
file.close()
|
||||
# Se guarda la data después de cargarla ya que, al cargar la data
|
||||
# se borran los datos en disco.
|
||||
save_profile_text(profile_name)
|
||||
|
||||
return true
|
||||
else:
|
||||
debug("Error al leer el archivo: ", err)
|
||||
return false
|
||||
|
||||
func erase_profile_encripted(profile_name : String, file_path : String) -> void:
|
||||
var file = File.new()
|
||||
var err = file.open_encrypted_with_pass(file_path, File.READ, password)
|
||||
|
||||
if err == OK:
|
||||
file.get_var()
|
||||
file.close()
|
||||
else:
|
||||
debug("No se a podido limpiar el profile: ", err)
|
||||
|
||||
# Crea la carpeta principal, sólo la crea si esta no existe
|
||||
func create_main_folder() -> void:
|
||||
var dir = Directory.new()
|
||||
|
||||
if not dir.dir_exists(str("user://" + folder_name)):
|
||||
dir.make_dir(str("user://" + folder_name))
|
||||
debug("Se a creado la carpeta ", folder_name)
|
||||
|
||||
# Carga la data, si no se le pasa ningún argumento entonces carga la data
|
||||
# por defecto, si se le pasa argumento entonces carga la data indicada en el.
|
||||
# Devuelve true si se carga exitosamente y false si no lo hace.
|
||||
func load_data(profile_name : String = "") -> bool:
|
||||
var result
|
||||
|
||||
if profile_name == "":
|
||||
if load_profile_default():
|
||||
emit_signal("loaded")
|
||||
return true
|
||||
else:
|
||||
debug("load_profile_default retorna false.")
|
||||
return false
|
||||
|
||||
if validate_profile(profile_name):
|
||||
match mode:
|
||||
Mode.ENCRYPTED:
|
||||
result = load_profile_encripted(profile_name)
|
||||
Mode.TEXT:
|
||||
result = load_profile_text(profile_name)
|
||||
else:
|
||||
debug("No ha pasado la validación")
|
||||
result = false
|
||||
|
||||
if result:
|
||||
emit_signal("loaded")
|
||||
|
||||
return result
|
||||
|
||||
func print_json(json : String) -> void:
|
||||
if beautifier != null:
|
||||
print("______________- JSON -______________")
|
||||
print(beautifier.beautify_json(json))
|
||||
print("____________________________________")
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
[plugin]
|
||||
|
||||
name="PersistenceNode"
|
||||
description="Easy saving. More info: https://github.com/MatiasVME/Persistence"
|
||||
author="Matías Muñoz Espinoza, Jeremi Biernacki"
|
||||
version="1.5.0"
|
||||
script="plugin.gd"
|
|
@ -0,0 +1,10 @@
|
|||
tool
|
||||
extends EditorPlugin
|
||||
|
||||
|
||||
func _enter_tree():
|
||||
pass
|
||||
|
||||
|
||||
func _exit_tree():
|
||||
pass
|
|
@ -0,0 +1,373 @@
|
|||
Mozilla Public License Version 2.0
|
||||
==================================
|
||||
|
||||
1. Definitions
|
||||
--------------
|
||||
|
||||
1.1. "Contributor"
|
||||
means each individual or legal entity that creates, contributes to
|
||||
the creation of, or owns Covered Software.
|
||||
|
||||
1.2. "Contributor Version"
|
||||
means the combination of the Contributions of others (if any) used
|
||||
by a Contributor and that particular Contributor's Contribution.
|
||||
|
||||
1.3. "Contribution"
|
||||
means Covered Software of a particular Contributor.
|
||||
|
||||
1.4. "Covered Software"
|
||||
means Source Code Form to which the initial Contributor has attached
|
||||
the notice in Exhibit A, the Executable Form of such Source Code
|
||||
Form, and Modifications of such Source Code Form, in each case
|
||||
including portions thereof.
|
||||
|
||||
1.5. "Incompatible With Secondary Licenses"
|
||||
means
|
||||
|
||||
(a) that the initial Contributor has attached the notice described
|
||||
in Exhibit B to the Covered Software; or
|
||||
|
||||
(b) that the Covered Software was made available under the terms of
|
||||
version 1.1 or earlier of the License, but not also under the
|
||||
terms of a Secondary License.
|
||||
|
||||
1.6. "Executable Form"
|
||||
means any form of the work other than Source Code Form.
|
||||
|
||||
1.7. "Larger Work"
|
||||
means a work that combines Covered Software with other material, in
|
||||
a separate file or files, that is not Covered Software.
|
||||
|
||||
1.8. "License"
|
||||
means this document.
|
||||
|
||||
1.9. "Licensable"
|
||||
means having the right to grant, to the maximum extent possible,
|
||||
whether at the time of the initial grant or subsequently, any and
|
||||
all of the rights conveyed by this License.
|
||||
|
||||
1.10. "Modifications"
|
||||
means any of the following:
|
||||
|
||||
(a) any file in Source Code Form that results from an addition to,
|
||||
deletion from, or modification of the contents of Covered
|
||||
Software; or
|
||||
|
||||
(b) any new file in Source Code Form that contains any Covered
|
||||
Software.
|
||||
|
||||
1.11. "Patent Claims" of a Contributor
|
||||
means any patent claim(s), including without limitation, method,
|
||||
process, and apparatus claims, in any patent Licensable by such
|
||||
Contributor that would be infringed, but for the grant of the
|
||||
License, by the making, using, selling, offering for sale, having
|
||||
made, import, or transfer of either its Contributions or its
|
||||
Contributor Version.
|
||||
|
||||
1.12. "Secondary License"
|
||||
means either the GNU General Public License, Version 2.0, the GNU
|
||||
Lesser General Public License, Version 2.1, the GNU Affero General
|
||||
Public License, Version 3.0, or any later versions of those
|
||||
licenses.
|
||||
|
||||
1.13. "Source Code Form"
|
||||
means the form of the work preferred for making modifications.
|
||||
|
||||
1.14. "You" (or "Your")
|
||||
means an individual or a legal entity exercising rights under this
|
||||
License. For legal entities, "You" includes any entity that
|
||||
controls, is controlled by, or is under common control with You. For
|
||||
purposes of this definition, "control" means (a) the power, direct
|
||||
or indirect, to cause the direction or management of such entity,
|
||||
whether by contract or otherwise, or (b) ownership of more than
|
||||
fifty percent (50%) of the outstanding shares or beneficial
|
||||
ownership of such entity.
|
||||
|
||||
2. License Grants and Conditions
|
||||
--------------------------------
|
||||
|
||||
2.1. Grants
|
||||
|
||||
Each Contributor hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license:
|
||||
|
||||
(a) under intellectual property rights (other than patent or trademark)
|
||||
Licensable by such Contributor to use, reproduce, make available,
|
||||
modify, display, perform, distribute, and otherwise exploit its
|
||||
Contributions, either on an unmodified basis, with Modifications, or
|
||||
as part of a Larger Work; and
|
||||
|
||||
(b) under Patent Claims of such Contributor to make, use, sell, offer
|
||||
for sale, have made, import, and otherwise transfer either its
|
||||
Contributions or its Contributor Version.
|
||||
|
||||
2.2. Effective Date
|
||||
|
||||
The licenses granted in Section 2.1 with respect to any Contribution
|
||||
become effective for each Contribution on the date the Contributor first
|
||||
distributes such Contribution.
|
||||
|
||||
2.3. Limitations on Grant Scope
|
||||
|
||||
The licenses granted in this Section 2 are the only rights granted under
|
||||
this License. No additional rights or licenses will be implied from the
|
||||
distribution or licensing of Covered Software under this License.
|
||||
Notwithstanding Section 2.1(b) above, no patent license is granted by a
|
||||
Contributor:
|
||||
|
||||
(a) for any code that a Contributor has removed from Covered Software;
|
||||
or
|
||||
|
||||
(b) for infringements caused by: (i) Your and any other third party's
|
||||
modifications of Covered Software, or (ii) the combination of its
|
||||
Contributions with other software (except as part of its Contributor
|
||||
Version); or
|
||||
|
||||
(c) under Patent Claims infringed by Covered Software in the absence of
|
||||
its Contributions.
|
||||
|
||||
This License does not grant any rights in the trademarks, service marks,
|
||||
or logos of any Contributor (except as may be necessary to comply with
|
||||
the notice requirements in Section 3.4).
|
||||
|
||||
2.4. Subsequent Licenses
|
||||
|
||||
No Contributor makes additional grants as a result of Your choice to
|
||||
distribute the Covered Software under a subsequent version of this
|
||||
License (see Section 10.2) or under the terms of a Secondary License (if
|
||||
permitted under the terms of Section 3.3).
|
||||
|
||||
2.5. Representation
|
||||
|
||||
Each Contributor represents that the Contributor believes its
|
||||
Contributions are its original creation(s) or it has sufficient rights
|
||||
to grant the rights to its Contributions conveyed by this License.
|
||||
|
||||
2.6. Fair Use
|
||||
|
||||
This License is not intended to limit any rights You have under
|
||||
applicable copyright doctrines of fair use, fair dealing, or other
|
||||
equivalents.
|
||||
|
||||
2.7. Conditions
|
||||
|
||||
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
|
||||
in Section 2.1.
|
||||
|
||||
3. Responsibilities
|
||||
-------------------
|
||||
|
||||
3.1. Distribution of Source Form
|
||||
|
||||
All distribution of Covered Software in Source Code Form, including any
|
||||
Modifications that You create or to which You contribute, must be under
|
||||
the terms of this License. You must inform recipients that the Source
|
||||
Code Form of the Covered Software is governed by the terms of this
|
||||
License, and how they can obtain a copy of this License. You may not
|
||||
attempt to alter or restrict the recipients' rights in the Source Code
|
||||
Form.
|
||||
|
||||
3.2. Distribution of Executable Form
|
||||
|
||||
If You distribute Covered Software in Executable Form then:
|
||||
|
||||
(a) such Covered Software must also be made available in Source Code
|
||||
Form, as described in Section 3.1, and You must inform recipients of
|
||||
the Executable Form how they can obtain a copy of such Source Code
|
||||
Form by reasonable means in a timely manner, at a charge no more
|
||||
than the cost of distribution to the recipient; and
|
||||
|
||||
(b) You may distribute such Executable Form under the terms of this
|
||||
License, or sublicense it under different terms, provided that the
|
||||
license for the Executable Form does not attempt to limit or alter
|
||||
the recipients' rights in the Source Code Form under this License.
|
||||
|
||||
3.3. Distribution of a Larger Work
|
||||
|
||||
You may create and distribute a Larger Work under terms of Your choice,
|
||||
provided that You also comply with the requirements of this License for
|
||||
the Covered Software. If the Larger Work is a combination of Covered
|
||||
Software with a work governed by one or more Secondary Licenses, and the
|
||||
Covered Software is not Incompatible With Secondary Licenses, this
|
||||
License permits You to additionally distribute such Covered Software
|
||||
under the terms of such Secondary License(s), so that the recipient of
|
||||
the Larger Work may, at their option, further distribute the Covered
|
||||
Software under the terms of either this License or such Secondary
|
||||
License(s).
|
||||
|
||||
3.4. Notices
|
||||
|
||||
You may not remove or alter the substance of any license notices
|
||||
(including copyright notices, patent notices, disclaimers of warranty,
|
||||
or limitations of liability) contained within the Source Code Form of
|
||||
the Covered Software, except that You may alter any license notices to
|
||||
the extent required to remedy known factual inaccuracies.
|
||||
|
||||
3.5. Application of Additional Terms
|
||||
|
||||
You may choose to offer, and to charge a fee for, warranty, support,
|
||||
indemnity or liability obligations to one or more recipients of Covered
|
||||
Software. However, You may do so only on Your own behalf, and not on
|
||||
behalf of any Contributor. You must make it absolutely clear that any
|
||||
such warranty, support, indemnity, or liability obligation is offered by
|
||||
You alone, and You hereby agree to indemnify every Contributor for any
|
||||
liability incurred by such Contributor as a result of warranty, support,
|
||||
indemnity or liability terms You offer. You may include additional
|
||||
disclaimers of warranty and limitations of liability specific to any
|
||||
jurisdiction.
|
||||
|
||||
4. Inability to Comply Due to Statute or Regulation
|
||||
---------------------------------------------------
|
||||
|
||||
If it is impossible for You to comply with any of the terms of this
|
||||
License with respect to some or all of the Covered Software due to
|
||||
statute, judicial order, or regulation then You must: (a) comply with
|
||||
the terms of this License to the maximum extent possible; and (b)
|
||||
describe the limitations and the code they affect. Such description must
|
||||
be placed in a text file included with all distributions of the Covered
|
||||
Software under this License. Except to the extent prohibited by statute
|
||||
or regulation, such description must be sufficiently detailed for a
|
||||
recipient of ordinary skill to be able to understand it.
|
||||
|
||||
5. Termination
|
||||
--------------
|
||||
|
||||
5.1. The rights granted under this License will terminate automatically
|
||||
if You fail to comply with any of its terms. However, if You become
|
||||
compliant, then the rights granted under this License from a particular
|
||||
Contributor are reinstated (a) provisionally, unless and until such
|
||||
Contributor explicitly and finally terminates Your grants, and (b) on an
|
||||
ongoing basis, if such Contributor fails to notify You of the
|
||||
non-compliance by some reasonable means prior to 60 days after You have
|
||||
come back into compliance. Moreover, Your grants from a particular
|
||||
Contributor are reinstated on an ongoing basis if such Contributor
|
||||
notifies You of the non-compliance by some reasonable means, this is the
|
||||
first time You have received notice of non-compliance with this License
|
||||
from such Contributor, and You become compliant prior to 30 days after
|
||||
Your receipt of the notice.
|
||||
|
||||
5.2. If You initiate litigation against any entity by asserting a patent
|
||||
infringement claim (excluding declaratory judgment actions,
|
||||
counter-claims, and cross-claims) alleging that a Contributor Version
|
||||
directly or indirectly infringes any patent, then the rights granted to
|
||||
You by any and all Contributors for the Covered Software under Section
|
||||
2.1 of this License shall terminate.
|
||||
|
||||
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
|
||||
end user license agreements (excluding distributors and resellers) which
|
||||
have been validly granted by You or Your distributors under this License
|
||||
prior to termination shall survive termination.
|
||||
|
||||
************************************************************************
|
||||
* *
|
||||
* 6. Disclaimer of Warranty *
|
||||
* ------------------------- *
|
||||
* *
|
||||
* Covered Software is provided under this License on an "as is" *
|
||||
* basis, without warranty of any kind, either expressed, implied, or *
|
||||
* statutory, including, without limitation, warranties that the *
|
||||
* Covered Software is free of defects, merchantable, fit for a *
|
||||
* particular purpose or non-infringing. The entire risk as to the *
|
||||
* quality and performance of the Covered Software is with You. *
|
||||
* Should any Covered Software prove defective in any respect, You *
|
||||
* (not any Contributor) assume the cost of any necessary servicing, *
|
||||
* repair, or correction. This disclaimer of warranty constitutes an *
|
||||
* essential part of this License. No use of any Covered Software is *
|
||||
* authorized under this License except under this disclaimer. *
|
||||
* *
|
||||
************************************************************************
|
||||
|
||||
************************************************************************
|
||||
* *
|
||||
* 7. Limitation of Liability *
|
||||
* -------------------------- *
|
||||
* *
|
||||
* Under no circumstances and under no legal theory, whether tort *
|
||||
* (including negligence), contract, or otherwise, shall any *
|
||||
* Contributor, or anyone who distributes Covered Software as *
|
||||
* permitted above, be liable to You for any direct, indirect, *
|
||||
* special, incidental, or consequential damages of any character *
|
||||
* including, without limitation, damages for lost profits, loss of *
|
||||
* goodwill, work stoppage, computer failure or malfunction, or any *
|
||||
* and all other commercial damages or losses, even if such party *
|
||||
* shall have been informed of the possibility of such damages. This *
|
||||
* limitation of liability shall not apply to liability for death or *
|
||||
* personal injury resulting from such party's negligence to the *
|
||||
* extent applicable law prohibits such limitation. Some *
|
||||
* jurisdictions do not allow the exclusion or limitation of *
|
||||
* incidental or consequential damages, so this exclusion and *
|
||||
* limitation may not apply to You. *
|
||||
* *
|
||||
************************************************************************
|
||||
|
||||
8. Litigation
|
||||
-------------
|
||||
|
||||
Any litigation relating to this License may be brought only in the
|
||||
courts of a jurisdiction where the defendant maintains its principal
|
||||
place of business and such litigation shall be governed by laws of that
|
||||
jurisdiction, without reference to its conflict-of-law provisions.
|
||||
Nothing in this Section shall prevent a party's ability to bring
|
||||
cross-claims or counter-claims.
|
||||
|
||||
9. Miscellaneous
|
||||
----------------
|
||||
|
||||
This License represents the complete agreement concerning the subject
|
||||
matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent
|
||||
necessary to make it enforceable. Any law or regulation which provides
|
||||
that the language of a contract shall be construed against the drafter
|
||||
shall not be used to construe this License against a Contributor.
|
||||
|
||||
10. Versions of the License
|
||||
---------------------------
|
||||
|
||||
10.1. New Versions
|
||||
|
||||
Mozilla Foundation is the license steward. Except as provided in Section
|
||||
10.3, no one other than the license steward has the right to modify or
|
||||
publish new versions of this License. Each version will be given a
|
||||
distinguishing version number.
|
||||
|
||||
10.2. Effect of New Versions
|
||||
|
||||
You may distribute the Covered Software under the terms of the version
|
||||
of the License under which You originally received the Covered Software,
|
||||
or under the terms of any subsequent version published by the license
|
||||
steward.
|
||||
|
||||
10.3. Modified Versions
|
||||
|
||||
If you create software not governed by this License, and you want to
|
||||
create a new license for such software, you may create and use a
|
||||
modified version of this License if you rename the license and remove
|
||||
any references to the name of the license steward (except to note that
|
||||
such modified license differs from this License).
|
||||
|
||||
10.4. Distributing Source Code Form that is Incompatible With Secondary
|
||||
Licenses
|
||||
|
||||
If You choose to distribute Source Code Form that is Incompatible With
|
||||
Secondary Licenses under the terms of this version of the License, the
|
||||
notice described in Exhibit B of this License must be attached.
|
||||
|
||||
Exhibit A - Source Code Form License Notice
|
||||
-------------------------------------------
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
If it is not possible or desirable to put the notice in a particular
|
||||
file, then You may include the notice in a location (such as a LICENSE
|
||||
file in a relevant directory) where a recipient would be likely to look
|
||||
for such a notice.
|
||||
|
||||
You may add additional accurate notices of copyright ownership.
|
||||
|
||||
Exhibit B - "Incompatible With Secondary Licenses" Notice
|
||||
---------------------------------------------------------
|
||||
|
||||
This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
defined by the Mozilla Public License, v. 2.0.
|
|
@ -0,0 +1,102 @@
|
|||
###############################################################################
|
||||
# JSON Beautifier #
|
||||
# Copyright (c) 2018 Michael Alexsander Silva Dias #
|
||||
#-----------------------------------------------------------------------------#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public #
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this #
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. #
|
||||
###############################################################################
|
||||
|
||||
extends Node
|
||||
class_name JSONBeautifier
|
||||
|
||||
# Takes valid JSON (if invalid, it will return a error according with Godot's
|
||||
# 'validade_json' method) and a number of spaces for indentation (default is
|
||||
# '0', in which it will use tabs instead).
|
||||
static func beautify_json(json : String, spaces : int = 0) -> String:
|
||||
var error_message = validate_json(json)
|
||||
if not error_message.empty():
|
||||
return error_message
|
||||
|
||||
var indentation = ""
|
||||
if spaces > 0:
|
||||
for i in spaces:
|
||||
indentation += " "
|
||||
else:
|
||||
indentation = "\t"
|
||||
|
||||
var char_position = 0
|
||||
var quotation_start = -1
|
||||
for i in json:
|
||||
if i == "\"":
|
||||
if quotation_start == -1:
|
||||
quotation_start = char_position
|
||||
elif json[char_position - 1] != "\\":
|
||||
quotation_start = -1
|
||||
|
||||
char_position += 1
|
||||
|
||||
continue
|
||||
elif quotation_start != -1:
|
||||
char_position += 1
|
||||
|
||||
continue
|
||||
|
||||
match i:
|
||||
# Remove pre-existing formating.
|
||||
" ", "\n", "\t":
|
||||
json[char_position] = ""
|
||||
char_position -= 1
|
||||
|
||||
"{", "[", ",":
|
||||
if json[char_position + 1] != "}" and\
|
||||
json[char_position + 1] != "]":
|
||||
json = json.insert(char_position + 1, "\n")
|
||||
char_position += 1
|
||||
"}", "]":
|
||||
if json[char_position - 1] != "{" and\
|
||||
json[char_position - 1] != "[":
|
||||
json = json.insert(char_position, "\n")
|
||||
char_position += 1
|
||||
":":
|
||||
json = json.insert(char_position + 1, " ")
|
||||
char_position += 1
|
||||
|
||||
char_position += 1
|
||||
|
||||
var bracket_start
|
||||
var bracket_end
|
||||
var bracket_count
|
||||
for i in [["{", "}"], ["[", "]"]]:
|
||||
bracket_start = json.find(i[0])
|
||||
while bracket_start != -1:
|
||||
bracket_end = json.find("\n", bracket_start)
|
||||
bracket_count = 0
|
||||
while bracket_end != - 1:
|
||||
if json[bracket_end - 1] == i[0]:
|
||||
bracket_count += 1
|
||||
elif json[bracket_end + 1] == i[1]:
|
||||
bracket_count -= 1
|
||||
|
||||
# Move through the indentation to see if there is a match.
|
||||
while json[bracket_end + 1] == indentation:
|
||||
bracket_end += 1
|
||||
|
||||
if json[bracket_end + 1] == i[1]:
|
||||
bracket_count -= 1
|
||||
|
||||
if bracket_count <= 0:
|
||||
break
|
||||
|
||||
bracket_end = json.find("\n", bracket_end + 1)
|
||||
|
||||
# Skip one newline so the end bracket doesn't get indented.
|
||||
bracket_end = json.rfind("\n", json.rfind("\n", bracket_end) - 1)
|
||||
while bracket_end > bracket_start:
|
||||
json = json.insert(bracket_end + 1, indentation)
|
||||
bracket_end = json.rfind("\n", bracket_end - 1)
|
||||
|
||||
bracket_start = json.find(i[0], bracket_start + 1)
|
||||
|
||||
return json
|
||||
|
Loading…
Reference in New Issue