public Bullet(Texture2D txt, World _world, TipTela _type = TipTela.Bullet_1) : base(txt) { _timer = 0; texture = txt; //_Size = new Vector2(0.2f, 0.2f); origin = new Vector2(texture.Width / 2, texture.Height / 2); body = BodyConstructor.CreateBody(_type, _world, this, 0.02f); }
public ZombieS(Texture2D txt, World _world, TipTela _type = TipTela.Mob_1) : base(txt) { player_ID = ""; distance_Min = 2000; texture = txt; _Size = new Vector2(0.5f, 0.5f); speed_rotation = 4f; origin = new Vector2(texture.Width / 2, texture.Height / 2); //посчитать размеры офк норм для зомби body = BodyConstructor.CreateBody(_type, _world, this, 0.5f); }
public СannonS(Texture2D txt, Texture2D txtBullet, World _world, TipTela _type = TipTela.Mob_1) : base(txt) { distance_Min = 1500; texture = txt; pre_shot_timer = 0; _Size = new Vector2(0.8f, 0.8f); speed_rotation = 4f; origin = new Vector2(texture.Width / 2, texture.Height / 2); body = BodyConstructor.CreateBody(_type, _world, this, 0.5f); bullet = new Bullet(txtBullet, _world); }
public PlayerS(Texture2D txt, World _world) : base(txt) { buttons = new PressedButtons(); nearobj = new List <ObjectS>(); texture = txt; _Size = new Vector2(0.5f, 0.5f); //_SizeZ = new Vector2(0.5f, 0.5f); speed_rotation = 4f; origin = new Vector2(texture.Width / 2, texture.Height / 2); //пересчетать для плеера на 512х512 и поменять его размер body = BodyConstructor.CreateBody(TipTela.Player_1, _world, null, 1f); RandPos(); }
public LobbyState(Game1 game, GraphicsDevice graphicsDevice, ContentManager content) : base(game, graphicsDevice, content) { // mob generation game.defColor = Color.CornflowerBlue; for (int i = 0; i < 50; i++) { ZombieS tmpZ = new ZombieS(_game.textures.Zombie_1, _game._world); tmpZ.RandPos(); _game.zombielist.Add(tmpZ); } for (int i = 0; i < 200; i++) { ObjectS tmpO = new ObjectS(_game.textures.Box_2); Thread.Sleep(20); Random random = new Random(); int x = random.Next(-7400, 7400); int y = random.Next(-1100 * 6, 1100 * 6); //int size = random.Next(5,80); int size = 30; int rotation = random.Next(0, 359); tmpO.body = BodyConstructor.CreateBody(TipTela.Box_2, _game._world, null, size * 0.1f, (float)rotation); tmpO._Size = new Vector2(size * 0.1f, size * 0.1f); tmpO.body.Position = new Vector2(ConvertUnits.ToSimUnits(x), ConvertUnits.ToSimUnits(y)); _game.solidlist.Add(tmpO); } for (int i = 0; i < 20; i++) { СannonS tmpC = new СannonS(_game.textures.Сannon_1, _game.textures.Bullet_Сannon, _game._world); tmpC.body = BodyConstructor.CreateBody(TipTela.Mob_2, _game._world, tmpC, 0.2f); //tmpC.body.Position = new Vector2(15f, 5f*i); tmpC.RandPos(); _game.Cannonlist.Add(tmpC); } //map generation game.defColor = Color.Red; }