Ejemplo n.º 1
0
        public Robot(ADHDGame g, Stage st)
        {
            //init anims
            right = new Animation(new Rectangle(0, 206, Size.X, Size.Y), 9, rate, true);
            up = new Animation(new Rectangle(0, 103, Size.X, Size.Y), 9, rate, true);
            down = new Animation(new Rectangle(0, 0, Size.X, Size.Y), 9, rate, true);
            banjo = new Animation(new Rectangle(0, 618, Size.X, Size.Y), 9, 1.0f / 10.0f, false);
            banjoPlay = new Animation(new Rectangle(0, 721, Size.X, Size.Y), 9, 1.0f / 10.0f, true);
            die = new Animation(new Rectangle(0, 824, Size.X, Size.Y), 9, 1.0f / 10.0f, false);
            pushDown = new Animation(new Rectangle(0, 309, Size.X, Size.Y), 9, 1.0f / 20.0f, false);
            pushUp = new Animation(new Rectangle(0, 412, Size.X, Size.Y), 9, 1.0f / 20.0f, false);
            pushRight = new Animation(new Rectangle(0, 515, Size.X, Size.Y), 9, 1.0f / 20.0f, false);

            tex = g.Content.Load<Texture2D>("robot");
            batch = st.batch;
            stage = st;
            position = Stage.TileToPos(new Point(11, 17));
            currAnim = down;
            currAnim.Stop();
            Dir = Direction.Down;
            velocity = Vector2.Zero;
            flip = SpriteEffects.None;
            game = g;
            SnapToTile();
        }
Ejemplo n.º 2
0
 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);
 }