Advertisement
Drowze

Untitled

Jun 2nd, 2015
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.10 KB | None | 0 0
  1. public boolean cliquePertence(int x, int y){
  2.         int maxX=0, minX=9999, maxY=0, minY=9999;
  3.         for(int i = 0; i < vert; i++){
  4.             if(xis[i] > maxX){
  5.                 maxX = xis[i];
  6.             }
  7.             if(yis[i] > maxY){
  8.                 maxY = yis[i];
  9.             }
  10.             if(xis[i] < minX){
  11.                 minX = xis[i];
  12.             }
  13.             if(yis[i] < minY){
  14.                 minY = yis[i];
  15.             }
  16.         }
  17.        
  18.         if((x>minX && x<maxX) && (y>minY && y<maxY)){
  19.             return true;
  20.         }
  21.         else{
  22.             return false;
  23.         }
  24.     }
  25.    
  26.     public void move(int x, int y){
  27.         if(x > this.xis[0]){
  28.             for(int i=0;i<=this.vert;i++){
  29.                 this.xis[i] = this.xis[i]+8;
  30.             }
  31.         }
  32.         if(y > this.yis[0]){
  33.             for(int i=0;i<=this.vert;i++){
  34.                 this.yis[i] = this.yis[i]+8;
  35.             }
  36.         }
  37.         if(x < this.xis[0]){
  38.             for(int i=0;i<=this.vert;i++){
  39.                 this.xis[i] = this.xis[i]-8;
  40.             }
  41.         }
  42.         if(y < this.yis[0]){
  43.             for(int i=0;i<=this.vert;i++){
  44.                 this.yis[i] = this.yis[i]-8;
  45.             }
  46.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement