A game framework written with osu! in mind.
1// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
2// See the LICENCE file in the repository root for full licence text.
3
4using osu.Framework;
5using osu.Framework.Graphics;
6using osuTK;
7using osuTK.Graphics;
8using osu.Framework.Graphics.Shapes;
9using osu.Framework.Allocation;
10
11namespace SampleGame
12{
13 public class SampleGameGame : Game
14 {
15 private Box box;
16
17 [BackgroundDependencyLoader]
18 private void load()
19 {
20 Add(box = new Box
21 {
22 Anchor = Anchor.Centre,
23 Origin = Anchor.Centre,
24 Size = new Vector2(150, 150),
25 Colour = Color4.Tomato
26 });
27 }
28
29 protected override void Update()
30 {
31 base.Update();
32 box.Rotation += (float)Time.Elapsed / 10;
33 }
34 }
35}