2012年5月4日星期五

iquidation de stock else if

The realization of the code, we need to use the onKeyDown () and onKeyUp () method to determine the current mobile phone key is pressed down, according to the key information to update the character animation iquidation de stock, detecting whether the collision.
MIskeyDown = true press the direction of bond mIskeyLeft = true press the direction of bond left mIskeyRight = true mIskeyUp = true press right arrow key that press the direction of bond mHeroPosX representing a character's X coordinates mHeroPosY representing a character's Y coordinates mAnimationState animation ID because the characters walk with 4 groups of direction of the animation so mAnimationState can modify the playback the group animation / * * according to key update display animation * * / * * in collision array looking to see whether they map the physical layer collision * * / if (mIskeyDown) {mAnimationState = ANIM_DOWN; mHeroPosY + = HERO_STEP;} else if (mIskeyLeft) {mAnimationState = ANIM_LEFT; mHeroPosX = HERO_STEP;} else if (mIskeyRight) {mAnimationState = ANIM_RIGHT; mHeroPosX + = HERO_STEP;} else if (mIskeyUp) {mAnimationState = ANIM_UP; mHeroPosY = HERO_STEP;} the protagonist moved each time when we need to check his X Y coordinates are larger than the screen if beyond the screen remains his current position invariant / * * detection whether or not the characters out of screen * * / isBorderCollision = FALSE if (mHeroPosX; < = 0) {mHeroPosX = 0; isBorderCollision = true;} else if (mHeroPosX > = mScreenWidth) {mHeroPosX = mScreenWidth; isBorderCollision = true;} if (mHeroPosY < = 0) {mHeroPosY = 0; isBorderCollision = true;} else if (mHeroPosY = > mScreenHeight) {mHeroPosY = mScreenHeight; isBorderCollision = true;} the protagonist should have the coordinates of two points as shown: why the protagonist to have the coordinates of 2 points is the cause of the upper left corner of the 00 point program is not logical judgment for detecting lead right move beyond the screen, because the coordinates of points in the upper left corner so the entire image out of the screen after the procedure to judge the figure from the screen, it can not be used in the upper left corner of the point as a protagonist of the coordinate origin, need to use the following points to calculate the figure of the logical coordinates, my suggestion is that we only count below this point and then according to this point in out pictures of the upper left corner of the origin, then in the circular image rendering.
Source by the beats by dre relate article:

没有评论:

发表评论