# Hurry Curry! - a game about cooking # Copyright 2024 tpart # Copyright 2024 metamuffin # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, version 3 of the License only. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # extends Menu const PARTICLE_AMOUNTS = [0, 6, 32, 128] @onready var title: Label = $MarginContainer/PanelContainer/VBoxContainer/Text/Title @onready var subtitle: Label = $MarginContainer/PanelContainer/VBoxContainer/Text/Subtitle @onready var stars = $MarginContainer/PanelContainer/VBoxContainer/Stars.get_children() @onready var star_timer = $StarTimer @onready var particles = $Control/Particles func _ready(): super() show_rating(data[0], data[1]) func _process(_delta): particles.emission_rect_extents = get_viewport_rect().size * Vector2(0.5, 0.5) func show_rating(stars_: int, points: int): match stars_: 0: title.text = tr("Poor service") 1: title.text = tr("Acceptable service") 2: title.text = tr("Good service") 3: title.text = tr("Excellent service") subtitle.text = tr("You collected %s points") % points for i in range(0, stars_): var star: TextureRect = stars[i] star_timer.start() await star_timer.timeout star.material.set_shader_parameter("t", 1) star.get_node("Sound").play() particles.amount = PARTICLE_AMOUNTS[stars_] if stars_ > 0: particles.emitting = true func _on_close_pressed(): exit()