just use WorldBounds.{Width,Height} instead of {Size.X,Size.Y}
This commit is contained in:
parent
f12d4b1e36
commit
1a025c275b
@ -21,9 +21,9 @@ namespace SemiColinGames {
|
|||||||
Vector2 motion = Vector2.Multiply(input[0].Motion, modelTime * speed);
|
Vector2 motion = Vector2.Multiply(input[0].Motion, modelTime * speed);
|
||||||
Position = Vector2.Add(Position, motion);
|
Position = Vector2.Add(Position, motion);
|
||||||
Position.X = Math.Max(Position.X, HalfSize.X);
|
Position.X = Math.Max(Position.X, HalfSize.X);
|
||||||
Position.X = Math.Min(Position.X, worldBounds.Size.X - HalfSize.X);
|
Position.X = Math.Min(Position.X, worldBounds.Width - HalfSize.X);
|
||||||
Position.Y = Math.Max(Position.Y, HalfSize.Y);
|
Position.Y = Math.Max(Position.Y, HalfSize.Y);
|
||||||
Position.Y = Math.Min(Position.Y, worldBounds.Size.Y - HalfSize.Y);
|
Position.Y = Math.Min(Position.Y, worldBounds.Height - HalfSize.Y);
|
||||||
|
|
||||||
// Check whether we need to add new shots.
|
// Check whether we need to add new shots.
|
||||||
shotCooldown -= modelTime;
|
shotCooldown -= modelTime;
|
||||||
|
Loading…
Reference in New Issue
Block a user