mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Add basic intro sequence.
This commit is contained in:
@ -5,24 +5,46 @@ using System;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Framework.GameModes;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using osu.Game.GameModes.Backgrounds;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.GameModes.Menu
|
||||
{
|
||||
class Intro : OsuGameMode
|
||||
{
|
||||
private OsuLogo logo;
|
||||
protected override BackgroundMode CreateBackground() => new BackgroundModeEmpty();
|
||||
|
||||
public override void Load()
|
||||
{
|
||||
base.Load();
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
logo = new OsuLogo()
|
||||
{
|
||||
Alpha = 0,
|
||||
Additive = true,
|
||||
Interactive = false,
|
||||
Colour = Color4.DarkGray,
|
||||
Ripple = false
|
||||
}
|
||||
};
|
||||
|
||||
AudioSample welcome = Game.Audio.Sample.Get(@"welcome");
|
||||
welcome.Play();
|
||||
|
||||
AudioTrack bgm = Game.Audio.Track.Get(@"circles");
|
||||
bgm.Looping = true;
|
||||
|
||||
Game.Scheduler.Add(delegate
|
||||
{
|
||||
welcome.Play();
|
||||
}, true);
|
||||
|
||||
|
||||
Game.Scheduler.AddDelayed(delegate
|
||||
{
|
||||
bgm.Start();
|
||||
@ -32,6 +54,17 @@ namespace osu.Game.GameModes.Menu
|
||||
{
|
||||
Push(new MainMenu());
|
||||
}, 2900);
|
||||
|
||||
logo.ScaleTo(0);
|
||||
|
||||
logo.ScaleTo(1,5900, EasingTypes.OutQuint);
|
||||
logo.FadeIn(30000, EasingTypes.OutQuint);
|
||||
}
|
||||
|
||||
protected override void OnSuspending(GameMode next)
|
||||
{
|
||||
Content.FadeOut(300);
|
||||
base.OnSuspending(next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user