public override void render(GameTime dt, SpriteBatch sb, Matrix matrix) { base.render(dt, sb, matrix); bStamp logo = new bStamp(game.Content.Load<Texture2D>("banana_logo")); sb.DrawString(game.gameFont, "POWERED BY", new Vector2(38, 30), Color.White); logo.render(sb, new Vector2(game.getWith() / (float) 2 - logo.width / (float) 2, 50)); }
public override void init() { base.init(); shadowGraphic = new bStamp(game.Content.Load<Texture2D>("shadow")); shadowGraphic.alpha = 0.4f; graphic = new bSpritemap(game.Content.Load<Texture2D>("hunter"), 16, 24); string[] names = {"s", "sw", "w", "nw", "n", "ne", "e", "se"}; // Add idle and walk animations int[][] frames = new int[][] { new int[] { 0, 1 }, new int[] { 8, 9 }, new int[] { 16, 17 }, new int[] { 24, 25 }, new int[] { 32, 33 }, new int[] { 40, 41 }, new int[] { 48, 49 }, new int[] { 56, 57 } }; int counter = 0; foreach (string name in names) { int[] tempFrames; // Idle animation tempFrames = new int[1]; tempFrames[0] = frames[counter][0]; graphic.add(new bAnim("idle-" + name, tempFrames, 0.0f)); // Walk animation tempFrames = new int[frames[counter].Length]; for (int i = 0; i < tempFrames.Length; i++) tempFrames[tempFrames.Length - i - 1] = frames[counter][i]; graphic.add(new bAnim("walk-" + name, tempFrames, 0.2f)); counter++; } // Add attack animations for (int i = 0; i < frames.Length; i++) { graphic.add(new bAnim("fire-" + names[i], new int[1] { i * 8 + 2 }, 0.2f, false)); } facing = "s"; activeWeapon = new PlayerWeapon(game); graphic.play("idle-s"); // Weapon holding related frameHotspots = parseFrameHotspots(); weaponBehindPlayerDirectionList = new List<string>{"sw", "w", "nw", "n"}; mask.w = 12; mask.h = 9; mask.offsetx = 2; mask.offsety = 15; state = PlayerState.Idle; }
public override void init() { entities.Clear(); entities.Add("solid", new List<bEntity>()); aiPlayer = new AIPlayer(); players = new Ringo[2]; players[0] = new Ringo(50, 70); _add(players[0], "solid"); players[0].controls = aiPlayer.controls; //players[0].controls.down = delegate //{ // //return GamePad.GetState(PlayerIndex.One).ThumbSticks.Left.Y < -bGame.input.getJoystickDeadzone(); // return bGame.input.check(Keys.Up); //}; //players[0].controls.up = delegate //{ // //return GamePad.GetState(PlayerIndex.One).ThumbSticks.Left.Y > bGame.input.getJoystickDeadzone(); // return bGame.input.check(Keys.Down); //}; players[1] = new Ringo(90, 70, Ringo.Dir.Left); players[1].controls.A = delegate { return bGame.input.pressed("A2"); }; players[1].controls.B = delegate { return bGame.input.pressed("B2"); }; players[1].controls.up = delegate { //return GamePad.GetState(PlayerIndex.One).ThumbSticks.Left.Y < -bGame.input.getJoystickDeadzone(); return bGame.input.check(Keys.Up); }; players[1].controls.down = delegate { //return GamePad.GetState(PlayerIndex.One).ThumbSticks.Left.Y > bGame.input.getJoystickDeadzone(); return bGame.input.check(Keys.Down); }; players[1].controls.left = delegate { return bGame.input.check(Keys.Left); }; players[1].controls.right = delegate { return bGame.input.check(Keys.Right); }; _add(players[1], "solid"); players[1].life = 10; players[1].playerNo = 1; bg = new bStamp(game.Content.Load<Texture2D>("ring_bg")); fg = new bStamp(game.Content.Load<Texture2D>("ring_fg")); int wallw = 20; bEntity wall_1 = new bEntity(-wallw, 0); wall_1.mask.w = wallw; wall_1.mask.h = game.getHeight(); bEntity wall_2 = new bEntity(game.getWith(), 0); wall_2.mask.w = wallw; wall_2.mask.h = game.getHeight(); _add(wall_1, "solid"); _add(wall_2, "solid"); MediaPlayer.Play((game as Rin).bgSong); }
public override void init() { base.init(); mask.w = 16; mask.h = 16; graphic = new bStamp(game.Content.Load<Texture2D>("block")); vspeed = 0; speed = 0; gravity = 0.5f; statusString = ""; }
public override void init() { base.init(); graphic = new bSpritemap(game.Content.Load<Texture2D>("npc"), 16, 24); graphic.add(new bAnim("idle", new int[] { 0, 1 }, 0.3f)); graphic.play("idle"); shadowGraphic = new bStamp(game.Content.Load<Texture2D>("shadow")); shadowGraphic.alpha = 0.4f; /*mask.offsety = 8; mask.w = 16; mask.h = 16;*/ mask.w = 12; mask.h = 9; mask.offsetx = 2; mask.offsety = 15; solid = true; depth = -(y + mask.offsety); }
public override void init() { base.init(); graphic = new bStamp(game.Content.Load<Texture2D>("node")); }