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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? actor.java

?? 大量j2me源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
         // and we should abort the collision test. Therefore we only do the
         // y test now if the lastYFP STILL equals the yFP (which it should
         // unless a teleport occured).
         if (lastYFP == yFP)
         {
            yFP = MathFP.add(yFP, MathFP.mul(yVelFP, ticksFP));

            // Check if we collided with anything in Y movement
            if (world.checkCollision(this))
            {
               yVelFP = MathFP.mul(yVelFP, bounceVelFP);
               yFP = MathFP.add(lastYFP, yVelFP);
            }
         }
      }
   }

   /**
    * @return The current x position of the actor.
    */
   public int getX()
   {
      return MathFP.toInt(xFP);
   }

   /**
    * @return The current y position of the actor.
    */
   public int getY()
   {
      return MathFP.toInt(yFP);
   }

   /**
    * Sets the current x axis position of the Actor in world coordinates.
    * @param x The x position value to set (a normal integer).
    */
   public void setX(int x)
   {
      xFP = MathFP.toFP(x);
   }

   /**
    * Sets the current y axis position of the Actor in world coordinates.
    * @param y The y position value to set (a normal integer).
    */
   public void setY(int y)
   {
      yFP = MathFP.toFP(y);
   }

   /**
    * Change the Actor's current direction.
    * @param newDirection The new direction to face (in degrees).
    */
   public void setDirection(int newDirection)
   {
      realDir = newDirection;
      if (realDir < 0) realDir = (359 + (realDir));   // add the neg value
      if (realDir > 359) realDir = (newDirection - 360);

      // set the facing direction to be the closest alignment
      if (wantAlignment)
         alignedDir = getAlignedDirection(realDir);
      else
         alignedDir = realDir;
   }

   /**
    * Gets the closest aligned direction to the passed in direction (in
    * degrees).
    * @param dir The direction to align (in degrees).
    * @return A direction which aligns to the number of divisions the Actor
    * supports.
    */
   public final int getAlignedDirection(int dir)
   {
      int fp = MathFP.toInt(MathFP.div(MathFP.toFP(dir), alignedDivDegreesFP));
      int ad = MathFP.toInt(MathFP.mul(MathFP.toFP(fp), alignedDivDegreesFP));
      if (ad < 0) ad = 0;
      if (ad > 359) ad = 0;
      return ad;
   }

   /**
    * @return The current aligned direction.
    */
   public final int getDirection()
   {
      return alignedDir;
   }

   /**
    * @return The current real direction (not aligned).
    */
   public final int getRealDirection()
   {
      return realDir;
   }

   /**
    * Uses the distance method to calculate the distance between this Actor and
    * another one.
    * @param anotherActor The Actor to calculate the distance to.
    * @return The distance to anotherActor.
    */
   public int distanceTo(Actor anotherActor)
   {
      return distance(this.getX(), this.getY(), anotherActor.getX(),
                      anotherActor.getY());
   }

   public void setThrust(int newThrustFP)
   {
      thrustFP = newThrustFP;
   }

   /**
    * Abstract method to return the width of the Actor.
    */
   abstract public int getWidth();

   /**
    * Abstract method to return the height of the Actor.
    */
   abstract public int getHeight();



   /******************************* STATICS **********************************/

   /**
    * Returns the shortest turning direction from one angle to another
    */
   public final static boolean isClockwise(int angleA, int angleB)
   {
      if (angleA > angleB)
         return (Math.abs(angleA - angleB)) < (angleB + (360 - angleA));
      else
         return (angleA + (360 - angleB)) < (Math.abs(angleB - angleA));
   }

	/**
	 * Returns a game relative angle between two points
	 */
	public final static int getFacingAngle(int x, int y, int ax, int ay)
	{
		// figure the two sides of our right angle triangle
		int a = MathFP.toFP(Math.abs(ax - x));
		int b = MathFP.toFP(Math.abs(ay - y));

		if (a == 0) a = FP_ONE;
		if (b == 0) b = FP_ONE;

		int bovera = MathFP.div(b, a);
		int angleInRadians = MathFP.atan(bovera);
		int angle = getAngleFromRadians(angleInRadians);

		// The tan result from this calculation is between 0 and 90 degrees so now
      // we adjust the result for the actual quadrant we're in relative to the
      // other Actor.
		if (ax < x) // left side
		{
			if (ay < y)
				return angle + 90;   // top
			return angle + 180;     // bottom
		}
		else // right side
		{
			if (ay < y)
				return angle;        // top
			return angle + 270;     // bottom
		}
	}

   public final static int getAngleFromRadians(int radiansFP)
   {
      return MathFP.toInt(MathFP.mul(radiansFP, FP_DEGREES_PER_RAD));
   }

   public final static int getRadiansFromAngle(int angle)
   {
      return MathFP.div(MathFP.toFP(angle), FP_DEGREES_PER_RAD);
   }

   /**
    * Projects a point starting at x, y outwards at an angle for the specified
    * distance. The result is an array of two integer with the x and y point
    * of the projected point.
    * @param startX The starting x position.
    * @param startY The starting y position.
    * @param angleToProjectAt The angle to project along.
    * @param distanceToGo The distance to go.
    * @return An array of 2 integers with the x and y position of the projected
    * point.
    */
   public final static int[] getProjectedPos(int startX, int startY,
                                             int angleToProjectAt,
                                             int distanceToGo)
   {
      int angleInRadians = MathFP.div(MathFP.toFP(angleToProjectAt),
                                      FP_DEGREES_PER_RAD);

      int dx = MathFP.cos(angleInRadians);
      int dy = -MathFP.sin(angleInRadians);

      int xFP = MathFP.toFP(startX);
      int yFP = MathFP.toFP(startY);
      int distanceFP = MathFP.toFP(distanceToGo);

      xFP = MathFP.add(xFP, MathFP.mul(dx, distanceFP));
      yFP = MathFP.add(yFP, MathFP.mul(dy, distanceFP));

      int[] result = {MathFP.toInt(xFP), MathFP.toInt(yFP)};
      return result;
   }

   /**
    * Calculates the distance from one point to another.
    * @param fromX The first x position.
    * @param fromY The first y position.
    * @param toX The second x position.
    * @param toY The second y position.
    * @return The distance between the two points.
    */
   public final static int distance(int fromX, int fromY, int toX, int toY)
   {
      int dx = (toX - fromX) * (toX - fromX);
      int dy = (toY - fromY) * (toY - fromY);
      if (dx == 0 || dy == 0) return 0;

      try
      {
         return MathFP.toInt(MathFP.sqrt(MathFP.toFP(dx + dy)));
      }

      catch (ArithmeticException ae)
      {
         return 0;
      }
   }


}




?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲在线观看免费| 亚洲精品欧美专区| 色婷婷精品大视频在线蜜桃视频| 亚洲最大的成人av| 久久这里只有精品视频网| av电影在线不卡| 九色porny丨国产精品| 一区二区三区在线视频免费观看| 久久久精品中文字幕麻豆发布| 欧美中文字幕不卡| 成人黄色一级视频| 精品一区二区影视| 午夜av一区二区三区| 欧美国产精品一区| 精品国产sm最大网站免费看| 欧美日韩aaa| 91一区一区三区| 国产白丝精品91爽爽久久 | 亚洲一区二区三区视频在线播放 | 综合激情成人伊人| 亚洲精品一区二区三区在线观看 | 高清日韩电视剧大全免费| 麻豆免费精品视频| 午夜精品爽啪视频| 亚洲欧美另类久久久精品2019| 久久一夜天堂av一区二区三区| 91精品婷婷国产综合久久性色 | 日韩欧美一级精品久久| 欧美日韩1区2区| 在线视频中文字幕一区二区| 色综合久久综合网欧美综合网| 成人免费va视频| 成人精品国产一区二区4080| 国产在线一区二区综合免费视频| 麻豆久久久久久久| 麻豆久久久久久| 精品一区二区国语对白| 日韩av中文在线观看| 日日夜夜精品免费视频| 丝袜美腿成人在线| 午夜亚洲福利老司机| 午夜精品一区在线观看| 日韩综合小视频| 蜜臀久久99精品久久久久宅男| 日韩国产欧美在线视频| 日本少妇一区二区| 免费高清不卡av| 久久精品噜噜噜成人av农村| 韩国视频一区二区| 成人免费视频视频在线观看免费 | 不卡欧美aaaaa| 成人午夜电影久久影院| 91在线观看地址| 欧美少妇性性性| 欧美一区二区啪啪| 26uuu亚洲综合色欧美| 国产精品三级久久久久三级| 国产精品二区一区二区aⅴ污介绍| 亚洲美女淫视频| 亚洲mv在线观看| 五月婷婷色综合| 久久成人免费网| 成人黄色小视频在线观看| 91麻豆福利精品推荐| 欧美剧情电影在线观看完整版免费励志电影 | 日韩欧美高清一区| 26uuu亚洲综合色| 一区二区中文视频| 午夜av电影一区| 国产精品77777竹菊影视小说| 99久久免费精品| 欧美日韩一级二级| 26uuu精品一区二区| 国产精品大尺度| 亚洲mv在线观看| 国产成a人无v码亚洲福利| 在线免费观看视频一区| 日韩欧美在线综合网| 国产精品国产三级国产普通话蜜臀| 一区二区三区四区在线| 韩日欧美一区二区三区| 99九九99九九九视频精品| 日韩午夜电影av| 亚洲乱码国产乱码精品精可以看| 日本不卡一二三区黄网| 成人18视频在线播放| 91精品国产综合久久婷婷香蕉 | 日韩美女视频一区二区在线观看| 久久精品男人天堂av| 亚洲成人免费视频| 成人午夜精品一区二区三区| 欧美精品久久久久久久久老牛影院 | 欧美视频在线播放| 久久一日本道色综合| 亚洲高清三级视频| 成人小视频免费在线观看| 91精品啪在线观看国产60岁| 亚洲美女电影在线| 久草在线在线精品观看| 欧美日韩国产精品自在自线| 中文字幕不卡在线观看| 狠狠久久亚洲欧美| 4438亚洲最大| 亚洲午夜久久久久久久久电影网| 成人中文字幕电影| 精品国产青草久久久久福利| 香蕉影视欧美成人| 色香蕉成人二区免费| 日本一区二区三区高清不卡| 捆绑紧缚一区二区三区视频| 欧美色精品天天在线观看视频| 国产精品理伦片| 国产成人免费在线观看不卡| 91精品国产综合久久精品| 一区二区三区自拍| 成人毛片视频在线观看| 久久久精品免费网站| 激情综合一区二区三区| 欧美精品1区2区| 午夜精品一区二区三区免费视频| 色屁屁一区二区| 亚洲三级小视频| 成人动漫在线一区| 国产女主播视频一区二区| 国内偷窥港台综合视频在线播放| 日韩欧美一级精品久久| 奇米精品一区二区三区在线观看 | 91丨porny丨户外露出| 中文字幕免费不卡在线| 国产成人在线视频网址| 久久精品视频在线免费观看| 国产一区免费电影| 久久色.com| 国产成人免费高清| 日本一区免费视频| 岛国av在线一区| 国产精品毛片高清在线完整版| 成人免费视频免费观看| 中文字幕在线一区二区三区| www.在线欧美| 亚洲欧美激情在线| 欧美在线视频不卡| 日韩中文字幕91| 欧美成人三级在线| 国产麻豆精品久久一二三| 欧美激情一区二区三区不卡 | 视频一区在线视频| 欧美高清激情brazzers| 日韩制服丝袜av| 精品美女在线播放| 国产999精品久久久久久绿帽| 国产精品国产三级国产aⅴ原创 | 中文字幕一区二区三区四区| 99久久精品一区二区| 一区二区三国产精华液| 欧美疯狂做受xxxx富婆| 麻豆精品一区二区| 久久网这里都是精品| va亚洲va日韩不卡在线观看| 亚洲人成亚洲人成在线观看图片 | av在线播放一区二区三区| 亚洲欧美日韩久久| 欧美精品精品一区| 国产美女精品人人做人人爽| 国产精品久久久久久福利一牛影视 | 国产精品99久久久久久有的能看| 欧美激情在线看| 精品视频1区2区| 精品一区二区影视| 亚洲欧美日韩国产综合在线| 欧美日本一区二区| 国产精品系列在线播放| 亚洲人123区| 91精品在线一区二区| 粉嫩av一区二区三区| 婷婷激情综合网| 欧美国产成人精品| 欧美日韩亚州综合| 国产麻豆精品95视频| 亚洲午夜免费电影| 久久综合九色综合欧美98| 一本一道久久a久久精品| 久久av老司机精品网站导航| 中文字幕在线不卡一区| 91精品国产高清一区二区三区 | 欧美一级高清大全免费观看| 成人黄色小视频| 免费亚洲电影在线| 亚洲色图在线视频| 欧美xxxx老人做受| 欧美综合欧美视频| 国产成人精品一区二区三区网站观看| 亚洲综合无码一区二区| 久久精品水蜜桃av综合天堂| 777a∨成人精品桃花网| 91亚洲永久精品| 精品亚洲免费视频| 亚洲国产精品久久久久婷婷884 | 亚洲男人电影天堂| xfplay精品久久|