24 lines
736 B
C#
24 lines
736 B
C#
using System;
|
|
using System.Numerics;
|
|
using MonoGameBlank2dStartKit.Core.Content;
|
|
using MoonTools.ECS;
|
|
|
|
namespace MonoGameBlank2dStartKit.Core;
|
|
|
|
public static class Scenarios
|
|
{
|
|
public static void Basic(World world, Assets assets)
|
|
{
|
|
var ball = world.CreateEntity();
|
|
world.Set(ball, new Image(ImageId.Ball));
|
|
world.Set(ball, new MoveLinearly
|
|
{
|
|
Start = new Position(new Vector2(10, 10)),
|
|
Target = new Position(500, 300),
|
|
DurationSec = 1.5f,
|
|
});
|
|
// world.Set(ball, new Velocity(40f, 40f));
|
|
world.Set(ball, new Rotation(0, assets.GetTexture2D(ImageId.Ball)));
|
|
world.Set(ball, new RotationSpeed(3f, TimeSpan.FromSeconds(1.5)));
|
|
}
|
|
} |