public override void LoadSpriteList() { this.titleScreen = new Sprite(800, 450, "Images\\Menu\\LunarLander"); this.cursor = new Sprite(16, 16, "Images\\Misc\\VMenuCursor"); this.cursor.Y = 550; if (Globals.SelectedShip == null) { Enum.Ships selected = Enum.Ships.Type01; if (Globals.SaveSelectedShip == Enum.Ships.Type01.ToString()) { selected = Enum.Ships.Type01; } else if (Globals.SaveSelectedShip == Enum.Ships.Type02.ToString()) { selected = Enum.Ships.Type02; } else if (Globals.SaveSelectedShip == Enum.Ships.Type03.ToString()) { selected = Enum.Ships.Type03; } else if (Globals.SaveSelectedShip == Enum.Ships.Type04.ToString()) { selected = Enum.Ships.Type04; } else if (Globals.SaveSelectedShip == Enum.Ships.Type05.ToString()) { selected = Enum.Ships.Type05; } else if (Globals.SaveSelectedShip == Enum.Ships.Type06.ToString()) { selected = Enum.Ships.Type06; } else if (Globals.SaveSelectedShip == Enum.Ships.Type07.ToString()) { selected = Enum.Ships.Type07; } else if (Globals.SaveSelectedShip == Enum.Ships.Type08.ToString()) { selected = Enum.Ships.Type08; } else if (Globals.SaveSelectedShip == Enum.Ships.Type09.ToString()) { selected = Enum.Ships.Type09; } else if (Globals.SaveSelectedShip == Enum.Ships.TypeX1.ToString()) { selected = Enum.Ships.TypeX1; } Globals.SelectedShip = new SpriteShip(selected, 32, 32); } this.SpriteList = new System.Collections.Generic.List <Sprite>(); this.SpriteList.Add(this.titleScreen); this.SpriteList.Add(this.cursor); this.SpriteList.Add(Globals.SelectedShip); }
private void FormMain_Load(object sender, EventArgs e) { Globals.Stage = new FormStageBase(); Globals.FormMain = this; Globals.ChooseShip = new FormChooseShip(); Globals.ChooseStage = new FormChooseStage(); Globals.FormClear = new FormClear(); Globals.ChooseArea = new FormChooseArea(); Enum.Ships selected = Enum.Ships.Type01; if (Globals.SaveSelectedShip == Enum.Ships.Type01.ToString()) { selected = Enum.Ships.Type01; } else if (Globals.SaveSelectedShip == Enum.Ships.Type02.ToString()) { selected = Enum.Ships.Type02; } else if (Globals.SaveSelectedShip == Enum.Ships.Type03.ToString()) { selected = Enum.Ships.Type03; } else if (Globals.SaveSelectedShip == Enum.Ships.Type04.ToString()) { selected = Enum.Ships.Type04; } else if (Globals.SaveSelectedShip == Enum.Ships.Type05.ToString()) { selected = Enum.Ships.Type05; } else if (Globals.SaveSelectedShip == Enum.Ships.Type06.ToString()) { selected = Enum.Ships.Type06; } else if (Globals.SaveSelectedShip == Enum.Ships.Type07.ToString()) { selected = Enum.Ships.Type07; } else if (Globals.SaveSelectedShip == Enum.Ships.Type08.ToString()) { selected = Enum.Ships.Type08; } else if (Globals.SaveSelectedShip == Enum.Ships.Type09.ToString()) { selected = Enum.Ships.Type09; } else if (Globals.SaveSelectedShip == Enum.Ships.TypeX1.ToString()) { selected = Enum.Ships.TypeX1; } Globals.SelectedShip = LanderFunctions.LoadShipSprites(new ShipSprite(selected, this.pictureBoxLander)); }
public SpriteShip(Enum.Ships ship, int DefaultWidth, int DefaultHeight) : base(DefaultWidth, DefaultHeight, Color.White) { this.Name = ""; this.Special = ""; this.Ship = ship; this.AccelMpS = 0; this.Resistance = 0; this.FuelConsumptionRate = 0.03F; this.Fuel = 0; this.MaxFuel = 40; this.SpriteLeft = new Sprite(32, 32, "Images\\Boosters\\LeftBoost"); this.SpriteRight = new Sprite(32, 32, "Images\\Boosters\\RightBoost"); this.SpriteTop = new Sprite(32, 32, "Images\\Boosters\\TopBoost"); this.SpriteBotton = new Sprite(32, 32, "Images\\Boosters\\BottonBoost"); this.SpriteLeft.Visible = false; this.SpriteRight.Visible = false; this.SpriteTop.Visible = false; this.SpriteBotton.Visible = false; this.TexturesPaths.Add("Images\\Misc\\Explosion"); if (ship == Enum.Ships.Type01) { this.SpecialFuelConsumptionRate = 0.2F; //decrementa a cada Update() this.AccelMpS = 13F; this.Resistance = 3F; this.UseFuelWhenSpecialKeyDown = true; this.Name = "Gaia Saucer"; this.ID = "Type01"; this.Special = "Estabilizador"; this.TexturesPaths[0] = "Images\\Landers\\LanderType01"; this.TexturesPaths.Add("Images\\Landers\\LanderType01Crash"); Globals.UpdateLander = new XNALander.Game1.UpdateForLander(FunctionsShip.UpdateForLander01); } else if (ship == Enum.Ships.Type02) { this.SpecialFuelConsumptionRate = 0.2F; //decrementa a cada Update() this.AccelMpS = 11F; this.Resistance = 4F; this.UseFuelWhenSpecialKeyDown = true; this.Name = "Prometeus Voyager"; this.ID = "Type02"; this.Special = "Propulsor Auxiliar"; this.TexturesPaths[0] = "Images\\Landers\\LanderType02"; this.TexturesPaths.Add("Images\\Landers\\LanderType02Crash"); this.SpriteBotton.TexturesPaths.Add("Images\\Boosters\\AuxRocketBoost"); Globals.UpdateLander = new XNALander.Game1.UpdateForLander(FunctionsShip.UpdateForLander02); } else if (ship == Enum.Ships.Type03) { this.SpecialFuelConsumptionRate = 0.04F; //decrementa a cada Update() this.AccelMpS = 15F; this.Resistance = 3.7F; this.UseFuelWhenSpecialKeyDown = false; this.Name = "Ares Charriot"; this.ID = "Type03"; this.Special = "\r\nPropulsores de Precisão"; this.TexturesPaths[0] = "Images\\Landers\\LanderType03"; this.TexturesPaths.Add("Images\\Landers\\LanderType03Crash"); Globals.UpdateLander = new XNALander.Game1.UpdateForLander(FunctionsShip.UpdateForLander03); } else if (ship == Enum.Ships.Type04) { this.SpecialFuelConsumptionRate = 0.5F; //decrementa a cada Update() this.AccelMpS = 12F; this.Resistance = 4.2F; this.UseFuelWhenSpecialKeyDown = true; this.Name = "Hades Star"; this.ID = "Type04"; this.Special = "Freio Eletro-Magnético"; this.TexturesPaths[0] = "Images\\Landers\\LanderType04"; this.TexturesPaths.Add("Images\\Landers\\LanderType04Crash"); Globals.UpdateLander = new XNALander.Game1.UpdateForLander(FunctionsShip.UpdateForLander04); } else if (ship == Enum.Ships.Type05) { this.SpecialFuelConsumptionRate = 0.15F; //decrementa a cada Update() this.AccelMpS = 17F; this.Resistance = 3.2F; this.UseFuelWhenSpecialKeyDown = true; this.Name = "Hermes Flash Rocket"; this.ID = "Type05"; this.Special = "Estabilização Vertical"; this.TexturesPaths[0] = "Images\\Landers\\LanderType05"; this.TexturesPaths.Add("Images\\Landers\\LanderType05Crash"); this.TexturesPaths.Add("Images\\Landers\\LanderType05_Left"); this.TexturesPaths.Add("Images\\Landers\\LanderType05_Right"); Globals.UpdateLander = new XNALander.Game1.UpdateForLander(FunctionsShip.UpdateForLander05); } else if (ship == Enum.Ships.Type06) { this.SpecialFuelConsumptionRate = 0.4F; //decrementa a cada Update() this.AccelMpS = 16F; this.Resistance = 4.5F; this.UseFuelWhenSpecialKeyDown = true; this.Name = "Poseidon Speedster"; this.ID = "Type06"; this.Special = "Inversão de Forças"; this.TexturesPaths[0] = "Images\\Landers\\LanderType06"; this.TexturesPaths.Add("Images\\Landers\\LanderType06Crash"); Globals.UpdateLander = new XNALander.Game1.UpdateForLander(FunctionsShip.UpdateForLander06); } else if (ship == Enum.Ships.Type07) { this.SpecialFuelConsumptionRate = 0.03F; //decrementa a cada Update() this.AccelMpS = 12F; this.Resistance = 3.8F; this.UseFuelWhenSpecialKeyDown = true; this.Name = "Athena Fortress"; this.ID = "Type07"; this.Special = "Anti-Gravidade"; this.TexturesPaths[0] = "Images\\Landers\\LanderType07"; this.TexturesPaths.Add("Images\\Landers\\LanderType07Crash"); Globals.UpdateLander = new XNALander.Game1.UpdateForLander(FunctionsShip.UpdateForLander07); } else if (ship == Enum.Ships.Type08) { this.AccelMpS = 13F; this.Resistance = 3F; this.UseFuelWhenSpecialKeyDown = true; this.Name = "Soviet LK"; this.ID = "Type08"; this.Special = "Pára-Quedas"; this.TexturesPaths[0] = "Images\\Landers\\LanderType08"; this.TexturesPaths.Add("Images\\Landers\\LanderType08Crash"); this.TexturesPaths.Add("Images\\Misc\\Parachute"); Globals.UpdateLander = new XNALander.Game1.UpdateForLander(FunctionsShip.UpdateForLander08); } else if (ship == Enum.Ships.Type09) { this.AccelMpS = 12F; this.Resistance = 2.7F; this.UseFuelWhenSpecialKeyDown = true; this.Name = "Apollo 11 LM \"Eagle\""; this.ID = "Type09"; this.Special = "Pára-Quedas"; this.TexturesPaths[0] = "Images\\Landers\\LanderType09"; this.TexturesPaths.Add("Images\\Landers\\LanderType09Crash"); this.TexturesPaths.Add("Images\\Misc\\Parachute"); Globals.UpdateLander = new XNALander.Game1.UpdateForLander(FunctionsShip.UpdateForLander09); } else if (ship == Enum.Ships.TypeX1) { this.SpecialFuelConsumptionRate = -0.1F; //decrementa a cada Update() this.AccelMpS = 14F; this.Resistance = 4F; this.UseFuelWhenSpecialKeyDown = true; this.Name = "Samus' Gunship"; this.ID = "TypeX1"; this.Special = "Recarga"; this.TexturesPaths[0] = "Images\\Landers\\LanderTypeX1"; this.TexturesPaths.Add("Images\\Landers\\LanderTypeX1Crash"); Globals.UpdateLander = new XNALander.Game1.UpdateForLander(FunctionsShip.UpdateForLanderX1); } this.Fuel = this.MaxFuel; this.Accel = Functions.ConvertMpSToVelocity(this.AccelMpS, Globals.TimerInterval, Globals.PixelToMeter); this.CurrentAccelLeft = this.Accel / 3; this.CurrentAccelRight = this.Accel / 3; this.CurrentAccelUp = this.Accel / 3; this.CurrentAccelDown = this.Accel / 3; }
public ShipSprite(Enum.Ships ship, PictureBox pictureBoxMain) : base(pictureBoxMain) { this.Name = ""; this.Special = ""; this.ImageCrash = null; this.ImageExplosion = WinFormsLander.Properties.Resources.explosion; this.Ship = ship; this.AccelMpS = 0; this.Resistance = 0; this.FuelConsumptionRate = 0.075F; this.Fuel = 0; this.MaxFuel = 0; if (ship == Enum.Ships.Type01) { this.MaxFuel = 50; this.SpecialFuelConsumptionRate = 0.2F; //decrementa a cada timer.Tick this.AccelMpS = 22F; this.Resistance = 3F; this.UseFuelWhenSpecialKeyPressed = true; this.Name = "Gaia Saucer"; this.ID = "Type01"; this.Special = "Estabilizador"; this.ImageDefault = WinFormsLander.Properties.Resources.LanderType01; this.ImageCrash = WinFormsLander.Properties.Resources.LanderType01Crash; } else if (ship == Enum.Ships.Type02) { this.MaxFuel = 40; this.SpecialFuelConsumptionRate = 0.2F; //decrementa a cada timer.Tick this.AccelMpS = 18F; this.Resistance = 4F; this.UseFuelWhenSpecialKeyPressed = true; this.Name = "Prometeus Voyager"; this.ID = "Type02"; this.Special = "Propulsor Auxiliar"; this.ImageDefault = WinFormsLander.Properties.Resources.LanderType02; this.ImageCrash = WinFormsLander.Properties.Resources.LanderType02Crash; } else if (ship == Enum.Ships.Type03) { this.MaxFuel = 35; this.SpecialFuelConsumptionRate = 0.04F; //decrementa a cada timer.Tick this.AccelMpS = 25F; this.Resistance = 3.7F; this.UseFuelWhenSpecialKeyPressed = false; this.Name = "Ares Charriot"; this.ID = "Type03"; this.Special = "\r\nPropulsores de Precisão"; this.ImageDefault = WinFormsLander.Properties.Resources.LanderType03; this.ImageCrash = WinFormsLander.Properties.Resources.LanderType03Crash; } else if (ship == Enum.Ships.Type04) { this.MaxFuel = 30; this.SpecialFuelConsumptionRate = 0.5F; //decrementa a cada timer.Tick this.AccelMpS = 20F; this.Resistance = 5F; this.UseFuelWhenSpecialKeyPressed = true; this.Name = "Hades Star"; this.ID = "Type04"; this.Special = "Freio Eletro-Magnético"; this.ImageDefault = WinFormsLander.Properties.Resources.LanderType04; this.ImageCrash = WinFormsLander.Properties.Resources.LanderType04Crash; } else if (ship == Enum.Ships.Type05) { this.MaxFuel = 39; this.SpecialFuelConsumptionRate = 0.15F; //decrementa a cada timer.Tick this.AccelMpS = 30F; this.Resistance = 3.2F; this.UseFuelWhenSpecialKeyPressed = true; this.Name = "Hermes Flash Rocket"; this.ID = "Type05"; this.Special = "Estabilização Vertical"; this.ImageDefault = WinFormsLander.Properties.Resources.LanderType05; this.ImageCrash = WinFormsLander.Properties.Resources.LanderType05Crash; } else if (ship == Enum.Ships.Type06) { this.MaxFuel = 40; this.SpecialFuelConsumptionRate = 0.4F; //decrementa a cada timer.Tick this.AccelMpS = 26F; this.Resistance = 4.5F; this.UseFuelWhenSpecialKeyPressed = true; this.Name = "Poseidon Speedster"; this.ID = "Type06"; this.Special = "Inversão de Forças"; this.ImageDefault = WinFormsLander.Properties.Resources.LanderType06; this.ImageCrash = WinFormsLander.Properties.Resources.LanderType06Crash; } else if (ship == Enum.Ships.Type07) { this.MaxFuel = 33; this.SpecialFuelConsumptionRate = 0.03F; //decrementa a cada timer.Tick this.AccelMpS = 19F; this.Resistance = 3.8F; this.UseFuelWhenSpecialKeyPressed = true; this.Name = "Athena Fortress"; this.ID = "Type07"; this.Special = "Anti-Gravidade"; this.ImageDefault = WinFormsLander.Properties.Resources.LanderType07; this.ImageCrash = WinFormsLander.Properties.Resources.LanderType07Crash; } else if (ship == Enum.Ships.Type08) { this.MaxFuel = 25; this.AccelMpS = 21F; this.Resistance = 3F; this.UseFuelWhenSpecialKeyPressed = true; this.Name = "Soviet LK"; this.ID = "Type08"; this.Special = "Pára-Quedas"; this.ImageDefault = WinFormsLander.Properties.Resources.LanderType08; this.ImageCrash = WinFormsLander.Properties.Resources.LanderType08Crash; } else if (ship == Enum.Ships.Type09) { this.MaxFuel = 35; this.AccelMpS = 16F; this.Resistance = 2.7F; this.UseFuelWhenSpecialKeyPressed = true; this.Name = "Apollo 11 LM \"Eagle\""; this.ID = "Type09"; this.Special = "Pára-Quedas"; this.ImageDefault = WinFormsLander.Properties.Resources.LanderType09; this.ImageCrash = WinFormsLander.Properties.Resources.LanderType09Crash; } else if (ship == Enum.Ships.TypeX1) { this.MaxFuel = 25; this.SpecialFuelConsumptionRate = -0.1F; //decrementa a cada timer.Tick this.AccelMpS = 18F; this.Resistance = 5F; this.UseFuelWhenSpecialKeyPressed = true; this.Name = "Samus' Gunship"; this.ID = "TypeX1"; this.Special = "Recarga"; this.ImageDefault = WinFormsLander.Properties.Resources.LanderTypeX1; this.ImageCrash = WinFormsLander.Properties.Resources.LanderTypeX1Crash; } }