// Update is called once per frame void Update() { TIMER -= Time.deltaTime; if (TIMER <= 0) { Destroy(gameObject); GameObject s = LevelArray.createObject(x, y, fire, 0); LevelArray.level[x, y] = new ArrayClass(ArrayTypes.FIRECROSS, s); FireScript f = (FireScript)s.GetComponent("FireScript"); f.remaining = owner.BOMBSTR; f.xDir = 0; f.yDir = 0; owner.BOMBCNT++; } }
// Update is called once per frame void Update() { BomberPlayer p = (BomberPlayer)cc.GetComponent("BomberPlayer"); string button = "Fire1Player" + p.NAME.ToString(); if (Input.GetButtonDown(button)) { int x = Mathf.RoundToInt(cc.transform.position.x) + 5; int y = Mathf.RoundToInt(cc.transform.position.z) + 5; if (p.BOMBCNT > 0 && LevelArray.level[x, y].Type == ArrayTypes.EMPTY) { ; GameObject b = LevelArray.createObject(x, y, bomb, 0); BombScript s = (BombScript)b.GetComponent("BombScript"); s.owner = p; LevelArray.level[x, y] = new ArrayClass(ArrayTypes.BOMB, b); p.BOMBCNT--; } } }
private void createFire(int i, int j, int x, int y, int rot) { if (x + i >= 0 && x + i < 11 && y + j >= 0 && y + j < 11) { if (LevelArray.level[x + i, y + j].Type == ArrayTypes.EMPTY) { GameObject o; if (remaining == 1) { o = fireend; } else { o = fire; } GameObject s = LevelArray.createObject(x + i, y + j, o, rot); LevelArray.level[x + i, y + j] = new ArrayClass(ArrayTypes.FIRE, s); FireScript f = (FireScript)s.GetComponent("FireScript"); f.remaining = remaining - 1; f.xDir = i; f.yDir = j; } else if (LevelArray.level[x + i, y + j].Type == ArrayTypes.FIRE) { GameObject s = LevelArray.createObject(x + i, y + j, firecross, rot); LevelArray.level[x + i, y + j] = new ArrayClass(ArrayTypes.FIRECROSS, s); FireScript f = (FireScript)s.GetComponent("FireScript"); f.remaining = remaining - 1; f.xDir = i; f.yDir = j; } else if (LevelArray.level[x + i, y + j].Type == ArrayTypes.BLOCK) { BlockScript b = (BlockScript)LevelArray.level[x + i, y + j].Obj.GetComponent("BlockScript"); b.hit = true; } else if (LevelArray.level[x + i, y + j].Type == ArrayTypes.BOMB) { BombScript b = (BombScript)LevelArray.level[x + i, y + j].Obj.GetComponent("BombScript"); b.TIMER = 0; } } }
// Update is called once per frame void Update() { if (hit) { TIMER -= Time.deltaTime; if (TIMER <= 0) { Destroy(gameObject); if (LevelArray.rand.Next(0, 4) == 1) { GameObject o = LevelArray.createObject(x, y, power, 0); LevelArray.level[x, y] = new ArrayClass(ArrayTypes.POWERUP, o); } else { LevelArray.level[x, y] = new ArrayClass(ArrayTypes.EMPTY, null); } } } }