亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? enemy.java

?? 吃豆子游戲,java實(shí)現(xiàn),功能較豐富,游戲性較強(qiáng)
?? JAVA
字號(hào):
import java.awt.*;

public class enemy{
	private int xPos;
	private int yPos;
	private int xVPos;
	private int yVPos;
	private int direction;
	private boolean alarm;
	private int alarmTime;
	private boolean ghostMode;
	private Rectangle Enemy;
	private int speed;
	private int interval;
	private int Colour;
	private int AI_time1, AI_time2;
	private int lefttime, uptime, righttime, downtime;
	private int gameFlow;
	private boolean ghost;
	private boolean canMoveUp, canMoveDown, canMoveLeft,canMoveRight;
	private boolean cantGoAnyWhere;
	private int prisonTime;
	private boolean stop;

	public enemy(int a, int b, int c, boolean cantGoAnyWhere, int prisonTime){
		xPos = a;
		yPos = b;
		xVPos = xPos;
		yVPos = yVPos;
		direction = 3;
		speed = 3;
		interval = 63 + 21*((int)(Math.random()*10));
		AI_time1 = 0;
		Colour = c;
		this.prisonTime = prisonTime;
		this.cantGoAnyWhere = cantGoAnyWhere;
		Enemy = new Rectangle(xPos -10, yPos - 10, 21, 21);
	}

	public void move(int a, int b, wall[] Wall){
		AI_time1++;
		AI_time2++;
		uptime++;
		downtime++;
		lefttime++;
		righttime++;
		gameFlow++;
		if(alarm)
			alarmTime++;
		boolean changeMovement = false;

		if(cantGoAnyWhere)
			prisonTime++;

		if(alarm)
			speed = 1;
		else
			speed = 2;

		if(alarmTime >= 330){
			alarmTime = 0;
			alarm = false;
		}


		canMoveUp = true;
		canMoveDown = true;
		canMoveLeft = true;
		canMoveRight = true;

		Rectangle R;
		Rectangle UP = new Rectangle(xVPos - 10, yVPos - 10 - speed, 21, 21);
		Rectangle DOWN = new Rectangle(xVPos - 10, yVPos - 10 + speed, 21, 21);
		Rectangle LEFT = new Rectangle(xVPos - 10 - speed, yVPos - 10, 21, 21);
		Rectangle RIGHT = new Rectangle(xVPos - 10 + speed, yVPos - 10, 21, 21);

		for(int i = 0; i < Wall.length; i++){
			R = new Rectangle(Wall[i].getxPos() - 10, Wall[i].getyPos() - 10, 21, 21);
			if(R.intersects(UP))
				canMoveUp = false;
			if(prisonTime < 231){
				if(R.intersects(UP) && direction == 0){
					yPos = yVPos;
					changeMovement = true;
				}
			}

			if(!(ghost && (yVPos >= 189 && yVPos < 231 && xVPos == 210))){
				if(R.intersects(DOWN))
					canMoveDown = false;
				if(R.intersects(DOWN) && direction == 1){
					yPos = yVPos;
					changeMovement = true;
				}
			}

			if(R.intersects(LEFT))
				canMoveLeft = false;
			if(R.intersects(LEFT) && direction == 2){
				xPos = xVPos;
				changeMovement = true;
			}

			if(R.intersects(RIGHT))
				canMoveRight = false;
			if(R.intersects(RIGHT) && direction == 3){
				xPos = xVPos;
				changeMovement = true;
			}
		}

		interval-=speed;
		if(interval <=0)
			changeMovement = true;


		int u = (int)(Math.random()*4);
		if(canMoveUp && direction != 1 && AI_time1 > 10 && u == 0){
			direction = 0;
			xPos = xVPos;
			AI_time1 = 0;
		}
		if(canMoveDown && direction != 0 && AI_time1 > 10 && u == 1){
			direction = 1;
			xPos = xVPos;
			AI_time1 = 0;
		}
		if(canMoveLeft && direction != 3 && AI_time1 > 10 && u == 2){
			direction = 2;
			xPos = xVPos;
			AI_time1 = 0;
		}
		if(canMoveRight && direction != 2 && AI_time1 > 10 && u == 3){
			direction = 3;
			xPos = xVPos;
			AI_time1 = 0;
		}

		if(!alarm && !cantGoAnyWhere){
			if(AI_time2 > 99){
				if(canMoveUp && yPos > b && AI_time2 > 99){
					direction = 0;
					xPos = xVPos;
					AI_time2 = 0;
				}
				if(canMoveDown && yPos < b && AI_time2 > 99){
					direction = 1;
					xPos = xVPos;
					AI_time2 = 0;
				}
				if(canMoveLeft && xPos > a && AI_time2 > 99){
					direction = 2;
					yPos = yVPos;
					AI_time2 = 0;
				}
				if(canMoveRight && xPos < a && AI_time2 > 99){
					direction = 3;
					yPos = yVPos;
					AI_time2 = 0;
				}
			}
		}
		if(alarm){
			if(AI_time2 > 99){
				if(canMoveDown && yPos > b && AI_time2 > 99){
					direction = 1;
					xPos = xVPos;
					AI_time2 = 0;
				}
				if(canMoveUp && yPos < b && AI_time2 > 99){
					direction = 0;
					xPos = xVPos;
					AI_time2 = 0;
				}
				if(canMoveRight && xPos > a && AI_time2 > 99){
					direction = 3;
					yPos = yVPos;
					AI_time2 = 0;
				}
				if(canMoveLeft && xPos < a && AI_time2 > 99){
					direction = 2;
					yPos = yVPos;
					AI_time2 = 0;
				}
			}
		}
		if(ghost){
			a = 210;
			b = 189;
			speed = 4;
			alarm = false;
			alarmTime = 0;
			if(AI_time2 > 99){
				if(canMoveUp && yPos > b && AI_time2 > 99){
					direction = 0;
					xPos = xVPos;
					AI_time2 = 0;
				}
				if(canMoveDown && yPos < b && AI_time2 > 99){
					direction = 1;
					xPos = xVPos;
					AI_time2 = 0;
				}
				if(canMoveLeft && xPos > a && AI_time2 > 99){
					direction = 2;
					yPos = yVPos;
					AI_time2 = 0;
				}
				if(canMoveRight && xPos < a && AI_time2 > 99){
					direction = 3;
					yPos = yVPos;
					AI_time2 = 0;
				}
			}
		}

		if(changeMovement){
			for(;;){
				u = (int)(Math.random()*2);
				if(direction == 0 || direction == 1){
					if(u == 0){
						if(canMoveLeft)
							direction = 2;
	           	        if(canMoveRight)
							direction = 3;
					}
					if(u == 1){
						if(canMoveRight)
							direction = 3;
						if(canMoveLeft)
							direction = 2;
					}
					AI_time1 = 0;
					break;
				}
				if(direction == 2 || direction == 3){
					if(u == 0){
						if(canMoveUp)
							direction = 0;
	           	        if(canMoveDown)
							direction = 1;
					}
					if(u == 1){
						if(canMoveDown)
							direction = 1;
						if(canMoveUp)
							direction = 0;
					}
					if(cantGoAnyWhere){
						if(canMoveLeft)
							direction = 2;
						if(canMoveRight)
							direction = 3;
					}
					AI_time1 = 0;
					break;
				}
			}

			if(!alarm && !ghost && !cantGoAnyWhere){
				if(canMoveLeft && xPos > a && lefttime > 66){
					direction = 2;
					yPos = yVPos;
					AI_time2 = 0;
					lefttime = 0;
				}
				if(canMoveRight && xPos < a && righttime> 66){
					direction = 3;
					yPos = yVPos;
					AI_time2 = 0;
					righttime = 0;
				}
				if(canMoveUp && yPos > b && uptime > 66){
					direction = 0;
					xPos = xVPos;
					AI_time2 = 0;
					uptime = 0;
				}
				if(canMoveDown && yPos < b && downtime > 66){
					direction = 1;
					xPos = xVPos;
					AI_time2 = 0;
					downtime = 0;
				}
			}
			if(alarm && !ghost){
				if(canMoveRight && xPos > a && righttime > 66){
					direction = 3;
					yPos = yVPos;
					AI_time2 = 0;
					lefttime = 0;
				}
				if(canMoveLeft && xPos < a && lefttime> 66){
					direction = 2;
					yPos = yVPos;
					AI_time2 = 0;
					righttime = 0;
				}
				if(canMoveDown && yPos > b && downtime > 66){
					direction = 1;
					xPos = xVPos;
					AI_time2 = 0;
					uptime = 0;
				}
				if(canMoveUp && yPos < b && uptime > 66){
					direction = 0;
					xPos = xVPos;
					AI_time2 = 0;
					downtime = 0;
				}
			}
			if(ghost){
				a = 210;
				b = 189;
				if(canMoveLeft && xPos > a && lefttime > 66){
					direction = 2;
					yPos = yVPos;
					AI_time2 = 0;
					lefttime = 0;
				}
				if(canMoveRight && xPos < a && righttime> 66){
					direction = 3;
					yPos = yVPos;
					AI_time2 = 0;
					righttime = 0;
				}
				if(canMoveUp && yPos > b && uptime > 66){
					direction = 0;
					xPos = xVPos;
					AI_time2 = 0;
					uptime = 0;
				}
				if(canMoveDown && yPos < b && downtime > 66){
					direction = 1;
					xPos = xVPos;
					AI_time2 = 0;
					downtime = 0;
				}
			}
			interval = 63 + 21*((int)(Math.random()*10));
		}

		if(ghost){
			if(xVPos == 189 && yVPos == 441)
				direction = 0;
			if(xVPos == 231 && yVPos == 441)
				direction = 0;
			if(xVPos == 189 && yVPos == 399)
				direction = 2;
			if(xVPos == 231 && yVPos == 399)
				direction = 3;
			if(xVPos == 189 && yVPos == 357)
				direction = 0;
			if(xVPos == 231 && yVPos == 357)
				direction = 0;
			if(xVPos == 189 && yVPos == 315)
				direction = 2;
			if(xVPos == 231 && yVPos == 315)
				direction = 3;
			if(xVPos == 147 && yVPos == 315)
				direction = 0;
			if(xVPos == 273 && yVPos == 315)
				direction = 0;
			if(xVPos == 105 && yVPos == 231)
				direction = 3;
			if(xVPos == 315 && yVPos == 231)
				direction = 2;
			if(xVPos == 147 && yVPos == 105)
				direction = 1;
			if(xVPos == 273 && yVPos == 105)
				direction = 1;
			if(yVPos >= 189 && yVPos < 231 && xVPos == 210)
				direction = 1;
			if(xVPos == 210 && yVPos == 231){
				ghost = false;
				speed = 2;
				cantGoAnyWhere = true;
				prisonTime = 0;
			}
		}

		if(prisonTime > 231){
			if(yVPos > 189 && yVPos <= 231 && xVPos == 210){
				direction = 0;
				canMoveUp = true;
			}
			if(yVPos == 189){
				prisonTime = 0;
				cantGoAnyWhere = false;
			}
		}

		if(stop)
			speed = 0;
		if(direction == 0 && canMoveUp)
			yPos-=speed;
		if(direction == 1 && canMoveDown)
			yPos+=speed;
		if(direction == 2 && canMoveLeft)
			xPos-=speed;
		if(direction == 3 && canMoveRight)
			xPos+=speed;


		if(direction == 2 && xPos < 0)
			xPos = 420;
		if(direction == 3 && xPos > 420)
			xPos = 0;

		Enemy = new Rectangle(xPos -10, yPos - 10, 21, 21);

		a = (xPos - 10)/21;
		b = (xPos - 10)%21;
		if(b < 6)
			b = 0;
		if(b > 16)
			b = 21;
		if(b < 17 && b > 5)
			b = 11;
		xVPos = a*21 + b + 10;

		int c = (yPos - 10)/21;
		int d = (yPos - 10)%21;
		if(d < 6)
			d = 0;
		if(d > 16)
			d = 21;
		if(d < 17 && d > 5)
			d = 11;
		yVPos = c*21 + d + 10;
	}

	public void draw(Graphics g){
		if(Colour == 1)
			g.setColor(Color.red);
		if(Colour == 2)
			g.setColor(Color.cyan);
		if(Colour == 3)
			g.setColor(Color.pink);
		if(Colour == 4)
			g.setColor(Color.orange);
		Polygon Ghost = null;
		if(gameFlow% 16 > 8){
			int[] xPoints = {xPos - 5,
					   xPos - 9,
					   xPos - 9,
					   xPos - 6,
					   xPos - 3,
					   xPos,
					   xPos + 3,
					   xPos + 6,
					   xPos + 10,
					   xPos + 10,
					   xPos + 5,
				  	  };
			int[] yPoints = new int[] {yPos - 9,
					   yPos - 4,
					   yPos + 9,
					   yPos + 4,
					   yPos + 9,
					   yPos + 4,
					   yPos + 9,
					   yPos + 4,
					   yPos + 9,
					   yPos - 4,
					   yPos - 9,
					  };
			Ghost = new Polygon (xPoints, yPoints, xPoints.length);
		}

		if(gameFlow% 16 < 9){
			int[] xPoints = {xPos - 5,
					   xPos - 9,
					   xPos - 9,
					   xPos - 6,
					   xPos,
					   xPos + 6,
					   xPos + 10,
					   xPos + 10,
					   xPos + 5,
				  	  };
			int[] yPoints = new int[] {yPos - 9,
					   yPos - 4,
					   yPos + 9,
					   yPos + 4,
					   yPos + 9,
					   yPos + 4,
					   yPos + 9,
					   yPos - 4,
					   yPos - 9,
					  };
			Ghost = new Polygon (xPoints, yPoints, xPoints.length);
		}
		if(!alarm && !ghost)
			g.fillPolygon(Ghost);
		if(!alarm || ghost){
			g.setColor(Color.white);
			g.fillOval(xPos - 8, yPos - 5, 7, 8);
			g.fillOval(xPos + 2, yPos - 5, 7, 8);
			g.setColor(Color.blue);
			if(direction == 0){
				g.fillOval(xPos - 6, yPos - 4, 3, 4);
				g.fillOval(xPos + 4, yPos - 4, 3, 4);
			}
			if(direction == 1){
				g.fillOval(xPos - 6, yPos - 2, 3, 4);
				g.fillOval(xPos + 4, yPos - 2, 3, 4);
			}
			if(direction == 2){
				g.fillOval(xPos - 7, yPos - 3, 3, 4);
				g.fillOval(xPos + 3, yPos - 3, 3, 4);
			}
			if(direction == 3){
				g.fillOval(xPos - 5, yPos - 3, 3, 4);
				g.fillOval(xPos + 5, yPos - 3, 3, 4);
			}
		}
		if(alarm){
			g.setColor(Color.blue);
			if(alarmTime >= 231 && alarmTime%6 > 2)
				g.setColor(Color.lightGray);
			g.fillPolygon(Ghost);
			g.setColor(Color.white);
			g.fillOval(xPos - 6, yPos - 6, 5, 6);
			g.fillOval(xPos + 2, yPos - 6, 5, 6);
			g.drawLine(xPos - 6, yPos + 3, xPos - 4, yPos + 1);
			g.drawLine(xPos - 4, yPos + 1, xPos - 2, yPos + 3);
			g.drawLine(xPos - 2, yPos + 3, xPos, yPos + 1);
			g.drawLine(xPos, yPos + 1, xPos + 2, yPos + 3);
			g.drawLine(xPos + 2, yPos + 3, xPos + 4, yPos + 1);
			g.drawLine(xPos + 4, yPos + 1, xPos + 6, yPos + 3);
		}
	}

	public void Alarm(int a){
		if(a == 1)
			alarm = true;
		if(a == 2)
			alarm = false;
		alarmTime = 0;
	}

	public void Ghost(){
		ghost = true;
		alarmTime = 0;
	}

	public Rectangle getBorder(){
		return Enemy;
	}

	public int status(){
		int a = 0;
		if(alarm)
			a = 1;
		if(ghost)
			a = 2;
		return a;
	}

	public void stop(){
		stop = true;
	}
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美色综合网站| 2023国产精品视频| 成人深夜在线观看| 精品无码三级在线观看视频| 亚洲综合一二三区| 亚洲人成小说网站色在线| 国产偷国产偷亚洲高清人白洁 | 成人蜜臀av电影| 国产在线视视频有精品| 日本不卡一二三区黄网| 日韩经典一区二区| 亚洲三级理论片| 国产欧美综合在线观看第十页| 精品国产一二三区| 日韩色在线观看| 欧美亚洲动漫另类| 色诱视频网站一区| 91女神在线视频| 色婷婷久久久综合中文字幕| 99久久99久久精品免费看蜜桃| 久久成人久久爱| 韩国精品在线观看| 国产成人夜色高潮福利影视| 美女视频黄a大片欧美| 日本欧美一区二区在线观看| 人人精品人人爱| 麻豆国产欧美一区二区三区| 精品一区二区av| 久草精品在线观看| 日日夜夜免费精品视频| 久久国产婷婷国产香蕉| 久久不见久久见免费视频7| 国产最新精品精品你懂的| 国产乱码精品一区二区三区忘忧草| 国产精品99久久久久久宅男| 毛片av中文字幕一区二区| 狠狠色综合日日| 成人性生交大片免费看在线播放| 久久99久久久久| 久久精品国产99久久6| 国产成人精品三级麻豆| 91在线播放网址| 欧美午夜精品一区二区三区| 91精品国产综合久久精品 | 在线视频综合导航| 欧美日韩亚洲国产综合| 日韩午夜激情电影| 亚洲国产精品二十页| 日韩毛片一二三区| 午夜精品一区在线观看| 韩国成人在线视频| 色天使色偷偷av一区二区| 91精品在线免费观看| 日韩视频免费观看高清在线视频| www国产成人免费观看视频 深夜成人网| 日本一区二区高清| 亚洲在线中文字幕| 久久99精品久久久久婷婷| 国产福利精品导航| 在线观看日韩国产| 欧美日本视频在线| 久久久天堂av| 亚洲在线中文字幕| 精品一区二区三区av| 91免费观看国产| 欧美性欧美巨大黑白大战| 精品国产不卡一区二区三区| 中文字幕亚洲电影| 麻豆精品视频在线观看| 国产九色精品成人porny| www.成人在线| 日韩欧美在线1卡| 亚洲天堂精品视频| 久久99深爱久久99精品| 色94色欧美sute亚洲线路一ni| 精品福利一二区| 最新国产成人在线观看| 亚洲高清在线视频| 国产福利精品导航| 中文字幕免费在线观看视频一区| 亚洲综合丝袜美腿| 激情欧美日韩一区二区| 欧美亚洲一区二区在线观看| 亚洲国产精品99久久久久久久久| 亚洲国产成人91porn| 国产一区欧美二区| 正在播放一区二区| 亚洲伦在线观看| 国产成人一区二区精品非洲| 欧美一区二区视频网站| 亚洲精选在线视频| 国产精品香蕉一区二区三区| 欧美乱熟臀69xxxxxx| 一区二区三区精品视频在线| 懂色av一区二区在线播放| 日韩欧美电影在线| 日韩码欧中文字| 成人性生交大片免费看中文 | 国产精品人成在线观看免费| 亚洲成精国产精品女| 成人午夜av影视| 2023国产精华国产精品| 国产精品免费久久久久| 精品在线播放午夜| 精品福利在线导航| 国产麻豆9l精品三级站| 久久蜜桃av一区精品变态类天堂| 国产乱码精品一区二区三区忘忧草 | 亚洲日本韩国一区| 成人丝袜高跟foot| 亚洲欧美日韩一区| 在线观看日韩高清av| 亚洲福利视频一区| 在线播放日韩导航| 蜜臀av性久久久久蜜臀aⅴ流畅| 日韩精品综合一本久道在线视频| 韩日欧美一区二区三区| 日本一区免费视频| av资源网一区| 亚洲福中文字幕伊人影院| 91精品啪在线观看国产60岁| 美国三级日本三级久久99| 久久久久久久综合| 成人av电影在线| 亚洲精品老司机| 欧美日韩一区在线| 久久精品999| 国产精品区一区二区三区| 在线免费视频一区二区| 日本午夜精品一区二区三区电影 | 亚洲成a人v欧美综合天堂下载| 欧美精品丝袜久久久中文字幕| 美女www一区二区| 久久久久高清精品| 在线观看欧美精品| 青椒成人免费视频| 国产片一区二区| 欧美日韩中字一区| 国内国产精品久久| 综合激情成人伊人| 日韩欧美综合在线| www.性欧美| 91污片在线观看| 午夜精品久久久久久不卡8050| 久久亚洲精精品中文字幕早川悠里 | 日本视频免费一区| 国产精品色在线观看| 在线成人高清不卡| av亚洲精华国产精华精华 | 北条麻妃一区二区三区| 亚洲成a人v欧美综合天堂下载 | 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 一区二区三区免费看视频| 欧美v国产在线一区二区三区| 99在线精品一区二区三区| 美女www一区二区| 亚洲免费伊人电影| 久久久久久免费网| 欧美日韩www| 成人av片在线观看| 美洲天堂一区二卡三卡四卡视频 | 偷拍一区二区三区四区| 欧美激情在线观看视频免费| 欧美另类变人与禽xxxxx| 99精品视频中文字幕| 国内精品不卡在线| 五月激情六月综合| 亚洲天堂精品在线观看| 亚洲精品在线观看网站| 欧美亚洲尤物久久| 视频一区视频二区中文| 亚洲午夜久久久久久久久久久| 日韩视频永久免费| 99免费精品在线| 激情久久久久久久久久久久久久久久| 亚洲资源在线观看| 国产精品久久久久aaaa| 久久色.com| 欧美一区二区网站| 欧美亚洲国产一区二区三区| 成人国产电影网| 国产一区高清在线| 三级久久三级久久久| 亚洲影院免费观看| 中文字幕亚洲在| 中文字幕av免费专区久久| 日韩欧美美女一区二区三区| 精品视频免费看| 91成人网在线| 一本到一区二区三区| 高清国产一区二区| 国产九色精品成人porny| 九九九精品视频| 青青草国产成人99久久| 日日欢夜夜爽一区| 午夜激情久久久| 手机精品视频在线观看| 亚洲综合在线免费观看| 亚洲精品成人悠悠色影视| 国产精品免费久久久久|