Menu animation

This commit is contained in:
Иван Кузьменко 2023-08-19 12:28:56 +03:00
parent 619ed0c88e
commit 4826bc4035
15 changed files with 462 additions and 2 deletions

View file

@ -4,19 +4,23 @@ public partial class Menu : Node2D
{
private Timer _timer;
private AudioStreamPlayer2D _thunderclap;
private AnimationPlayer _animationPlayer;
public override void _Ready()
{
_timer = (Timer)FindChild("Timer");
_thunderclap = (AudioStreamPlayer2D)FindChild("Thunderclap");
_animationPlayer = (AnimationPlayer)FindChild("AnimationPlayer");
GameManager.IsPlaying = false;
_animationPlayer.Play("intro_animation");
}
public override void _Input(InputEvent @event)
{
if (@event.IsActionPressed("ui_confirm") && _timer.IsStopped())
{
_animationPlayer.Play("thunder");
_thunderclap.Play();
_timer.Start();
}

View file

@ -0,0 +1,11 @@
using Godot;
public partial class MovingParallaxBackground : ParallaxBackground
{
[Export] public Vector2 Speed;
public override void _Process(double delta)
{
ScrollOffset += Speed * (float)delta;
}
}