Compare commits

...

2 Commits

2 changed files with 7 additions and 7 deletions

View File

@ -57,7 +57,7 @@ namespace SemiColinGames {
fsm = new FSM(new Dictionary<string, IState> {
{ "idle", new IdleState() },
{ "run", new RunState() }
}, "idle");
}, "run");
}
public int Facing = 1;

View File

@ -28,7 +28,7 @@ namespace SemiColinGames {
public static Terrain WaterL = new Terrain('~', false, Textures.Grassland, 9, 2);
public static Terrain WaterR = new Terrain('`', false, Textures.Grassland, 10, 2);
public static Terrain Block = new Terrain('X', true, Textures.Ruins, 2, 0);
public static Terrain Spike = new Terrain('^', true, Textures.Grassland, 11, 8);
public static Terrain Spike = new Terrain('^', true, Textures.Grassland, 11, 8, true);
public static Terrain Wood = new Terrain('_', true, Textures.Grassland, 10, 3);
public static Terrain WoodL = new Terrain('(', true, Textures.Grassland, 9, 3);
public static Terrain WoodR = new Terrain(')', true, Textures.Grassland, 12, 3);
@ -54,16 +54,16 @@ namespace SemiColinGames {
public TextureRef Texture { get; private set; }
public Rectangle TextureSource { get; private set; }
private Terrain(char symbol, bool isObstacle, TextureRef texture, int x, int y) {
private Terrain(char symbol, bool isObstacle, TextureRef texture, int x, int y) :
this(symbol, isObstacle, texture, x, y, false) {}
private Terrain(char symbol, bool isObstacle, TextureRef texture, int x, int y, bool isHarmful) {
if (mapping.ContainsKey(symbol)) {
throw new ArgumentException("already have a terrain with symbol " + symbol);
}
mapping[symbol] = this;
IsObstacle = isObstacle;
// TODO: don't hard-code just the one spike.
if (symbol == '^') {
IsHarmful = true;
}
IsHarmful = isHarmful;
Texture = texture;
int size = World.TileSize;
TextureSource = new Rectangle(x * size, y * size, size, size);