public TileMap(Game game, int Seed = -1) { RND = new Random(); //position = new Vector2(-576); ///position = new Vector2(-128); position = new Vector2(); //tilesize = 48; tilesize = 16; //rows = 16; /*columns = 52;*/ rows = (int)Math.Ceiling(((-position.Y * 2) + game.stageBounds.bottom) / tilesize); columns = (int)Math.Ceiling(((-position.X * 2) + game.stageBounds.right) / tilesize); data = new TileData[columns, rows]; tiles = AnimationLoader.Get("images/land/brick"); cracks = AnimationLoader.Get("images/land/cracks"); this.game = game; buffer = new HTMLCanvasElement(); bg = buffer.GetContext(CanvasTypes.CanvasContext2DType.CanvasRenderingContext2D); if (Seed < 0) { this.Seed = RND.Next(); } else { this.Seed = Seed; } //Randomize(); Generate(); }
public Tile(Game game, int tile) : base(game) { this.tile = tile; Ani = new Animation(AnimationLoader.Get("images/land/brick")); Ani.CurrentFrame = tile; Ani.ImageSpeed = 0; }
public ExitDoor(Game game) : base(game) { Ani = new Animation(AnimationLoader.Get("images/misc/door")); Ani.ImageSpeed = 0; Ani.SetImage(); RemovedOnLevelEnd = false; }
public void ChangeAni(string animation, bool reset = false) { if (this.animation == animation) { return; } if (Ani == null) { Ani = new Animation(AnimationLoader.Get("images/enemies/mrghost" + animation)); } else { Ani.ChangeAnimation(AnimationLoader.Get("images/enemies/mrghost" + animation), reset); } this.animation = animation; }
public void ChangeAni(string animation, bool reset = false) { if (this.animation == animation) { return; } if (Ani == null) { Ani = new Animation(AnimationLoader.Get("images/cirno/" + animation)); } else { Ani.ChangeAnimation(AnimationLoader.Get("images/cirno/" + animation), reset); } if (this.animation != "stand") { turntime = 0; } this.animation = animation; }
public CollectableItem(Game game, string itemName) : base(game) { Ani = new Animation(AnimationLoader.Get("images/items/" + itemName)); Ani.SetImage(); this.itemName = itemName; }