diff --git a/images/Exhaust_Frame_01.png b/images/Exhaust_Frame_01.png new file mode 100644 index 0000000..a421c0f Binary files /dev/null and b/images/Exhaust_Frame_01.png differ diff --git a/images/asteroid_tiny.png.import b/images/Exhaust_Frame_01.png.import similarity index 68% rename from images/asteroid_tiny.png.import rename to images/Exhaust_Frame_01.png.import index 2b5fbda..de01efa 100644 --- a/images/asteroid_tiny.png.import +++ b/images/Exhaust_Frame_01.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/asteroid_tiny.png-ffeeb3d6ad46f56e166f43c37735ea56.stex" +path="res://.import/Exhaust_Frame_01.png-73973e26157e2b33a7832c7f56474a53.stex" metadata={ "vram_texture": false } [deps] -source_file="res://images/asteroid_tiny.png" -dest_files=[ "res://.import/asteroid_tiny.png-ffeeb3d6ad46f56e166f43c37735ea56.stex" ] +source_file="res://images/Exhaust_Frame_01.png" +dest_files=[ "res://.import/Exhaust_Frame_01.png-73973e26157e2b33a7832c7f56474a53.stex" ] [params] diff --git a/images/Exhaust_Frame_02.png b/images/Exhaust_Frame_02.png new file mode 100644 index 0000000..2958785 Binary files /dev/null and b/images/Exhaust_Frame_02.png differ diff --git a/images/asteroid_grey.png.import b/images/Exhaust_Frame_02.png.import similarity index 68% rename from images/asteroid_grey.png.import rename to images/Exhaust_Frame_02.png.import index 9858f54..c810703 100644 --- a/images/asteroid_grey.png.import +++ b/images/Exhaust_Frame_02.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/asteroid_grey.png-8dc4d6f97bc2cff97dcb90e982bc3460.stex" +path="res://.import/Exhaust_Frame_02.png-4c72c24d965d737e278c892b7c523f63.stex" metadata={ "vram_texture": false } [deps] -source_file="res://images/asteroid_grey.png" -dest_files=[ "res://.import/asteroid_grey.png-8dc4d6f97bc2cff97dcb90e982bc3460.stex" ] +source_file="res://images/Exhaust_Frame_02.png" +dest_files=[ "res://.import/Exhaust_Frame_02.png-4c72c24d965d737e278c892b7c523f63.stex" ] [params] diff --git a/images/Exhaust_Frame_03.png b/images/Exhaust_Frame_03.png new file mode 100644 index 0000000..a5784a1 Binary files /dev/null and b/images/Exhaust_Frame_03.png differ diff --git a/images/background-red.png.import b/images/Exhaust_Frame_03.png.import similarity index 68% rename from images/background-red.png.import rename to images/Exhaust_Frame_03.png.import index 2913123..3ede60c 100644 --- a/images/background-red.png.import +++ b/images/Exhaust_Frame_03.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/background-red.png-cfd79b18e6744e1b1528eaa92dd95c53.stex" +path="res://.import/Exhaust_Frame_03.png-89e6003264539e355848350bef2c2da2.stex" metadata={ "vram_texture": false } [deps] -source_file="res://images/background-red.png" -dest_files=[ "res://.import/background-red.png-cfd79b18e6744e1b1528eaa92dd95c53.stex" ] +source_file="res://images/Exhaust_Frame_03.png" +dest_files=[ "res://.import/Exhaust_Frame_03.png-89e6003264539e355848350bef2c2da2.stex" ] [params] diff --git a/images/Exhaust_Frame_04.png b/images/Exhaust_Frame_04.png new file mode 100644 index 0000000..2c47a80 Binary files /dev/null and b/images/Exhaust_Frame_04.png differ diff --git a/images/pixel_asteroid.png.import b/images/Exhaust_Frame_04.png.import similarity index 68% rename from images/pixel_asteroid.png.import rename to images/Exhaust_Frame_04.png.import index 3b5af07..c1a7f3f 100644 --- a/images/pixel_asteroid.png.import +++ b/images/Exhaust_Frame_04.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/pixel_asteroid.png-4c8492b5959058b49bb7cde80113cd5e.stex" +path="res://.import/Exhaust_Frame_04.png-1b6fa9e6c2431ee4c18528357313c2c0.stex" metadata={ "vram_texture": false } [deps] -source_file="res://images/pixel_asteroid.png" -dest_files=[ "res://.import/pixel_asteroid.png-4c8492b5959058b49bb7cde80113cd5e.stex" ] +source_file="res://images/Exhaust_Frame_04.png" +dest_files=[ "res://.import/Exhaust_Frame_04.png-1b6fa9e6c2431ee4c18528357313c2c0.stex" ] [params] diff --git a/images/Exhaust_Frame_05.png b/images/Exhaust_Frame_05.png new file mode 100644 index 0000000..0f7dea2 Binary files /dev/null and b/images/Exhaust_Frame_05.png differ diff --git a/images/Exhaust_Frame_05.png.import b/images/Exhaust_Frame_05.png.import new file mode 100644 index 0000000..606567f --- /dev/null +++ b/images/Exhaust_Frame_05.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Exhaust_Frame_05.png-4609410d28d51f2c6780e575475fb8ea.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://images/Exhaust_Frame_05.png" +dest_files=[ "res://.import/Exhaust_Frame_05.png-4609410d28d51f2c6780e575475fb8ea.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 diff --git a/images/Exhaust_Frame_06.png b/images/Exhaust_Frame_06.png new file mode 100644 index 0000000..eec97b2 Binary files /dev/null and b/images/Exhaust_Frame_06.png differ diff --git a/images/Exhaust_Frame_06.png.import b/images/Exhaust_Frame_06.png.import new file mode 100644 index 0000000..f5d8c8a --- /dev/null +++ b/images/Exhaust_Frame_06.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Exhaust_Frame_06.png-ce8fbbabde1b4b27fa88b93297d9d0b5.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://images/Exhaust_Frame_06.png" +dest_files=[ "res://.import/Exhaust_Frame_06.png-ce8fbbabde1b4b27fa88b93297d9d0b5.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 diff --git a/images/PlayerRed_Frame_01.png b/images/PlayerRed_Frame_01.png new file mode 100644 index 0000000..e71eb03 Binary files /dev/null and b/images/PlayerRed_Frame_01.png differ diff --git a/images/asteroid_grey_tiny.png.import b/images/PlayerRed_Frame_01.png.import similarity index 67% rename from images/asteroid_grey_tiny.png.import rename to images/PlayerRed_Frame_01.png.import index cf1fa81..ef92475 100644 --- a/images/asteroid_grey_tiny.png.import +++ b/images/PlayerRed_Frame_01.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/asteroid_grey_tiny.png-193f065c369845d128bbc29aebc466dc.stex" +path="res://.import/PlayerRed_Frame_01.png-a1b13767a761fc8009c20efe6cbca3cd.stex" metadata={ "vram_texture": false } [deps] -source_file="res://images/asteroid_grey_tiny.png" -dest_files=[ "res://.import/asteroid_grey_tiny.png-193f065c369845d128bbc29aebc466dc.stex" ] +source_file="res://images/PlayerRed_Frame_01.png" +dest_files=[ "res://.import/PlayerRed_Frame_01.png-a1b13767a761fc8009c20efe6cbca3cd.stex" ] [params] diff --git a/images/asteroid_grey.png b/images/asteroid_grey.png deleted file mode 100644 index 127efb1..0000000 Binary files a/images/asteroid_grey.png and /dev/null differ diff --git a/images/asteroid_grey_tiny.png b/images/asteroid_grey_tiny.png deleted file mode 100644 index bc07659..0000000 Binary files a/images/asteroid_grey_tiny.png and /dev/null differ diff --git a/images/asteroid_tiny.png b/images/asteroid_tiny.png deleted file mode 100644 index 9bd607b..0000000 Binary files a/images/asteroid_tiny.png and /dev/null differ diff --git a/images/background-red.png b/images/background-red.png deleted file mode 100644 index 70ec44c..0000000 Binary files a/images/background-red.png and /dev/null differ diff --git a/images/pixel_asteroid.png b/images/pixel_asteroid.png deleted file mode 100644 index 9a8998e..0000000 Binary files a/images/pixel_asteroid.png and /dev/null differ diff --git a/images/pixel_ship_red.png b/images/pixel_ship_red.png deleted file mode 100644 index c28a21a..0000000 Binary files a/images/pixel_ship_red.png and /dev/null differ diff --git a/images/pixel_ship_red.png.import b/images/pixel_ship_red.png.import deleted file mode 100644 index 0c32450..0000000 --- a/images/pixel_ship_red.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/pixel_ship_red.png-cc824bfd01a377152c43f409da7b4c36.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://images/pixel_ship_red.png" -dest_files=[ "res://.import/pixel_ship_red.png-cc824bfd01a377152c43f409da7b4c36.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 diff --git a/scenes/Main.tscn b/scenes/Main.tscn index e0c9616..8dec5a0 100644 --- a/scenes/Main.tscn +++ b/scenes/Main.tscn @@ -1,8 +1,6 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=2 format=2] -[ext_resource path="res://images/background-red.png" type="Texture" id=1] -[ext_resource path="res://scenes/Player.tscn" type="PackedScene" id=2] -[ext_resource path="res://scenes/BigAstroid.tscn" type="PackedScene" id=3] +[ext_resource path="res://scenes/Player.tscn" type="PackedScene" id=1] [node name="Main" type="Node"] @@ -10,17 +8,7 @@ [node name="ParallaxLayer" type="ParallaxLayer" parent="background"] -[node name="background-red" type="Sprite" parent="background/ParallaxLayer"] -position = Vector2( 390, 211 ) -texture = ExtResource( 1 ) - -[node name="Player" parent="." instance=ExtResource( 2 )] +[node name="Player" parent="." instance=ExtResource( 1 )] position = Vector2( 490, 190 ) [node name="StartPosition" type="Position2D" parent="."] - -[node name="BigAstroid" parent="." instance=ExtResource( 3 )] -position = Vector2( 350, 220 ) - -[node name="TileMap" type="TileMap" parent="."] -format = 1 diff --git a/scenes/Player.gd b/scenes/Player.gd index 8b04922..b26ebb3 100644 --- a/scenes/Player.gd +++ b/scenes/Player.gd @@ -21,7 +21,7 @@ signal hit func _ready(): # hide() screen_size = get_viewport_rect().size - + $Burst.hide() func _process(delta): if Input.is_action_pressed('click'): @@ -35,6 +35,8 @@ func _process(delta): if speed >= max_speed: speed = max_speed + $Burst.show() + $Burst.play('burst') velocity = (touch_point - position).normalized() * speed if released and speed > 0: @@ -43,6 +45,7 @@ func _process(delta): if speed <= 0: speed = 0 + $Burst.play('cooldown') velocity = velocity.normalized() * speed @@ -65,3 +68,8 @@ func start(pos): position = pos show() $CollisionShape2D.disabled = false + + +func _on_Burst_animation_finished(): + if $Burst.animation == 'cooldown': + $Burst.hide() diff --git a/scenes/Player.tscn b/scenes/Player.tscn index 5fcbdd4..a227209 100644 --- a/scenes/Player.tscn +++ b/scenes/Player.tscn @@ -1,24 +1,43 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=12 format=2] [ext_resource path="res://scenes/Player.gd" type="Script" id=1] -[ext_resource path="res://images/pixel_ship_red.png" type="Texture" id=2] +[ext_resource path="res://images/PlayerRed_Frame_01.png" type="Texture" id=2] +[ext_resource path="res://images/Exhaust_Frame_06.png" type="Texture" id=3] +[ext_resource path="res://images/Exhaust_Frame_05.png" type="Texture" id=4] +[ext_resource path="res://images/Exhaust_Frame_03.png" type="Texture" id=5] +[ext_resource path="res://images/Exhaust_Frame_01.png" type="Texture" id=6] +[ext_resource path="res://images/Exhaust_Frame_02.png" type="Texture" id=7] +[ext_resource path="res://images/Exhaust_Frame_04.png" type="Texture" id=8] [sub_resource type="SpriteFrames" id=1] animations = [ { -"frames": [ ExtResource( 2 ), ExtResource( 2 ) ], +"frames": [ ExtResource( 2 ) ], "loop": true, "name": "idle", "speed": 5.0 } ] +[sub_resource type="SpriteFrames" id=3] +animations = [ { +"frames": [ ExtResource( 3 ), ExtResource( 4 ), ExtResource( 5 ) ], +"loop": false, +"name": "cooldown", +"speed": 5.0 +}, { +"frames": [ ExtResource( 6 ), ExtResource( 7 ), ExtResource( 5 ), ExtResource( 4 ), ExtResource( 8 ), ExtResource( 3 ) ], +"loop": true, +"name": "burst", +"speed": 5.0 +} ] + [sub_resource type="ConvexPolygonShape2D" id=2] points = PoolVector2Array( -20, -5, -15, -20, -5, -20, 20, 0, -5, 20, -15, 20, -20, 5 ) [node name="Player" type="KinematicBody2D"] script = ExtResource( 1 ) __meta__ = { -"_edit_horizontal_guides_": [ ], -"_edit_vertical_guides_": [ ] +"_edit_horizontal_guides_": [ -43.9838 ], +"_edit_vertical_guides_": [ -22.5089 ] } [node name="Ship" type="AnimatedSprite" parent="."] @@ -29,6 +48,13 @@ frames = SubResource( 1 ) animation = "idle" offset = Vector2( 0, -5 ) +[node name="Burst" type="AnimatedSprite" parent="."] +position = Vector2( -45, 0 ) +rotation = 1.5708 +frames = SubResource( 3 ) +animation = "burst" + [node name="CollisionShape2D" type="CollisionShape2D" parent="."] position = Vector2( 0, -1 ) shape = SubResource( 2 ) +[connection signal="animation_finished" from="Burst" to="." method="_on_Burst_animation_finished"]