34 lines
750 B
C#
34 lines
750 B
C#
|
using Microsoft.Xna.Framework;
|
|||
|
using Microsoft.Xna.Framework.Graphics;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
|
|||
|
namespace SemiColinGames {
|
|||
|
public sealed class ShmupWorld : IWorld {
|
|||
|
public struct ShmupPlayer {
|
|||
|
// Center of player sprite.
|
|||
|
public Vector2 Position;
|
|||
|
}
|
|||
|
|
|||
|
public ShmupPlayer Player;
|
|||
|
|
|||
|
public ShmupWorld() {
|
|||
|
Player = new ShmupPlayer();
|
|||
|
}
|
|||
|
|
|||
|
~ShmupWorld() {
|
|||
|
Dispose();
|
|||
|
}
|
|||
|
|
|||
|
public void Dispose() {
|
|||
|
GC.SuppressFinalize(this);
|
|||
|
}
|
|||
|
|
|||
|
public void Update(float modelTime, History<Input> input) {
|
|||
|
float speed = 150f;
|
|||
|
Vector2 motion = Vector2.Multiply(input[0].Motion, modelTime * speed);
|
|||
|
Player.Position = Vector2.Add(Player.Position, motion);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|