示例#1
0
文件: Menu.cs 项目: maestun/wonderboy
 public Menu(string title, Point cursor, Point back)
 {
     GameTexture texture = new GameTexture("border.bmp", new Size(8, 8), TextureDisposePolicy.DisposeOnSceneChange);
     this.menuTexture = new GameTexture("cursor.bmp", new Size(0x10, 0x10), TextureDisposePolicy.DisposeOnSceneChange);
     this.menuOptions = new List<MenuOption>();
     this.cursorTxt = cursor;
     this.backTxt = back;
     this.rec = new Rectangle((GameEngine.ScreenWidth - 0x100) / 2, (GameEngine.ScreenHeight - 0xc0) / 2, 0x100, 0xc0);
     this.rec.Width /= 0x10;
     this.rec.Height /= 0x10;
     this.borders[0] = new Border(new int[] { -2, -19, -28, -16 }, new Point(this.rec.X + 0x20, this.rec.Y + 0x18), texture);
     this.borders[1] = new Border(new int[] { -4, -3, -14, -3, -13 }, new Point(this.rec.X + 160, this.rec.Y + 0x18), texture);
     this.borders[2] = new Border(new int[] { 4 }, new Point(this.rec.X + 0x60, this.rec.Y + 0x18), texture);
     this.menuTitle = new GameText(title);
     this.menuTitle.Location = (PointF) new Point(0x4b, 0x31);
     this.menuTitle.Shadow = true;
     this.transformText = new GameText("HU MAN");
     this.transformText.Location = (PointF) new Point(70, 0x40);
     this.transformText.Shadow = true;
     this.apText = new GameText("");
     this.apText.NoLeadingZeroes = true;
     this.apText.Location = (PointF) new Point(0xa8, 0x39);
     this.apText.Shadow = true;
     this.cpText = new GameText("");
     this.cpText.NoLeadingZeroes = true;
     this.cpText.Location = (PointF) new Point(0xa8, 0x43);
     this.cpText.Shadow = true;
     this.dpText = new GameText("");
     this.dpText.NoLeadingZeroes = true;
     this.dpText.Location = (PointF) new Point(0xda, 0x39);
     this.dpText.Shadow = true;
 }
示例#2
0
 public CureItem(int p_price, Point p_location)
 {
     this.price = p_price * GameEngine.Game.GetPlayerStats().Hearts;
     this.location = p_location;
     this.cureText = new GameText("CURE");
     this.cureText.Shadow = true;
     this.cureText.Location = (PointF) new Point(this.location.X + 0x10, this.location.Y + 8);
 }
示例#3
0
 public HelpFooter()
 {
     string text = ("SELECT: " + GameEngine.Framework.KeyToName(GameEngine.Framework.GetKeyMapping(GameKey.Jump))) + "        CANCEL: " + GameEngine.Framework.KeyToName(GameEngine.Framework.GetKeyMapping(GameKey.Attack));
     this.helpText = new GameText(text);
     this.helpText.Shadow = false;
     this.helpText.TextColor = Color.White;
     this.helpText.CenterText(0, 320);
     this.helpText.Y = 224f;
 }
示例#4
0
 public void Init(Point icon, string topText, string bottomText, Point position, int offSet)
 {
     this.iconTxt = icon;
     this.topLine = new GameText(topText);
     this.bottomLine = new GameText(bottomText);
     this.cursorPosition = position;
     this.topLine.Location = (PointF) new Point(this.cursorPosition.X + offSet, this.cursorPosition.Y);
     this.bottomLine.Location = (PointF) new Point(this.cursorPosition.X + offSet, this.cursorPosition.Y + 9);
 }
示例#5
0
 public UsableShopItem(ObjectType p_item, int p_price, Point p_location, int p_max)
 {
     this.location = p_location;
     this.itemName = new GameText("X");
     this.itemName.Shadow = true;
     this.itemName.Location = (PointF) new Point(this.location.X + 0x10, this.location.Y + 8);
     this.item = p_item;
     this.price = p_price;
     this.max = p_max;
     this.CheckCanBuy();
 }
示例#6
0
 public StatusBar()
 {
     this.coins.Shadow = true;
     this.coins.Location = (PointF) new Point(250, 2);
     this.coinsAmount = new GameText("999");
     this.coinsAmount.Shadow = true;
     this.coinsAmount.Location = (PointF) new Point(0x113, 11);
     this.medicineAmount = new GameText("0");
     this.medicineAmount.Shadow = true;
     this.medicineAmount.Location = (PointF) new Point(this.medLoc.X + 0x12, this.medLoc.Y + 8);
     this.rec = new RectangleF(0f, 0f, (float) ((GameEngine.ScreenWidth / 2) + 0x20), 20f);
     this.lastHeartRec = new Rectangle(new Point(0, 0), new Size(0x10, 0x10));
 }
示例#7
0
 public EndingScene()
 {
     base.drawStatusBar = false;
     this.playerName = new GameText("HARVEY BIRDMAN");
     this.playerName.Shadow = false;
     this.playerName.TextColor = Color.White;
     this.playerName.Y = 32f;
     this.bossNameTop = new GameText("VAMPIRE");
     this.bossNameTop.Shadow = false;
     this.bossNameTop.TextColor = Color.White;
     this.bossNameTop.Y = 32f;
     this.bossNameBottom = new GameText("VAMPIRE");
     this.bossNameBottom.Shadow = false;
     this.bossNameBottom.TextColor = Color.White;
     this.bossNameBottom.Y = 48f;
     this.blackTexture = new GameTexture("border.bmp", new Size(8, 8), TextureDisposePolicy.DisposeOnSceneChange);
     this.blackRec = new Rectangle[2];
     this.blackRec[0].Height = 0;
     this.blackRec[1].Height = 0;
     base.BackColor = Color.FromArgb(0, 0xde, 0xff);
     GameTexture texture = new GameTexture("layercloud.bmp", new Size(0x1ca, 160), TextureDisposePolicy.DisposeOnSceneChange);
     this.cloudLayer = new ScrollLayer(texture, texture.getCell(0, 0), true);
     this.cloudLayer.Y = 16f;
     this.cloudLayer.ScrollSpeed = -0.5f;
     GameTexture texture2 = new GameTexture("layercastle.bmp", new Size(0x1ca, 160), TextureDisposePolicy.DisposeOnSceneChange);
     this.castleLayer = new ScrollLayer(texture2, texture2.getCell(0, 0), false);
     this.castleLayer.Y = 16f;
     this.castleLayer.X = 400f;
     this.castleLayer.ScrollSpeed = -1f;
     this.waterLayer = new ScrollLayer[4];
     for (int i = 0; i < 4; i++)
     {
         GameTexture texture3 = new GameTexture("layerwater.bmp", new Size(0x20, 0x10), TextureDisposePolicy.DisposeOnSceneChange);
         this.waterLayer[i] = new ScrollLayer(texture3, texture3.getCell(i, 0), true);
         this.waterLayer[i].Y = 0xa5 + (0x10 * i);
         this.waterLayer[i].ScrollSpeed = -(i + 1);
     }
     GameTexture texture4 = new GameTexture("layergrass.bmp", new Size(350, 0x40), TextureDisposePolicy.DisposeOnSceneChange);
     this.grassLayer = new ScrollLayer(texture4, texture4.getCell(0, 0), true);
     this.grassLayer.Y = 176f;
     this.grassLayer.ScrollSpeed = -5f;
 }
示例#8
0
 public EquipableShopItem(EquipableItem p_item, int p_price, Point p_location)
 {
     this.item = p_item;
     this.price = p_price;
     this.icon = this.item.Icon;
     if (p_item.State == EquipItemState.NotFound)
     {
         string[] twoPartName = this.item.GetTwoPartName();
         this.itemName = new GameText(twoPartName[0]);
         this.itemName.Shadow = true;
         this.itemName2 = new GameText(twoPartName[1]);
         this.itemName2.Shadow = true;
     }
     else
     {
         this.itemName = new GameText("SOLD OUT");
         this.itemName.Shadow = true;
         this.itemName2 = new GameText(" ");
         this.itemName2.Shadow = true;
     }
     this.location = p_location;
     this.itemName.Location = (PointF) new Point(this.location.X + 0x10, this.location.Y + 8);
     this.itemName2.Location = (PointF) new Point(this.location.X + 0x10, this.location.Y + 0x10);
 }
示例#9
0
文件: Shop.cs 项目: maestun/wonderboy
 public Shop(string shopName)
 {
     this.rec.Width /= 8;
     this.rec.Height /= 8;
     this.pigRec = new Rectangle(this.rec.X + 20, this.rec.Y + 12, 0x54, 0x44);
     this.nameRec = new Rectangle(this.rec.X + 20, this.rec.Y + 0x5c, 0x58, 0x10);
     this.priceRec = new Rectangle(this.rec.X + 20, this.rec.Y + 0x84, 0x58, 40);
     this.itemRec = new Rectangle(this.rec.X + 120, this.rec.Y + 8, 0x80, 0x9c);
     this.pigRecBox = new Box(this.pigRec, this.shopTexture);
     this.nameBox = new Box(this.nameRec, this.shopTexture);
     this.itemBox = new Box(this.itemRec, this.shopTexture);
     this.priceBox = new Box(this.priceRec, this.shopTexture);
     this.priceBorder = new Border(new int[] { -1, -2, -9, -2, -9 }, new Point(this.priceRec.X + 14, this.priceRec.Y + 12), this.shopTexture);
     this.name = new GameText("SHOPPING");
     this.name.Shadow = true;
     this.name.Location = (PointF) new Point(this.nameRec.X + 6, this.nameRec.Y + 6);
     this.price = new GameText("PRICE");
     this.price.Location = (PointF) new Point(this.priceRec.X + 6, this.priceRec.Y + 6);
     this.price.Shadow = true;
     this.priceVal = new GameText("0000");
     this.priceVal.Location = (PointF) new Point(this.priceRec.X + 0x10, this.priceRec.Y + 0x16);
     this.priceVal.Shadow = true;
     this.LoadShop(shopName);
 }
示例#10
0
 public SectionHeader(string p_text, int p_xPos, int p_yPos, bool isLast)
 {
     this.last = isLast;
     this.text = new GameText(p_text);
     this.text.Shadow = false;
     this.text.TextColor = Color.White;
     this.width = 8 * p_text.Length;
     this.text.CenterText(0, 320);
     this.text.Y = p_yPos;
 }
示例#11
0
 public NamedObject(ObjectType p_obj, string p_text)
 {
     this.obj = ObjectFactory.CreateObjectOfType(p_obj);
     this.obj.SetBehavior(new DemoBehavior(this.obj));
     this.obj.Solid = false;
     this.obj.StopsAtBoundries = false;
     this.obj.StopsAtSides = false;
     this.obj.XSpeed.SetSpeed((float) 0f);
     this.obj.YSpeed.SetSpeed((float) 0f);
     if (this.obj.CurAnimHitType == AnimHitType.Ghost)
     {
         this.obj.CurrentAnimation = AnimType.Attacking;
     }
     this.obj.Update(null, PointF.Empty, true);
     this.text = new GameText(p_text);
     this.text.Shadow = false;
     this.text.TextColor = Color.White;
 }
示例#12
0
文件: Door.cs 项目: maestun/wonderboy
 private void UpdateStoneText()
 {
     if (this.doorType == DoorType.StoneLocked)
     {
         this.stoneText = new GameText(this.destinationDoor.ToString("00"));
         this.stoneText.NoLeadingZeroes = false;
         this.stoneText.TextColor = Color.White;
     }
 }