mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Fix incorrect folder name.
This commit is contained in:
44
osu.Game.Modes.Osu/Objects/Drawables/Pieces/Triangles.cs
Normal file
44
osu.Game.Modes.Osu/Objects/Drawables/Pieces/Triangles.cs
Normal file
@ -0,0 +1,44 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Framework.MathUtils;
|
||||
using OpenTK;
|
||||
|
||||
namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
|
||||
{
|
||||
public class Triangles : Container<Triangle>
|
||||
{
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
const float size = 100;
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
Add(new Triangle
|
||||
{
|
||||
Origin = Anchor.Centre,
|
||||
RelativePositionAxes = Axes.Both,
|
||||
Position = new Vector2(RNG.NextSingle(), RNG.NextSingle()),
|
||||
Scale = new Vector2(RNG.NextSingle() * 0.4f + 0.2f),
|
||||
// Scaling height by 0.866 results in equiangular triangles (== 60° and equal side length)
|
||||
Size = new Vector2(size, 0.866f * size),
|
||||
Alpha = RNG.NextSingle() * 0.3f,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
foreach (Drawable d in Children)
|
||||
d.Position -= new Vector2(0, (float)(d.Scale.X * (Time.Elapsed / 2880)));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user