Menu animation
This commit is contained in:
parent
619ed0c88e
commit
4826bc4035
15 changed files with 462 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
|
|
11
scripts/MovingParallaxBackground.cs
Normal file
11
scripts/MovingParallaxBackground.cs
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue