Compare commits
6 Commits
1fd19f14dc
...
7ed2f3ebb6
Author | SHA1 | Date | |
---|---|---|---|
7ed2f3ebb6 | |||
d2d671e24f | |||
fb0fee59ad | |||
a01c4a1d51 | |||
239dc167f9 | |||
20c4bd8b3a |
@ -91,6 +91,11 @@ namespace SemiColinGames {
|
|||||||
AddRect(rect, color);
|
AddRect(rect, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Conditional("DEBUG")]
|
||||||
|
public static void AddPoint(Vector2 v, Color color) {
|
||||||
|
AddPoint(v.ToPoint(), color);
|
||||||
|
}
|
||||||
|
|
||||||
[Conditional("DEBUG")]
|
[Conditional("DEBUG")]
|
||||||
public static void AddPoint(Point p, Color color) {
|
public static void AddPoint(Point p, Color color) {
|
||||||
AddLine(p.X, p.Y - 2, p.X, p.Y + 1, color);
|
AddLine(p.X, p.Y - 2, p.X, p.Y + 1, color);
|
||||||
|
@ -4,6 +4,8 @@ using System;
|
|||||||
namespace SemiColinGames {
|
namespace SemiColinGames {
|
||||||
public class MusicPlayer : IDisposable {
|
public class MusicPlayer : IDisposable {
|
||||||
|
|
||||||
|
public static bool Enabled = false;
|
||||||
|
|
||||||
private SoundEffectInstance music;
|
private SoundEffectInstance music;
|
||||||
|
|
||||||
~MusicPlayer() {
|
~MusicPlayer() {
|
||||||
@ -34,7 +36,9 @@ namespace SemiColinGames {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void Play() {
|
public void Play() {
|
||||||
|
if (Enabled) {
|
||||||
music?.Play();
|
music?.Play();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,16 +64,16 @@ namespace SemiColinGames {
|
|||||||
|
|
||||||
private void LoadLevel() {
|
private void LoadLevel() {
|
||||||
world?.Dispose();
|
world?.Dispose();
|
||||||
// world = new SneakWorld(GraphicsDevice, Content.LoadString("levels/demo.json"));
|
world = new SneakWorld(GraphicsDevice, Content.LoadString("levels/demo.json"));
|
||||||
// world = new TreeWorld();
|
// world = new TreeWorld();
|
||||||
// world = new ShmupWorld();
|
// world = new ShmupWorld();
|
||||||
world = new SpiderWorld();
|
// world = new SpiderWorld();
|
||||||
|
|
||||||
scene?.Dispose();
|
scene?.Dispose();
|
||||||
// scene = new SneakScene(GraphicsDevice, ((SneakWorld) world).Camera);
|
scene = new SneakScene(GraphicsDevice, ((SneakWorld) world).Camera);
|
||||||
// scene = new TreeScene(GraphicsDevice);
|
// scene = new TreeScene(GraphicsDevice);
|
||||||
// scene = new ShmupScene(GraphicsDevice, ((ShmupWorld) world).Bounds.Size);
|
// scene = new ShmupScene(GraphicsDevice, ((ShmupWorld) world).Bounds.Size);
|
||||||
scene = new SpiderScene(GraphicsDevice, ((SpiderWorld) world).Bounds.Size);
|
// scene = new SpiderScene(GraphicsDevice, ((SpiderWorld) world).Bounds.Size);
|
||||||
|
|
||||||
GC.Collect();
|
GC.Collect();
|
||||||
GC.WaitForPendingFinalizers();
|
GC.WaitForPendingFinalizers();
|
||||||
|
@ -12,7 +12,7 @@ namespace SemiColinGames {
|
|||||||
private Vector2 anchor;
|
private Vector2 anchor;
|
||||||
private float radius;
|
private float radius;
|
||||||
private float angle;
|
private float angle;
|
||||||
private float momentum = -400; // radians / second * pixels
|
private float momentum = -300; // radians / second * pixels
|
||||||
|
|
||||||
public Spider(float x, float y, float radius, float angle) {
|
public Spider(float x, float y, float radius, float angle) {
|
||||||
Position = new Vector2();
|
Position = new Vector2();
|
||||||
@ -22,8 +22,8 @@ namespace SemiColinGames {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void Update(float modelTime, History<Input> input) {
|
public void Update(float modelTime, History<Input> input) {
|
||||||
radius += 100 * modelTime * input[0].Motion.Y;
|
radius += 150 * modelTime * input[0].Motion.Y;
|
||||||
radius = Math.Clamp(radius, 10, 300);
|
radius = Math.Clamp(radius, 50, 200);
|
||||||
float angleChange = modelTime * momentum / radius;
|
float angleChange = modelTime * momentum / radius;
|
||||||
angle += angleChange;
|
angle += angleChange;
|
||||||
float x = anchor.X + radius * (float) Math.Sin(angle);
|
float x = anchor.X + radius * (float) Math.Sin(angle);
|
||||||
@ -41,7 +41,7 @@ namespace SemiColinGames {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class Anchor {
|
public class Anchor {
|
||||||
public TextureRef Texture = Textures.Blue1;
|
public TextureRef Texture = Textures.Terran;
|
||||||
public Vector2 Position;
|
public Vector2 Position;
|
||||||
|
|
||||||
public Anchor(float x, float y) {
|
public Anchor(float x, float y) {
|
||||||
@ -62,10 +62,12 @@ namespace SemiColinGames {
|
|||||||
|
|
||||||
public SpiderWorld() {
|
public SpiderWorld() {
|
||||||
Bounds = new Rectangle(0, 0, 1280, 720);
|
Bounds = new Rectangle(0, 0, 1280, 720);
|
||||||
Player = new Spider(1280 / 2, 720 / 2, 200, 0);
|
Player = new Spider(200, 720 / 2, 200, 0);
|
||||||
|
|
||||||
Anchors = new ProfilingList<Anchor>(100, "anchors");
|
Anchors = new ProfilingList<Anchor>(100, "anchors");
|
||||||
Anchors.Add(new Anchor(1280 / 2, 720 / 2));
|
Anchors.Add(new Anchor(200, 720 / 2));
|
||||||
|
Anchors.Add(new Anchor(600, 720 / 4));
|
||||||
|
Anchors.Add(new Anchor(800, 640));
|
||||||
}
|
}
|
||||||
|
|
||||||
~SpiderWorld() {
|
~SpiderWorld() {
|
||||||
|
@ -82,6 +82,9 @@ namespace SemiColinGames {
|
|||||||
public static TextureRef Projectile4 = new TextureRef("sprites/dylestorm/projectile02-4");
|
public static TextureRef Projectile4 = new TextureRef("sprites/dylestorm/projectile02-4");
|
||||||
public static TextureRef Projectile5 = new TextureRef("sprites/dylestorm/projectile02-5");
|
public static TextureRef Projectile5 = new TextureRef("sprites/dylestorm/projectile02-5");
|
||||||
|
|
||||||
|
// Planets.
|
||||||
|
public static TextureRef Terran = new TextureRef("sprites/helianthus/Terran");
|
||||||
|
|
||||||
// Backgrounds are indexed by draw order; the first element should be drawn furthest back.
|
// Backgrounds are indexed by draw order; the first element should be drawn furthest back.
|
||||||
public static TextureRef[] Backgrounds = new TextureRef[] {
|
public static TextureRef[] Backgrounds = new TextureRef[] {
|
||||||
new TextureRef("backgrounds/szadiart/pf4/background1_day"),
|
new TextureRef("backgrounds/szadiart/pf4/background1_day"),
|
||||||
|
Loading…
Reference in New Issue
Block a user