mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Move the Shake logic to a new ShakeContainer
This commit is contained in:
24
osu.Game/Graphics/Containers/ShakeContainer.cs
Normal file
24
osu.Game/Graphics/Containers/ShakeContainer.cs
Normal file
@ -0,0 +1,24 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Graphics.Containers
|
||||
{
|
||||
public class ShakeContainer : Container
|
||||
{
|
||||
public void Shake()
|
||||
{
|
||||
const int shake_amount = 8;
|
||||
const int shake_duration = 20;
|
||||
|
||||
this.MoveToX(shake_amount, shake_duration).Then()
|
||||
.MoveToX(-shake_amount, shake_duration).Then()
|
||||
.MoveToX(shake_amount, shake_duration).Then()
|
||||
.MoveToX(-shake_amount, shake_duration).Then()
|
||||
.MoveToX(shake_amount, shake_duration).Then()
|
||||
.MoveToX(0, shake_duration);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user