Compare commits
No commits in common. "b2583677bf547f0a1b4b9c20e6ed663aba184a32" and "b574a5a7024864d0a4b25a9d8a8beb86b461fb8f" have entirely different histories.
b2583677bf
...
b574a5a702
@ -57,7 +57,7 @@ namespace SemiColinGames {
|
||||
fsm = new FSM(new Dictionary<string, IState> {
|
||||
{ "idle", new IdleState() },
|
||||
{ "run", new RunState() }
|
||||
}, "run");
|
||||
}, "idle");
|
||||
}
|
||||
|
||||
public int Facing = 1;
|
||||
|
@ -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, true);
|
||||
public static Terrain Spike = new Terrain('^', true, Textures.Grassland, 11, 8);
|
||||
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) :
|
||||
this(symbol, isObstacle, texture, x, y, false) {}
|
||||
|
||||
private Terrain(char symbol, bool isObstacle, TextureRef texture, int x, int y, bool isHarmful) {
|
||||
private Terrain(char symbol, bool isObstacle, TextureRef texture, int x, int y) {
|
||||
if (mapping.ContainsKey(symbol)) {
|
||||
throw new ArgumentException("already have a terrain with symbol " + symbol);
|
||||
}
|
||||
mapping[symbol] = this;
|
||||
IsObstacle = isObstacle;
|
||||
IsHarmful = isHarmful;
|
||||
// TODO: don't hard-code just the one spike.
|
||||
if (symbol == '^') {
|
||||
IsHarmful = true;
|
||||
}
|
||||
Texture = texture;
|
||||
int size = World.TileSize;
|
||||
TextureSource = new Rectangle(x * size, y * size, size, size);
|
||||
|
Loading…
Reference in New Issue
Block a user