Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean cliquePertence(int x, int y){
- int maxX=0, minX=9999, maxY=0, minY=9999;
- for(int i = 0; i < vert; i++){
- if(xis[i] > maxX){
- maxX = xis[i];
- }
- if(yis[i] > maxY){
- maxY = yis[i];
- }
- if(xis[i] < minX){
- minX = xis[i];
- }
- if(yis[i] < minY){
- minY = yis[i];
- }
- }
- if((x>minX && x<maxX) && (y>minY && y<maxY)){
- return true;
- }
- else{
- return false;
- }
- }
- public void move(int x, int y){
- if(x > this.xis[0]){
- for(int i=0;i<=this.vert;i++){
- this.xis[i] = this.xis[i]+8;
- }
- }
- if(y > this.yis[0]){
- for(int i=0;i<=this.vert;i++){
- this.yis[i] = this.yis[i]+8;
- }
- }
- if(x < this.xis[0]){
- for(int i=0;i<=this.vert;i++){
- this.xis[i] = this.xis[i]-8;
- }
- }
- if(y < this.yis[0]){
- for(int i=0;i<=this.vert;i++){
- this.yis[i] = this.yis[i]-8;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement