public void hit() { playFenceHit(); CallBackData nodeData = new CallBackData(0, TimeSpan.Zero); playAnim(nodeData); }
public void hit(PlayerID _id) { PlayerManager.Instance().getPlayer(_id).state = PlayerState.dead; TimeSpan currentTime = Timer.GetCurrentTime(); TimeSpan t_1 = currentTime.Add(new TimeSpan(0, 0, 0, 0, 600)); CallBackData nodeData = new CallBackData(3, TimeSpan.Zero); nodeData.playerID = _id; Timer.Add(t_1, nodeData, PlayerManager.Instance().respawn); }
public void addExplosion(Vector2 _pos, Color _color) { Sprite expSprite = (Sprite)DisplayManager.Instance().getDisplayObj(SpriteEnum.Explosion); Sprite_Proxy expProxy = new Sprite_Proxy(expSprite, (int)_pos.X, (int)_pos.Y, 0.20f, _color); SBNode expBatch = SpriteBatchManager.Instance().getBatch(batchEnum.explosions); expBatch.addDisplayObject(expProxy); TimeSpan currentTime = Timer.GetCurrentTime(); TimeSpan t_1 = currentTime.Add(new TimeSpan(0, 0, 0, 0, 500)); CallBackData nodeData = new CallBackData(3, TimeSpan.Zero); nodeData.spriteRef = expProxy; Timer.Add(t_1, nodeData, removeExplosion); }
private void armed(object obj) { World world = Game1.GameInstance.getWorld(); Ship ship = PlayerManager.Instance().getPlayer(owner).playerShip; Body shipBody = ship.physicsObj.body; var bombShape = new PolygonShape(); bombShape.SetAsBox(5, 5); var fd = new FixtureDef(); fd.shape = bombShape; fd.restitution = 0.0f; fd.friction = 0.0f; fd.density = 0.0001f; fd.userData = this; BodyDef bd = new BodyDef(); bd.fixedRotation = true; bd.type = BodyType.Static; bd.position = orgPos; var body = world.CreateBody(bd); body.CreateFixture(fd); body.SetUserData(this); TimeSpan currentTime = Timer.GetCurrentTime(); TimeSpan t_1 = currentTime.Add(new TimeSpan(0, 0, 0, 0, 0)); CallBackData nodeData = new CallBackData(0, Timer.GetCurrentTime()); bombAnim(nodeData); GameObjManager.Instance().addGameObj(this); PhysicsMan.Instance().addPhysicsObj(this, body); playBombArmedSound(); }
private void armBomb() { TimeSpan currentTime = Timer.GetCurrentTime(); TimeSpan t_1 = currentTime.Add(new TimeSpan(0, 0, 0, 2, 0)); CallBackData nodeData = new CallBackData(0, Timer.GetCurrentTime()); Timer.Add(t_1, nodeData, armed); }