Examples of NELandscapeGraphic


Examples of de.nameless.graphicEngine.lib.NELandscapeGraphic

  }

  @Override
  public Vector<NEabstractGraphicObject> getOwnGfx() {
    //gfx = new Vector<NEabstractGraphicObject>();
    NELandscapeGraphic Q;   
 
    grid = new NELineQuad();
    grid.x = this.x;
    grid.y = this.y; 
    grid.layer = 10;
    grid.setColor(1f, 1f, 0.5f, 0.1f);
    this.showGrid.add(new NEVisibleLable(grid))
    gfx.add(grid);
   
    reachableMark = new NEQuad();
    reachableMark.setTexture("Selection.tga");   
    reachableMark.layer = 2;
    reachableMark.x = this.x;
    reachableMark.y = this.y;
    reachableMark.setColor(0.5f, 0.5f, 1, 0.5f);
    reachable = new NEVisibleLable(reachableMark)
   
   
   
    gfx.add(reachableMark);
    switch (typ) {

    case FOREST:
      Q = new NELandscapeGraphic("Grass", 2,4);
      Q.randomRotate90X();
      Q.x = this.x;
      Q.y = this.y; 
      Q.layer = 1;
     
      gfx.add(Q);     
     
      Q = new NELandscapeGraphic("Forest", 2*1.3f, 2);
      Q.x = this.x;
      Q.y = this.y;     
      Q.layer = 3;
      Q.xAngel = 90;
      gfx.add(Q);       
      break;

    case GRASS:

      Q = new NELandscapeGraphic("Grass", 2,4);
      Q.randomRotate90X();
      Q.x = this.x;
      Q.y = this.y;     
      Q.layer = 1;   
      gfx.add(Q);     
      break;
     
    case RIVE:
     
      Q = new NELandscapeGraphic("Grass", 2,4);
      Q.randomRotate90X();
      Q.x = this.x;
      Q.y = this.y; 
      Q.layer = -10;   
      gfx.add(Q)
     
      NEWater W = new NEWater();
      W.x = this.x;
      W.y = this.y; 
      W.layer = -9;
      if(!WaterAnimationStarted){
        W.addAnimation(new NEflowAnimation());
        WaterAnimationStarted = true;
      }
     
      NEWater W1 = new NEWater();
      W1.x = this.x;
      W1.y = this.y; 
      W1.layer = -8
      W1.xAngel = 180;
     
      NEWater W2 = new NEWater();
      W2.x = this.x;
      W2.y = this.y; 
      W2.layer = -7
      W2.xAngel = 90;
     
      NEWater W3 = new NEWater();
      W3.x = this.x;
      W3.y = this.y; 
      W3.layer = -6
      W3.xAngel = 270;
     
     
      Q = new NELandscapeGraphic("River", 2);     
      Q.x = this.x;
      Q.y = this.y; 
      Q.layer = 1;
     
      int n = 0;
     
      if(this.North != null) {
        if (this.North.typ == RIVEn++;
      } else  {
        n++;
      }
     
      if(this.East != null) {
        if (this.East.typ == RIVEn++;
      } else  {
        n++;
      }
     
      if(this.South != null) {
        if (this.South.typ == RIVEn++;
      } else  {
        n++;
      }
     
      if(this.West != null) {
        if (this.West.typ == RIVEn++;
      } else  {
        n++;
      }
     
      Q.enableSprites(3, 3, 0, 0);
     
      switch(n){
      case 0:
        Q.setSprite(2, 0);
        break;
       
      case 1:
        if(openedTo(North, RIVE)){
          Q.setSprite(2, 1);
          Q.xAngel = 270;
        } else if(openedTo(East, RIVE)){
          Q.setSprite(2, 1);
          Q.xAngel = 180;
        }else if(openedTo(South, RIVE)){
          Q.setSprite(2, 1);
          Q.xAngel = 90;
        }else if(openedTo(West, RIVE)){
          Q.setSprite(2, 1);
          Q.xAngel = 0;
        }
        break;
       
      case 2:
        if(openedTo(West, RIVE) && openedTo(East, RIVE)){
          Q.setSprite(1, 1);
        } else if(openedTo(North, RIVE) && openedTo(South, RIVE)){
          Q.setSprite(1, 1);
          Q.xAngel = 0;         
        }
       
        if(openedTo(West, RIVE) && openedTo(North, RIVE)){
          Q.setSprite(1, 0);
          Q.xAngel = 0;
        } else if(openedTo(North, RIVE) && openedTo(East, RIVE)){
          Q.setSprite(1, 0);
          Q.xAngel = 270;
        }else if(openedTo(South, RIVE) && openedTo(East, RIVE)){
          Q.setSprite(1, 0);
          Q.xAngel = 180;
        } else if(openedTo(South, RIVE) && openedTo(West, RIVE)){
          Q.setSprite(1, 0);
          Q.xAngel = 90;
        }
       
        break;
       
      case 3
       
        if(!openedTo(North, RIVE)){
          Q.setSprite(0, 0);
          Q.xAngel = 270;
        } else if(!openedTo(East, RIVE)){
          Q.setSprite(0, 0);
          Q.xAngel = 180;
        }else if(!openedTo(South, RIVE)){
          Q.setSprite(0, 0);
          Q.xAngel = 90;
        }else if(!openedTo(West, RIVE)){
          Q.setSprite(0, 0);
          Q.xAngel = 0;
        }
       
        break;
       
      case 4:
        Q.setSprite(0, 1);
        break;
      }     
     
     
      gfx.add(Q);       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.