public void Reset() { state = State.standing; shooting = false; location.X = originalLocation.X; location.Y = originalLocation.Y - drawRect.Height; netMovement = new Rectangle(0, 0, 0, 0); isAlive = false; direction = SpriteEffects.None; health = Constant.MAX_HEALTH; killTime = 0; powerUp = null; madePowerUp = false; poseFrame = 0; poseTime = 0; poseAnimateDir = 1; Guid guid = Guid.NewGuid(); uniqueID = guid.ToString(); SubReset(); }
public AbstractPickup GetPowerUp() { AbstractPickup p = powerUp; powerUp = null; return(p); }
public void Update(Rioman player, AbstractBullet[] rioBullets, double deltaTime, Viewport viewport) { if (isAlive) { StatusBar.SetBossHealth(health); SubUpdate(player, rioBullets, deltaTime, viewport); CheckHit(player, rioBullets); } if (!isAlive && health <= 0) { StatusBar.SetBossHealth(health); killTime += deltaTime; if (killTime > 5 && !madePowerUp) { madePowerUp = true; powerUp = new PowerUp(type - 9, originalLocation.X + netMovement.X, originalLocation.Y + netMovement.Y); } if (wasAlive) { Audio.PlayKillBoss(); } } wasAlive = isAlive; }
public bool storePickup(AbstractPickup pickup) { for (int i = 0; i < pickups.Length; i++) { if(pickups[i] == null) //if the slot is empty { //store the pickup in the slot and stop looking for a slot to store it pickups[i] = pickup; return true; //successfully stored the pickup } } return false; //if it reached here, it means no slot was free, so it could not be stored! }
public bool storePickup(AbstractPickup pickup) { for (int i = 0; i < pickups.Length; i++) { if (pickups[i] == null) //if the slot is empty { //store the pickup in the slot and stop looking for a slot to store it pickups[i] = pickup; return(true); //successfully stored the pickup } } return(false); //if it reached here, it means no slot was free, so it could not be stored! }
protected virtual void OnTriggerEnter(Collider other) { GameObject go = GameObjectUtilities.GetGameObject(other); if (go.CompareTag("Pickup")) { AbstractPickup pickup = go.GetComponent <AbstractPickup>(); if (null == pickup) { return; } pickup.ExecutePickup(this); Destroy(go); } }
public PickupReference(AbstractPickup abstractPickup) { Effect = abstractPickup; TimeLeft = Effect.EffectTime; }