Esempio n. 1
0
 /**
  * Will set the Infect Status to the Given int
  * Giving a -1 will make this Enemy Permanently Infected
  */
 public void setInfectStatus(int newInfectStatus)
 {
     infectedTimer = newInfectStatus;
     if (infectedTimer > 0)
     {
         infectCloud.visible = true;
         infectBar.visible   = true;
         if (infectBar.getMaxSegments() < infectedTimer)
         {
             infectBar.setMaxSegments(infectedTimer);
             infectBar.setFilledSegments(infectedTimer);
         }
         else
         {
             infectBar.setFilledSegments(infectedTimer);
         }
     }
     else
     {
         infectCloud.visible = false;
         infectBar.visible   = false;
         infectBar.setMaxSegments(1);
         infectedTimer = 0;
     }
 }
Esempio n. 2
0
        //Defialt Constructor
        //Sets image to new
        public Ghost(ResourceLibrary library) : base(library)
        {
            explodeSprite    = (Sprite)library.getResource("GhostLight/GhostLight/resources/explode/explode1.png");
            angrySprite      = (Sprite)library.getResource("GhostLight/GhostLight/resources/angry-ghost1.png");
            complacentSprite = (Sprite)library.getResource("GhostLight/GhostLight/resources/ghost1.png");

            type = InteractableObject.ObjectType.GHOST;
            MakeNotAngry();
            unrevealType();
            health.setMaxSegments(InteractableObject.getDefualthealth(type));
            health.setFilledSegments(health.getMaxSegments());
            score = InteractableObject.getDefualtScore(type);
            base.setInvulnerablility(InteractableObject.getDefualtInvulnerability(type));

            health.setHeight(0.35f);

            explodeTimer.setHeight(0.7f);
            explodeTimer.visible = false;
            explodeTimer.setCenterX(base.getCenterX());
            explodeTimer.setCenterY(health.getCenterY() - (base.getHeight() / 2) + 0.35f);
            explodeTimer.setWidth(base.getWidth());
            explodeTimer.setColor(Color.Yellow);
            explodeTimer.setMaxSegments(angrySprite.getTotalFrames() + complacentSprite.getTotalFrames());
            explodeTimer.setFilledSegments(explodeTimer.getMaxSegments());
        }