commit d25488ab585385a74be4950d33442c8409b585a5
parent 17acd91c9dac3ad357759848171bfb721fb31884
Author: Léo Villeveygoux <l@vgx.fr>
Date: Sun, 28 Aug 2022 22:37:01 +0200
écrans début + fin
Diffstat:
14 files changed, 205 insertions(+), 18 deletions(-)
diff --git a/GameOverScreen.gd b/GameOverScreen.gd
@@ -0,0 +1,15 @@
+extends Node2D
+
+
+# Declare member variables here. Examples:
+# var a = 2
+# var b = "text"
+
+#
+## Called when the node enters the scene tree for the first time.
+#func _ready():
+# pass # Replace with function body.
+
+func _unhandled_input(event):
+ if event is InputEventMouseButton:
+ get_tree().change_scene("res://StartScreen.tscn")
diff --git a/GameOverScreen.tscn b/GameOverScreen.tscn
@@ -1,12 +1,11 @@
-[gd_scene format=2]
+[gd_scene load_steps=3 format=2]
+
+[ext_resource path="res://graphics/gameover.png" type="Texture" id=1]
+[ext_resource path="res://GameOverScreen.gd" type="Script" id=2]
[node name="GameOverScreen" type="Node2D"]
+script = ExtResource( 2 )
-[node name="Label" type="Label" parent="."]
-margin_left = 216.0
-margin_top = 123.0
-margin_right = 314.0
-margin_bottom = 159.0
-text = "Game Over"
-align = 1
-valign = 1
+[node name="Gameover" type="Sprite" parent="."]
+position = Vector2( 256, 150 )
+texture = ExtResource( 1 )
diff --git a/Guard.gd b/Guard.gd
@@ -41,6 +41,10 @@ func _physics_process(delta):
$Sprite.animation = "left"
elif direction == 3:
$Sprite.animation = "up"
+
+ if dash_state >= 0:
+ $Sprite.animation = "dash_" + $Sprite.animation
+
$Sprite.playing = true
else:
$Sprite.playing = false
@@ -50,6 +54,7 @@ func _physics_process(delta):
dash_state -= delta
if dash_state <= 0:
$Dash.scale.x = (dash_timeout+dash_state)/dash_timeout * 0.01
+
else:
$Dash.visible = false
diff --git a/Level.tscn b/Level.tscn
@@ -1,4 +1,4 @@
-[gd_scene load_steps=58 format=2]
+[gd_scene load_steps=63 format=2]
[ext_resource path="res://Level.gd" type="Script" id=1]
[ext_resource path="res://President.gd" type="Script" id=2]
@@ -8,6 +8,7 @@
[ext_resource path="res://graphics/president_sheet.png" type="Texture" id=6]
[ext_resource path="res://graphics/route.png" type="Texture" id=7]
[ext_resource path="res://graphics/route2.png" type="Texture" id=8]
+[ext_resource path="res://graphics/guard_dash.png" type="Texture" id=9]
[sub_resource type="SpriteFrames" id=50]
animations = [ {
@@ -152,6 +153,26 @@ animations = [ {
"speed": 5.0
} ]
+[sub_resource type="AtlasTexture" id=51]
+flags = 4
+atlas = ExtResource( 9 )
+region = Rect2( 0, 0, 60, 60 )
+
+[sub_resource type="AtlasTexture" id=52]
+flags = 4
+atlas = ExtResource( 9 )
+region = Rect2( 0, 120, 60, 60 )
+
+[sub_resource type="AtlasTexture" id=53]
+flags = 4
+atlas = ExtResource( 9 )
+region = Rect2( 0, 60, 60, 60 )
+
+[sub_resource type="AtlasTexture" id=54]
+flags = 4
+atlas = ExtResource( 9 )
+region = Rect2( 0, 180, 60, 60 )
+
[sub_resource type="AtlasTexture" id=25]
flags = 4
atlas = ExtResource( 5 )
@@ -254,6 +275,26 @@ region = Rect2( 180, 180, 60, 60 )
[sub_resource type="SpriteFrames" id=45]
animations = [ {
+"frames": [ SubResource( 51 ) ],
+"loop": true,
+"name": "dash_down",
+"speed": 5.0
+}, {
+"frames": [ SubResource( 52 ) ],
+"loop": true,
+"name": "dash_left",
+"speed": 5.0
+}, {
+"frames": [ SubResource( 53 ) ],
+"loop": true,
+"name": "dash_right",
+"speed": 5.0
+}, {
+"frames": [ SubResource( 54 ) ],
+"loop": true,
+"name": "dash_up",
+"speed": 5.0
+}, {
"frames": [ SubResource( 25 ), SubResource( 26 ), SubResource( 27 ), SubResource( 28 ) ],
"loop": true,
"name": "down",
@@ -326,12 +367,8 @@ shape = SubResource( 3 )
[node name="Sprite" type="AnimatedSprite" parent="YSort/President"]
frames = SubResource( 24 )
-animation = "up"
-frame = 2
+animation = "dash_down"
playing = true
-__meta__ = {
-"_edit_lock_": true
-}
[node name="Guard" type="KinematicBody2D" parent="YSort"]
position = Vector2( 48, 90 )
@@ -342,8 +379,7 @@ __meta__ = {
[node name="Sprite" type="AnimatedSprite" parent="YSort/Guard"]
frames = SubResource( 45 )
-animation = "up"
-frame = 2
+animation = "right"
[node name="CollisionShape2D" type="CollisionShape2D" parent="YSort/Guard"]
position = Vector2( 0, 12 )
diff --git a/StartScreen.gd b/StartScreen.gd
@@ -0,0 +1,16 @@
+extends Node2D
+
+
+# Declare member variables here. Examples:
+# var a = 2
+# var b = "text"
+
+
+## Called when the node enters the scene tree for the first time.
+#func _ready():
+# pass # Replace with function body.
+#
+
+func _unhandled_input(event):
+ if event is InputEventMouseButton:
+ get_tree().change_scene("res://Levels.tscn")
diff --git a/StartScreen.tscn b/StartScreen.tscn
@@ -0,0 +1,11 @@
+[gd_scene load_steps=3 format=2]
+
+[ext_resource path="res://graphics/start.png" type="Texture" id=1]
+[ext_resource path="res://StartScreen.gd" type="Script" id=2]
+
+[node name="StartScreen" type="Node2D"]
+script = ExtResource( 2 )
+
+[node name="Start" type="Sprite" parent="."]
+texture = ExtResource( 1 )
+centered = false
diff --git a/artsrc/game overcouteau 2.aseprite b/artsrc/game overcouteau 2.aseprite
Binary files differ.
diff --git a/artsrc/starttotal.aseprite b/artsrc/starttotal.aseprite
Binary files differ.
diff --git a/graphics/gameover.png b/graphics/gameover.png
Binary files differ.
diff --git a/graphics/gameover.png.import b/graphics/gameover.png.import
@@ -0,0 +1,35 @@
+[remap]
+
+importer="texture"
+type="StreamTexture"
+path="res://.import/gameover.png-6160b2b3046bb3ca8dcf8f5fe69103f5.stex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://graphics/gameover.png"
+dest_files=[ "res://.import/gameover.png-6160b2b3046bb3ca8dcf8f5fe69103f5.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
+process/normal_map_invert_y=false
+stream=false
+size_limit=0
+detect_3d=true
+svg/scale=1.0
diff --git a/graphics/guard_dash.png.import b/graphics/guard_dash.png.import
@@ -0,0 +1,35 @@
+[remap]
+
+importer="texture"
+type="StreamTexture"
+path="res://.import/guard_dash.png-de9abbb38c3b656d1999be60200757d5.stex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://graphics/guard_dash.png"
+dest_files=[ "res://.import/guard_dash.png-de9abbb38c3b656d1999be60200757d5.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
+process/normal_map_invert_y=false
+stream=false
+size_limit=0
+detect_3d=true
+svg/scale=1.0
diff --git a/graphics/start.png b/graphics/start.png
Binary files differ.
diff --git a/graphics/start.png.import b/graphics/start.png.import
@@ -0,0 +1,35 @@
+[remap]
+
+importer="texture"
+type="StreamTexture"
+path="res://.import/start.png-fe19c1ac72d1e21cfa1c627bcb57b397.stex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://graphics/start.png"
+dest_files=[ "res://.import/start.png-fe19c1ac72d1e21cfa1c627bcb57b397.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
+process/normal_map_invert_y=false
+stream=false
+size_limit=0
+detect_3d=true
+svg/scale=1.0
diff --git a/project.godot b/project.godot
@@ -21,7 +21,7 @@ _global_script_class_icons={
[application]
config/name="President"
-run/main_scene="res://Levels.tscn"
+run/main_scene="res://StartScreen.tscn"
config/icon="res://icon.png"
[display]