diff --git a/Assets/zétoile.png b/Assets/zétoile.png new file mode 100644 index 0000000..56c3da7 Binary files /dev/null and b/Assets/zétoile.png differ diff --git a/Assets/zétoile.png.import b/Assets/zétoile.png.import new file mode 100644 index 0000000..76cc008 --- /dev/null +++ b/Assets/zétoile.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/zétoile.png-95e033ce52b6e389eaf579da15f7aac5.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/zétoile.png" +dest_files=[ "res://.import/zétoile.png-95e033ce52b6e389eaf579da15f7aac5.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=false +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=false +svg/scale=1.0 diff --git a/Scene/HealthBar.tscn b/Scene/HealthBar.tscn index cdefd1e..c436587 100644 --- a/Scene/HealthBar.tscn +++ b/Scene/HealthBar.tscn @@ -20,6 +20,7 @@ margin_top = 39.6669 margin_right = 332.0 margin_bottom = 79.6669 rect_scale = Vector2( 1.75, 1.75 ) +step = 0.1 value = 99.0 texture_under = ExtResource( 3 ) texture_over = ExtResource( 2 ) diff --git a/Scene/Player.tscn b/Scene/Player.tscn index 5700ede..3113a0b 100644 --- a/Scene/Player.tscn +++ b/Scene/Player.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=26 format=2] +[gd_scene load_steps=28 format=2] [ext_resource path="res://Assets/spriteset test.png" type="Texture" id=1] [ext_resource path="res://Scripts/Player.gd" type="Script" id=2] +[ext_resource path="res://Assets/zétoile.png" type="Texture" id=3] [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 15.5015, 46.849 ) @@ -202,6 +203,11 @@ start_node = "Idle" [sub_resource type="AnimationNodeStateMachinePlayback" id=23] +[sub_resource type="Curve2D" id=24] +_data = { +"points": PoolVector2Array( -15.7724, -10.548, 15.7724, 10.548, 79.9353, -88.996, 8.91483, -9.7366, -8.91483, 9.7366, 75.135, -62.2204, 10.2863, 13.7935, -10.2863, -13.7935, -33.2145, -63.0318, -10.2863, 9.7366, 10.2863, -9.7366, -16.7564, -88.1847, -14.4009, 13.7935, 14.4009, -13.7935, -16.7564, -88.996, -6.85756, -19.4732, 6.85756, 19.4732, 79.9353, -88.996 ) +} + [node name="KinematicBody2D" type="KinematicBody2D"] script = ExtResource( 2 ) @@ -231,3 +237,33 @@ active = true parameters/playback = SubResource( 23 ) parameters/Idle/blend_position = Vector2( -1.1, 0.0314158 ) parameters/Run/blend_position = Vector2( -0.0925897, 0.517895 ) + +[node name="ConfusionStars" type="Node2D" parent="."] + +[node name="Path2D" type="Path2D" parent="ConfusionStars"] +position = Vector2( -19.4617, -21.2425 ) +scale = Vector2( 0.731191, 0.591658 ) +curve = SubResource( 24 ) + +[node name="PathFollow2D" type="PathFollow2D" parent="ConfusionStars/Path2D"] +position = Vector2( 79.9353, -88.996 ) +rotation = 0.639347 +rotate = false + +[node name="Sprite" type="Sprite" parent="ConfusionStars/Path2D/PathFollow2D"] +position = Vector2( 0.823479, -2.89215 ) +rotation = -0.639347 +scale = Vector2( 1.1136, 1.2906 ) +texture = ExtResource( 3 ) + +[node name="PathFollow2D2" type="PathFollow2D" parent="ConfusionStars/Path2D"] +position = Vector2( -18.8506, -56.7147 ) +rotation = 0.639347 +offset = 129.76 +rotate = false + +[node name="Sprite" type="Sprite" parent="ConfusionStars/Path2D/PathFollow2D2"] +position = Vector2( 0.823479, -2.89215 ) +rotation = -0.639347 +scale = Vector2( 1.1136, 1.2906 ) +texture = ExtResource( 3 ) diff --git a/Scripts/GameManager.gd b/Scripts/GameManager.gd index a631a8e..0390fa1 100644 --- a/Scripts/GameManager.gd +++ b/Scripts/GameManager.gd @@ -11,8 +11,7 @@ var scripts = ["res://Scripts/PaintEffects/ConfuseDirections.gd", "res://Scripts/PaintEffects/Upscale.gd"] func spawnBucket(): - var newBucket = bucket.instance() - newBucket.scriptName = scripts[randi() % scripts.size()] + var newBucket = bucket.instance() self.get_parent().add_child(newBucket) newBucket.add_to_group("bucket") newBucket.set_position(spawnPoints[randi() % spawnPoints.size()].get_position()) diff --git a/Scripts/HealthBar.gd b/Scripts/HealthBar.gd index f353540..b5248c7 100644 --- a/Scripts/HealthBar.gd +++ b/Scripts/HealthBar.gd @@ -1,12 +1,9 @@ extends Control onready var healthBar = $HealthBar -onready var updateTween = $UpdateTween func healthUpdated(health): - healthBar.value = health - updateTween.interpolate_property(healthBar, "value", health, 0.2, Tween.TRANS_SINE, Tween.EASE_IN_OUT) - updateTween.start() + healthBar.value = health func maxHealthUpdated(maxHealth): healthBar.max_value = maxHealth diff --git a/Scripts/PaintEffects/ConfuseDirections.gd b/Scripts/PaintEffects/ConfuseDirections.gd index 69327d9..9aa9cc9 100644 --- a/Scripts/PaintEffects/ConfuseDirections.gd +++ b/Scripts/PaintEffects/ConfuseDirections.gd @@ -3,13 +3,15 @@ extends Node export var Duration = 7.5 func ConfusionRoutine(player, delta): - var elapsed = 0 - var inputs = player.baseInputs + player.get_node("ConfusionStars").visible = true + var elapsed = delta + var inputs = player.baseInputs + [] inputs.shuffle() player.inputs = inputs while elapsed < Duration: elapsed += yield() player.inputs = player.baseInputs + player.get_node("ConfusionStars").visible = false func StartEffect(player): var rout = ConfusionRoutine(player, 0) diff --git a/Scripts/Player.gd b/Scripts/Player.gd index 012570f..da27209 100644 --- a/Scripts/Player.gd +++ b/Scripts/Player.gd @@ -5,6 +5,10 @@ var ACCELERATION = 1800 var FRICTION = 2000 var MAX_LIFE = 30 const PICKUP_BONUS = 5 +export var rota_speed = 100 + +var follow1; +var follow2; var vel = Vector2.ZERO var curLife = MAX_LIFE @@ -27,6 +31,9 @@ onready var animationState = animationTree.get("parameters/playback") var healthBar = null func _ready(): + get_node("ConfusionStars").visible = false + follow1 = get_node("ConfusionStars/Path2D/PathFollow2D") + follow2 = get_node("ConfusionStars/Path2D/PathFollow2D2") if self.name == "Player1": healthBar = get_tree().get_nodes_in_group("healthbar")[0] elif self.name == "Player2": @@ -34,6 +41,8 @@ func _ready(): healthBar.maxHealthUpdated(MAX_LIFE) func _process(delta): + follow1.set_offset(follow1.get_offset() + delta * rota_speed) + follow2.set_offset(follow2.get_offset() + delta * rota_speed) updatePaintEffects(delta) curLife -= delta if curLife <= 0: