public override void Load() { stage = new Stage(game, "level.tmx"); hud = new GuiHUD(game, sb); robot = new Robot(game, stage); CenterCamera(); drawComps = new List<DrawComparable>(stage.objects); drawComps.Add(robot); MediaPlayer.Play(game.Content.Load<Song>("SpaceDub_V1")); MediaPlayer.IsRepeating = true; blackHole = game.Content.Load<Texture2D>("blackhole"); bhsize = new Vector2(blackHole.Width, blackHole.Height); }
private void AddConveyor(Point tile, Robot.Direction dir) { Rectangle initSource = new Rectangle(832, 192, TileSize, TileSize); switch (dir) { case Robot.Direction.Left: initSource.Y += 64; break; case Robot.Direction.Up: initSource.Y += 128; break; case Robot.Direction.Down: initSource.Y += 192; break; } var con = new Conveyer(game, batch, game.Content.Load<Texture2D>(objTexName), TileToPos(tile), initSource, 3, 1.0f / 10.0f, true, 2, dir); con.PlayAnimation(); objects.Add(con); }
public Conveyer(ADHDGame g, SpriteBatch sb, Texture2D t, Vector2 position, Rectangle init, int nFrames, float rate, bool l, int type, Robot.Direction dir) : base(g, sb, t, position, init, nFrames, rate, l, type) { cdir = dir; rec = new Rectangle((int)position.X, (int)position.Y, Stage.TileSize, Stage.TileSize); }