private void Save(GameObject gobject) { gobject.UserSizeImage = gobject.GameSprite.PathImage[0] != temppath[0] ? new SizeF(0, 0) : gobject.UserSizeImage; gobject.GameSprite.PathImage[0] = temppath[0]; ISprite isprite = gobject; isprite.LoadSprite(); }
private void Save(GameObject dobject) { dobject.UserSizeImage = dobject.GameSprite.PathImage[0] != temppath[0] ? new SizeF(0, 0) : dobject.UserSizeImage; dobject.GameSprite.PathImage[0] = temppath[0]; dobject.GameSprite.PathImage[1] = temppath[1]; ISprite isprite = dobject; isprite.LoadSprite(); }
private void Save(Shop s) { s.Activated = checkBox1.Checked; s.UserSizeImage = s.GameSprite.PathImage[0] != temppath[0] ? new SizeF(0, 0) : s.UserSizeImage; s.GameSprite.PathImage[0] = temppath[0]; s.GameSprite.PathImage[1] = temppath[1]; ISprite isprite = s; isprite.LoadSprite(); }
private void Save(Chest c) { c.Locked = checkBox1.Checked; c.UserSizeImage = c.GameSprite.PathImage[0] != temppath[0] ? new SizeF(0, 0) : c.UserSizeImage; c.GameSprite.PathImage[0] = temppath[0]; c.GameSprite.PathImage[1] = temppath[1]; ISprite isprite = c; isprite.LoadSprite(); }
public void Activate() { IState istate; foreach (GameObject gobject in CanActivateObject) { istate = (IState)gobject; istate.StateOn(Activated, Inversion); } ISprite isprite = this; isprite.LoadSprite(); }
private void Save(Switcher gswitcher) { gswitcher.Inversion = checkBox2.Checked; gswitcher.Activated = checkBox1.Checked; gswitcher.UserSizeImage = gswitcher.GameSprite.PathImage[0] != temppath[0] ? new SizeF(0, 0) : gswitcher.UserSizeImage; gswitcher.GameSprite.PathImage = temppath; //gswitcher.GameSprite.PathImage[0] = temppath[0]; //gswitcher.GameSprite.PathImage[1] = temppath[1]; ISprite isprite = gswitcher; isprite.LoadSprite(); }
private void Save(DamageObject dobject) { dobject.Destructible = checkBox1.Checked; dobject.Cripple = checkBox2.Checked; dobject.Damage = Convert.ToInt32(textBox1.Text); dobject.UserSizeImage = dobject.GameSprite.PathImage[0] != temppath[0] ? new SizeF(0, 0) : dobject.UserSizeImage; dobject.GameSprite.PathImage[0] = temppath[0]; dobject.GameSprite.PathImage[1] = temppath[1]; ISprite isprite = dobject; isprite.LoadSprite(); }
void IState.StateOn(bool activ, bool inversion) { if (inversion) { Activated = !Activated; } else { Activated = activ; } ISprite isprite = this; isprite.LoadSprite(); }
private void Save(SwitcherPassword gswitcherp) { gswitcherp.Inversion = checkBox2.Checked; gswitcherp.Activated = checkBox1.Checked; gswitcherp.UserSizeImage = gswitcherp.GameSprite.PathImage[0] != temppath[0] ? new SizeF(0, 0) : gswitcherp.UserSizeImage; gswitcherp.GameSprite.PathImage[0] = temppath[0]; gswitcherp.GameSprite.PathImage[1] = temppath[1]; gswitcherp.Password = textBox1.Text; ISprite isprite = gswitcherp; isprite.LoadSprite(); }
void IState.StateOn(bool activ, bool inversion) { if (inversion) { Cripple = !Cripple; } else { Cripple = activ; } ISprite isprite = this; isprite.LoadSprite(); }
private void Save(Door d) { d.Opened = checkBox1.Checked; d.OpenHorizontal = checkBox2.Checked; d.DirectionOpenDoorRight = checkBox3.Checked; d.UserSizeImage = d.GameSprite.PathImage[0] != temppath[0] ? new SizeF(0, 0) : d.UserSizeImage; d.GameSprite.PathImage[0] = temppath[0]; d.GameSprite.PathImage[1] = temppath[1]; ISprite isprite = d; isprite.LoadSprite(); }
private GameObject GetCopyObject(GameObject go) { GameObject tempgobject; using (FileStream fs = new FileStream("tempObject.dat", FileMode.Create)) (new BinaryFormatter()).Serialize(fs, go); using (FileStream fs = new FileStream("tempObject.dat", FileMode.Open)) tempgobject = (GameObject)(new BinaryFormatter()).Deserialize(fs); File.Delete("tempObject.dat"); ISprite isprite = tempgobject; isprite.LoadSprite(); //Загружаем спрайт return(tempgobject); }
public void Open(List <GameObject> listForAddItems) { if (Locked) { return; } if (!Opened) { LoadSprites(Items); listForAddItems.AddRange(Items); Items.Clear(); Opened = true; ISprite isprite = this; isprite.LoadSprite(); } }
private void Save(Item i) { i.PhysBody.Gravity = checkBox1.Checked; i.Life = Convert.ToInt32(textBox1.Text); i.Health = Convert.ToInt32(textBox2.Text); i.Coin = Convert.ToInt32(textBox3.Text); i.Control = Convert.ToInt32(textBox4.Text); i.UserSizeImage = i.GameSprite.PathImage != temppath ? new SizeF(0, 0) : i.UserSizeImage; i.GameSprite.PathImage = temppath; i.UserSizeImage = textBox5.Text != "" && textBox6.Text != "" ? new SizeF(Convert.ToInt32(textBox5.Text), Convert.ToInt32(textBox6.Text)) : new SizeF(0, 0); ISprite isprite = i; isprite.LoadSprite(); }
private void LoadSprites(Level level) { foreach (GameObject g in level.GameObjects) { ISprite isprite = g; isprite.LoadSprite(); } foreach (GameObject g in level.Background) { ISprite isprite = g; isprite.LoadSprite(); } if (level.SpawnHero != null && level.SpawnHero.GameSprite != null) { ISprite isprite = level.SpawnHero; isprite.LoadSprite(); } }
public void SavePoint(Profile p, Character ch, Level level) { CheckSave = true; level.GameObjects.Remove(ch); BinaryFormatter bf = new BinaryFormatter(); using (FileStream fs = new FileStream("TempSave.dat", FileMode.Create)) bf.Serialize(fs, new Save() { Hero = ch, CheckPoint = level }); using (FileStream fs = new FileStream("TempSave.dat", FileMode.Open)) p.SaveGame = (Save)bf.Deserialize(fs); File.Delete("TempSave.dat"); ISprite isprite = this; isprite.LoadSprite(); level.GameObjects.Add(ch); }
private void pictureBox_Click(object sender, MouseEventArgs e) { PictureBox pb = sender as PictureBox; if (e.Button == MouseButtons.Left) { if ((string)pb.Tag == "PointSpawn") { mapmakerform.choicegameobject = new GameObject("PointSpawn") { Position = new RectangleF(new PointF(), new Bitmap(pathes[0][0]).Size), GameSprite = new Sprite(pathes[0]) } } ; if ((string)pb.Tag == "Platform") { mapmakerform.choicegameobject = new GameObject("Platform") { Position = new RectangleF(new PointF(), new Bitmap(pathes[1][0]).Size), GameSprite = new Sprite(pathes[1]) } } ; if ((string)pb.Tag == "ExitDoor") { mapmakerform.choicegameobject = new GameObject("ExitDoor") { Position = new RectangleF(new PointF(), new Bitmap(pathes[2][0]).Size), GameSprite = new Sprite(pathes[2]) } } ; if ((string)pb.Tag == "DamageObject") { mapmakerform.choicegameobject = new DamageObject("DamageObject", false, true, 20) { Position = new RectangleF(new PointF(), new Bitmap(pathes[3][0]).Size), GameSprite = new Sprite(pathes[3]) } } ; if ((string)pb.Tag == "CheckPoint") { mapmakerform.choicegameobject = new PointCheck("CheckPoint") { Position = new RectangleF(new PointF(), new Bitmap(pathes[4][0]).Size), GameSprite = new Sprite(pathes[4]) } } ; if ((string)pb.Tag == "Switcher") { mapmakerform.choicegameobject = new Switcher("Switcher") { Position = new RectangleF(new PointF(), new Bitmap(pathes[5][0]).Size), GameSprite = new Sprite(pathes[5]) } } ; if ((string)pb.Tag == "SwitcherPassword") { mapmakerform.choicegameobject = new SwitcherPassword("SwitcherPassword") { Position = new RectangleF(new PointF(), new Bitmap(pathes[6][0]).Size), GameSprite = new Sprite(pathes[6]) } } ; if ((string)pb.Tag == "Door") { mapmakerform.choicegameobject = new Door("Door") { Position = new RectangleF(new PointF(), new Bitmap(pathes[7][0]).Size), GameSprite = new Sprite(pathes[7]) } } ; if ((string)pb.Tag == "Chest") { mapmakerform.choicegameobject = new Chest("Chest") { Position = new RectangleF(new PointF(), new Bitmap(pathes[8][0]).Size), GameSprite = new Sprite(pathes[8]) } } ; if ((string)pb.Tag == "Life") { mapmakerform.choicegameobject = new Item("Life") { Position = new RectangleF(new PointF(), new Bitmap(pathes[9][0]).Size), GameSprite = new Sprite(pathes[9]) } } ; if ((string)pb.Tag == "Health") { mapmakerform.choicegameobject = new Item("Health") { Position = new RectangleF(new PointF(), new Bitmap(pathes[10][0]).Size), GameSprite = new Sprite(pathes[10]) } } ; if ((string)pb.Tag == "Coin") { mapmakerform.choicegameobject = new Item("Coin") { Position = new RectangleF(new PointF(), new Bitmap(pathes[11][0]).Size), GameSprite = new Sprite(pathes[11]) } } ; if ((string)pb.Tag == "Control") { mapmakerform.choicegameobject = new Item("Control") { Position = new RectangleF(new PointF(), new Bitmap(pathes[12][0]).Size), GameSprite = new Sprite(pathes[12]) } } ; if ((string)pb.Tag == "Ladder") { mapmakerform.choicegameobject = new GameObject("Ladder") { Position = new RectangleF(new PointF(), new Bitmap(pathes[13][0]).Size), GameSprite = new Sprite(pathes[13]) } } ; if ((string)pb.Tag == "Shop") { mapmakerform.choicegameobject = new Shop("Shop") { Position = new RectangleF(new PointF(), new Bitmap(pathes[14][0]).Size), GameSprite = new Sprite(pathes[14]) } } ; if ((string)pb.Tag == "Background") { mapmakerform.choicegameobject = new GameObject("Background") { Position = new RectangleF(new PointF(), new Bitmap(pathes[15][0]).Size), GameSprite = new Sprite(pathes[15]) } } ; if ((string)pb.Tag == "Bot") { mapmakerform.choicegameobject = new Bot("Bot") { Position = new RectangleF(new PointF(), new Bitmap(pathes[16][0]).Size), GameSprite = new Sprite(pathes[16]) } } ; if ((string)pb.Tag == "Trigger") { mapmakerform.choicegameobject = new Trigger("Trigger") { Position = new RectangleF(new PointF(), new Bitmap(pathes[17][0]).Size), GameSprite = new Sprite(pathes[17]) } } ; if ((string)pb.Tag == "Teleport") { mapmakerform.choicegameobject = new Teleport("Teleport") { Position = new RectangleF(new PointF(), new Bitmap(pathes[18][0]).Size), GameSprite = new Sprite(pathes[18]) } } ; //mapmakerform.choicegameobject = new Bot("Bot") { new GameObject("Background") { Position = new RectangleF(new PointF(), new Bitmap(pathes[15][0]).Size), GameSprite = new Sprite(pathes[15]) } ISprite isprite = mapmakerform.choicegameobject; isprite.LoadSprite(); } else { } }