public void CreateGroundPoop(float pX, float pY) { PoopGround newGroundPoop = new PoopGround(); _groundPoopLayer.AddChild(newGroundPoop); newGroundPoop.SetXY(pX, pY); }
private void CreateVictim() { string facing = (OurUtils.RandomBool()) ? "up" : "down"; Victim newVictim = new Victim(this, facing); _victimLayer.AddChild(newVictim); newVictim.SetScaleXY(GROUND_LAYER_SCALE, GROUND_LAYER_SCALE); float positionModifier = game.height * ((facing == "up") ? 1 : -1); float positionX = 0; float positionY = Utils.Random(newVictim.height / 2, game.height - newVictim.height / 2) + positionModifier; if (OurUtils.RandomBool()) { //Left boardwalk positionX = Utils.Random(newVictim.width * 2, newVictim.width * 4 - newVictim.width / 2); } else { //Right boardwalk positionX = Utils.Random(game.width - newVictim.width * 4 + newVictim.width / 2, game.width - newVictim.width * 2); } SetPositionVictim(newVictim, positionX, positionY); //newVictim.SetXY(positionX, positionY); //newVictim.SetXY(Utils.Random(newVictim.width * 2, game.width - newVictim.width * 2), Utils.Random(newVictim.height / 2, game.height - newVictim.height / 2) + positionModifier); victimList.Add(newVictim); }
private void CreateRoad(float spawnX = 0.0f, float spawnY = 0.0f) { Road newRoad = new Road(RandomAssets.GetRandomRoad(), this); _floorLayer.AddChild(newRoad); newRoad.SetXY(spawnX, spawnY + ROAD_OFFSET); roadList.Add(newRoad); }
public void CreatePoop() { Projectile newPoop = new Projectile(this); _poopLayer.AddChild(newPoop); newPoop.SetXY(player.x, player.y); poopList.Add(newPoop); }
private void CreateRoad(float spawnX = 0.0f, float spawnY = 0.0f) { Road newRoad = new Road(RandomRoadTile(), this); _floorLayer.AddChild(newRoad); newRoad.SetXY(spawnX, spawnY + 1); roadList.Add(newRoad); }
private void CreateVictim() { Victim newVictim = new Victim(this); _victimLayer.AddChild(newVictim); newVictim.SetScaleXY(GROUND_LAYER_SCALE, GROUND_LAYER_SCALE); newVictim.SetXY(Utils.Random(newVictim.width * 2, game.width - newVictim.width * 2), Utils.Random(newVictim.height / 2, game.height - newVictim.height / 2) - game.height); victimList.Add(newVictim); }
private void CreateVictim() { string facing = (OurUtils.RandomBool()) ? "up" : "down"; Victim newVictim = new Victim(this, facing); _victimLayer.AddChild(newVictim); newVictim.SetScaleXY(GROUND_LAYER_SCALE, GROUND_LAYER_SCALE); float positionModifier = MyGame.OldY() * ((facing == "up") ? 1 : -1); float positionX = 0; float positionY = Utils.Random(newVictim.height / 2, MyGame.OldY() - newVictim.height / 2) + positionModifier; positionX = newVictim.Boardwalk(positionX); newVictim.SetPositionVictim(newVictim, positionX, positionY); victimList.Add(newVictim); }
public Level() : base() { difficulty = new Difficulty(); //Don't ask please. //initialise variables _scrollSpeed = Difficulty.GetScrollSpeed(); _tileSize = Difficulty.GetTileSize(); //Timer initialization _lastUpdatedVictimTime = 0; _lastUpdatedEnemyTime = 0; //Depth _floorLayer = new LevelLayer(); _victimLayer = new LevelLayer(); _poopLayer = new LevelLayer(); _flightLayer = new LevelLayer(); _hudLayer = new LevelLayer(); AddChild(_floorLayer); AddChild(_victimLayer); AddChild(_poopLayer); AddChild(_flightLayer); AddChild(_hudLayer); CreatePlayer(); CreateRoad(); //CreateEnemy(); CreateHUD(); Constipation newdebuff = new Constipation(this); _poopLayer.AddChild(newdebuff); newdebuff.SetXY(Utils.Random(0, game.width), Utils.Random(0, game.height) - game.height); BeakOfSteel newbuff = new BeakOfSteel(this); _poopLayer.AddChild(newbuff); newbuff.SetXY(Utils.Random(0, game.width), Utils.Random(0, game.height) - game.height); }
private void CreateRoad(float spawnX = 0.0f, float spawnY = 0.0f, bool DownLeftOrigin = false) { Road newRoad = new Road(GetAssets.GetRandomRoad(), this); _floorLayer.AddChild(newRoad); if (DownLeftOrigin) { //Not used. newRoad.SetOrigin(0, newRoad.height); } newRoad.SetXY(spawnX, spawnY); roadList.Add(newRoad); _tileCount++; _lastUpdatedRoadsTime = Time.time; }
private void CreatePower <T>() { BasePower newPower; if (typeof(T) == typeof(Food)) { newPower = new Food(this); } else if (typeof(T) == typeof(Laxative)) { newPower = new Laxative(this); } else if (typeof(T) == typeof(SpeedUp)) { newPower = new SpeedUp(this); } else if (typeof(T) == typeof(DoublePoints)) { newPower = new DoublePoints(this); } else if (typeof(T) == typeof(BeakOfSteel)) { newPower = new BeakOfSteel(this); } else if (typeof(T) == typeof(Constipation)) { newPower = new Constipation(this); } else if (typeof(T) == typeof(RottenFood)) { newPower = new RottenFood(this); } else { newPower = new Food(this); } _powerUpLayer.AddChild(newPower); newPower.SetXY(Utils.Random(100, MyGame.OldX() - 100), Utils.Random(newPower.height / 2, MyGame.OldY() - newPower.height / 2) - game.height * 2); }
private void CreatePlayer() { player = new Player(this); _flightLayer.AddChild(player); player.SetXY(game.width / 2, game.height / 2); }
private void CreateHUD() { HUD hud = new HUD(player); _hudLayer.AddChild(hud); }
private void CreatePlayer() { player = new Player(this); _flightLayer.AddChild(player); player.SetXY(MyGame.OldX() / 2, MyGame.OldY() / 2); }