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

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

?? actor.java

?? 大量j2me源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號(hào):
         if (world.checkCollision(this))
         {
            xVelFP = MathFP.mul(xVelFP, bounceVelFP);
            xFP = MathFP.add(lastXFP, xVelFP);
         }

         // Adjust Y. This code also handles a special case where the x
         // collision may have caused the Actor to move (such as colliding with
         // a teleport or level gateway). In this case our lastYFP is invalid
         // 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);
   }

   /**
    * 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 newThrust)
   {
      thrustFP = MathFP.toFP(newThrust);
   }

   /**
    * 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;
      }
   }


}




?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
另类欧美日韩国产在线| 中文字幕亚洲一区二区av在线| 中文字幕亚洲视频| 国内精品久久久久影院薰衣草| 色综合一个色综合| 久久在线观看免费| 日韩有码一区二区三区| 99精品视频在线播放观看| ww亚洲ww在线观看国产| 天天影视色香欲综合网老头| 99久久综合国产精品| 精品88久久久久88久久久| 亚洲国产精品久久久久婷婷884| 床上的激情91.| 欧美电影免费观看完整版| 亚洲国产美女搞黄色| av资源网一区| 久久精品在这里| 乱一区二区av| 4438x亚洲最大成人网| 伊人婷婷欧美激情| 成人av影院在线| 国产午夜精品久久久久久免费视| 久久成人麻豆午夜电影| 欧美丰满一区二区免费视频| 一区二区三区 在线观看视频| 成人免费av资源| 久久精品视频一区二区三区| 美国十次了思思久久精品导航| 欧美日韩黄视频| 一区二区三区精品久久久| 99精品国产91久久久久久| 欧美国产精品一区二区| 丁香网亚洲国际| 国产午夜精品一区二区三区四区| 国产一区二区精品久久91| 精品区一区二区| 秋霞午夜av一区二区三区| 欧美福利电影网| 日本亚洲一区二区| 337p亚洲精品色噜噜噜| 日本成人超碰在线观看| 欧美一区二区视频网站| 免费成人在线播放| 日韩欧美一区二区免费| 精品一二三四在线| 久久欧美中文字幕| 国产成人a级片| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 蜜臀a∨国产成人精品| 69久久夜色精品国产69蝌蚪网| 午夜久久久影院| 欧美肥妇bbw| 日韩av一级片| 欧美成人乱码一区二区三区| 久久99精品国产.久久久久久| 欧美精品一区在线观看| 国内精品免费在线观看| 亚洲国产高清aⅴ视频| 成人福利视频网站| 亚洲人妖av一区二区| 在线观看一区二区视频| 日精品一区二区三区| 日韩免费观看2025年上映的电影 | 亚洲第一会所有码转帖| 7777精品伊人久久久大香线蕉完整版 | 亚洲高清三级视频| 91精品国产综合久久久久久久 | 亚洲精品视频一区| 欧美日韩在线一区二区| 蜜臀91精品一区二区三区| 久久久久久免费毛片精品| 成a人片国产精品| 一级女性全黄久久生活片免费| 欧美伊人久久大香线蕉综合69 | 制服丝袜亚洲播放| 136国产福利精品导航| 色综合激情五月| 午夜伦欧美伦电影理论片| 亚洲精品在线观看网站| 不卡的av电影| 亚洲超丰满肉感bbw| 精品1区2区在线观看| 99re这里只有精品视频首页| 三级不卡在线观看| 国产欧美精品一区二区色综合朱莉| av一二三不卡影片| 午夜精品久久久久影视| 久久久一区二区| 91美女精品福利| 美女视频网站黄色亚洲| 国产精品久久久久久久午夜片 | 春色校园综合激情亚洲| 亚洲国产日韩a在线播放| 久久亚区不卡日本| 色先锋资源久久综合| 久久国产视频网| 一区在线播放视频| 日韩女优电影在线观看| 91无套直看片红桃| 久久99精品久久久久婷婷| 亚洲欧美一区二区在线观看| 日韩视频一区在线观看| 99国内精品久久| 激情久久五月天| 一级女性全黄久久生活片免费| 久久九九影视网| 欧美日韩在线观看一区二区 | 久久精品国产第一区二区三区 | 日韩精品在线一区二区| 97久久人人超碰| 国产真实乱偷精品视频免| 亚洲夂夂婷婷色拍ww47| 精品国产精品网麻豆系列| 欧美亚洲精品一区| 成人免费毛片片v| 麻豆精品视频在线观看视频| 亚洲主播在线观看| 国产精品系列在线| 亚洲一区二区三区四区在线| 亚洲国产精品t66y| 日韩欧美电影一二三| 欧美日韩一区国产| 99在线视频精品| 国产一区二区三区久久悠悠色av| 亚洲成av人片在线观看无码| 国产精品久久久久毛片软件| 2023国产精品| 日韩一区二区在线观看| 欧美色综合天天久久综合精品| av综合在线播放| 成人小视频免费在线观看| 精品一区二区国语对白| 男女男精品视频| 夜夜精品浪潮av一区二区三区| 亚洲国产精品激情在线观看| 2019国产精品| 日韩一级片在线播放| 欧美日韩aaa| 在线观看免费视频综合| av一二三不卡影片| 成人av在线一区二区| 粉嫩嫩av羞羞动漫久久久 | 亚洲国产一区二区三区| 日韩理论片在线| 亚洲视频一区二区在线| 国产精品久久免费看| 国产精品久久三| 国产精品久久国产精麻豆99网站| 国产偷国产偷精品高清尤物| 精品国产髙清在线看国产毛片| 日韩精品影音先锋| 日韩精品一区二区三区视频播放 | 国产精品久久毛片a| 国产精品欧美精品| 国产精品久久久久永久免费观看| 国产片一区二区| 久久久久久久久久久久久夜| www国产亚洲精品久久麻豆| 2024国产精品| 国产午夜精品福利| 中文字幕av在线一区二区三区| 国产嫩草影院久久久久| 国产性天天综合网| 欧美极品另类videosde| 亚洲国产高清在线观看视频| 亚洲天天做日日做天天谢日日欢 | 亚洲一区二区在线免费看| 樱桃国产成人精品视频| 亚洲高清视频中文字幕| 日韩av中文字幕一区二区三区| 热久久免费视频| 国产乱子伦一区二区三区国色天香| 极品少妇xxxx精品少妇偷拍| 国产一区二区成人久久免费影院| 国产精品69毛片高清亚洲| 国产精品123区| 成人av在线影院| 在线观看一区二区精品视频| 欧美电影一区二区| 精品欧美黑人一区二区三区| 国产三级三级三级精品8ⅰ区| 国产精品萝li| 一区二区三区鲁丝不卡| 蜜臀精品一区二区三区在线观看| 韩国女主播成人在线观看| 国产成人精品免费看| 色天天综合色天天久久| 欧美日韩国产a| 精品久久久久久久久久久久久久久久久 | 久久久99精品免费观看不卡| 日韩美女视频19| 欧美bbbbb| 国产成人aaa| 一本色道**综合亚洲精品蜜桃冫| 在线电影院国产精品| 久久影视一区二区| 亚洲另类一区二区| 毛片不卡一区二区| 成年人国产精品|