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

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

?? sprite.java

?? 這是j2me里MIDP2.0中game包的源代碼
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
	    this.y = oldY -		getTransformedPtY(dRefX, dRefY, this.t_currentTransformation);	    // Calculate transformed sprites collision rectangle	    // and transformed width and height	    computeTransformedBounds(this.t_currentTransformation);	} else {	    // just reinitialize the animation frames.	    initializeFrames(img, frameWidth, frameHeight, maintainCurFrame);	}    }    /**     * Defines the Sprite's bounding rectangle that is used for collision      * detection purposes.  This rectangle is specified relative to the      * un-transformed Sprite's upper-left corner and defines the area that is     * checked for collision detection.  For pixel-level detection, only those     * pixels within the collision rectangle are checked.      *     * By default, a Sprite's collision rectangle is located at 0,0 as has the     * same dimensions as the Sprite.  The collision rectangle may be      * specified to be larger or smaller than the default rectangle; if made      * larger, the pixels outside the bounds of the Sprite are considered to be     * transparent for pixel-level collision detection.     *     * @param x the horizontal location of the collision rectangle relative to     * the untransformed Sprite's left edge     * @param y the vertical location of the collision rectangle relative to     * the untransformed Sprite's top edge     * @param width the width of the collision rectangle     * @param height the height of the collision rectangle     * @throws IllegalArgumentException if the specified     * <code>width</code> or <code>height</code> is     * less than <code>0</code>     */    public void defineCollisionRectangle(int x, int y, int width, int height) {	if (width < 0 || height < 0) {             throw new IllegalArgumentException();	}	collisionRectX = x;	collisionRectY = y;	collisionRectWidth = width;	collisionRectHeight = height;	// call set transform with current transformation to 	// update transformed sprites collision rectangle	setTransformImpl(t_currentTransformation);    }    /**     * Sets the transform for this Sprite.  Transforms can be      * applied to a Sprite to change its rendered appearance.  Transforms      * are applied to the original Sprite image; they are not cumulative,      * nor can they be combined.  By default, a Sprite's transform is      * {@link #TRANS_NONE}.     * <P>     * Since some transforms involve rotations of 90 or 270 degrees, their     * use may result in the overall width and height of the Sprite      * being swapped.  As a result, the values returned by      * {@link Layer#getWidth} and {@link Layer#getHeight} may change.     * <p>     * The collision rectangle is also modified by the transform so that     * it remains static relative to the pixel data of the Sprite.       * Similarly, the defined reference pixel is unchanged by this method,     * but its visual location within the Sprite may change as a result.     * <P>     * This method repositions the Sprite so that the location of      * the reference pixel in the painter's coordinate system does not change     * as a result of changing the transform.  Thus, the reference pixel      * effectively becomes the centerpoint for the transform.  Consequently,     * the values returned by {@link #getRefPixelX} and {@link #getRefPixelY}      * will be the same both before and after the transform is applied, but      * the values returned by {@link #getX getX()} and {@link #getY getY()}     * may change.       * <p>     * @param transform the desired transform for this <code>Sprite</code>     * @throws IllegalArgumentException if the requested     * <code>transform</code> is invalid     * @see #TRANS_NONE     * @see #TRANS_ROT90     * @see #TRANS_ROT180     * @see #TRANS_ROT270     * @see #TRANS_MIRROR     * @see #TRANS_MIRROR_ROT90     * @see #TRANS_MIRROR_ROT180     * @see #TRANS_MIRROR_ROT270     *     */    public void setTransform(int transform) {	setTransformImpl(transform);    }    /**     * Checks for a collision between this Sprite and the specified Sprite.     * <P>     * If pixel-level detection is used, a collision is detected only if     * opaque pixels collide.  That is, an opaque pixel in the first     * Sprite would have to collide with an opaque  pixel in the second     * Sprite for a collision to be detected.  Only those pixels within     * the Sprites' respective collision rectangles are checked.     * <P>     * If pixel-level detection is not used, this method simply     * checks if the Sprites' collision rectangles intersect.     * <P>     * Any transforms applied to the Sprites are automatically accounted for.     * <P>     * Both Sprites must be visible in order for a collision to be     * detected.     * <P>     * @param s the <code>Sprite</code> to test for collision with     * @param pixelLevel <code>true</code> to test for collision on a     * pixel-by-pixel basis, <code>false</code> to test using simple     * bounds checking.     * @return <code>true</code> if the two Sprites have collided, otherwise     * <code>false</code>     * @throws NullPointerException if Sprite <code>s</code> is      * <code>null</code>     */    public final boolean collidesWith(Sprite s, boolean pixelLevel)     {                // check if either of the Sprite's are not visible        if (!(s.visible && this.visible)) {            return false;        }	// these are package private 	// and can be accessed directly        int otherLeft    = s.x + s.t_collisionRectX;        int otherTop     = s.y + s.t_collisionRectY;        int otherRight   = otherLeft + s.t_collisionRectWidth;        int otherBottom  = otherTop  + s.t_collisionRectHeight;	int left   = this.x + this.t_collisionRectX;	int top    = this.y + this.t_collisionRectY;	int right  = left + this.t_collisionRectWidth;	int bottom = top  + this.t_collisionRectHeight;	// check if the collision rectangles of the two sprites intersect	if (intersectRect(otherLeft, otherTop, otherRight, otherBottom,			  left, top, right, bottom)) {	    // collision rectangles intersect	    if (pixelLevel) {		// we need to check pixel level collision detection.		// use only the coordinates within the Sprite frame if 		// the collision rectangle is larger than the Sprite 		// frame 		if (this.t_collisionRectX < 0) {		    left = this.x;		}		if (this.t_collisionRectY < 0) {		    top = this.y;		}		if ((this.t_collisionRectX + this.t_collisionRectWidth)		    > this.width) {		    right = this.x + this.width;		}		if ((this.t_collisionRectY + this.t_collisionRectHeight)		    > this.height) {		    bottom = this.y + this.height;		}		// similarly for the other Sprite		if (s.t_collisionRectX < 0) {		    otherLeft = s.x;		}		if (s.t_collisionRectY < 0) {		    otherTop = s.y;		}		if ((s.t_collisionRectX + s.t_collisionRectWidth)		    > s.width) {		    otherRight = s.x + s.width;		}		if ((s.t_collisionRectY + s.t_collisionRectHeight)		    > s.height) {		    otherBottom = s.y + s.height;		}		// recheck if the updated collision area rectangles intersect		if (!intersectRect(otherLeft, otherTop, otherRight, otherBottom,				  left, top, right, bottom)) {		    // if they don't intersect, return false;		    return false;		}		// the updated collision rectangles intersect,		// go ahead with collision detection		// find intersecting region, 		// within the collision rectangles		int intersectLeft = (left < otherLeft) ? otherLeft : left;		int intersectTop  = (top < otherTop) ? otherTop : top;		// used once, optimize.		int intersectRight  = (right < otherRight) 		                      ? right : otherRight;		int intersectBottom = (bottom < otherBottom) 		                      ? bottom : otherBottom;		int intersectWidth  = Math.abs(intersectRight - intersectLeft);		int intersectHeight = Math.abs(intersectBottom - intersectTop);		// have the coordinates in painter space,		// need coordinates of top left and width, height		// in source image of Sprite.				int thisImageXOffset = getImageTopLeftX(intersectLeft, 							intersectTop,							intersectRight,							intersectBottom);				int thisImageYOffset = getImageTopLeftY(intersectLeft, 							intersectTop,							intersectRight,							intersectBottom);		int otherImageXOffset = s.getImageTopLeftX(intersectLeft, 							   intersectTop,							   intersectRight,							   intersectBottom);				int otherImageYOffset = s.getImageTopLeftY(intersectLeft, 							   intersectTop,							   intersectRight,							   intersectBottom);		// check if opaque pixels intersect.		return doPixelCollision(thisImageXOffset, thisImageYOffset,					otherImageXOffset, otherImageYOffset,					this.sourceImage,					this.t_currentTransformation,					s.sourceImage, 					s.t_currentTransformation,					intersectWidth, intersectHeight);	    } else {		// collides!		return true;	    }	}        return false;    }    /**     * Checks for a collision between this Sprite and the specified     * TiledLayer.  If pixel-level detection is used, a collision is     * detected only if opaque pixels collide.  That is, an opaque pixel in     * the Sprite would have to collide with an opaque pixel in TiledLayer     * for a collision to be detected.  Only those pixels within the Sprite's     * collision rectangle are checked.     * <P>     * If pixel-level detection is not used, this method simply checks if the     * Sprite's collision rectangle intersects with a non-empty cell in the     * TiledLayer.     * <P>     * Any transform applied to the Sprite is automatically accounted for.     * <P>     * The Sprite and the TiledLayer must both be visible in order for     * a collision to be detected.     * <P>     * @param t the <code>TiledLayer</code> to test for collision with     * @param pixelLevel <code>true</code> to test for collision on a     * pixel-by-pixel basis, <code>false</code> to test using simple bounds     * checking against non-empty cells.     * @return <code>true</code> if this <code>Sprite</code> has     * collided with the <code>TiledLayer</code>, otherwise     * <code>false</code>     * @throws NullPointerException if <code>t</code> is <code>null</code>     */    public final boolean collidesWith(TiledLayer t, boolean pixelLevel) {	// check if either this Sprite or the TiledLayer is not visible	if (!(t.visible && this.visible)) {	    return false;	}        // dimensions of tiledLayer, cell, and        // this Sprite's collision rectangle        // these are package private         // and can be accessed directly        int tLx1 = t.x;        int tLy1 = t.y;        int tLx2 = tLx1 + t.width;        int tLy2 = tLy1 + t.height;        int tW = t.getCellWidth();        int tH = t.getCellHeight();        int sx1 = this.x + this.t_collisionRectX;        int sy1 = this.y + this.t_collisionRectY;        int sx2 = sx1 + this.t_collisionRectWidth;        int sy2 = sy1 + this.t_collisionRectHeight;        // number of cells        int tNumCols = t.getColumns();        int tNumRows = t.getRows();        // temporary loop variables.        int startCol; // = 0;        int endCol;   // = 0;        int startRow; // = 0;        int endRow;   // = 0;        if (!intersectRect(tLx1, tLy1, tLx2, tLy2, sx1, sy1, sx2, sy2)) {            // if the collision rectangle of the sprite            // does not intersect with the dimensions of the entire             // tiled layer            return false;        }        // so there is an intersection            // note sx1 < sx2, tLx1 < tLx2, sx2 > tLx1  from intersectRect()            // use <= for comparison as this saves us some            // computation - the result will be 0            startCol = (sx1 <= tLx1) ? 0 : (sx1 - tLx1)/tW;            startRow = (sy1 <= tLy1) ? 0 : (sy1 - tLy1)/tH;            // since tLx1 < sx2 < tLx2, the computation will yield            // a result between 0 and tNumCols - 1            // subtract by 1 because sx2,sy2 represent            // the enclosing bounds of the sprite, not the             // locations in the coordinate system.            endCol = (sx2 < tLx2) ? ((sx2 - 1 - tLx1)/tW) : tNumCols - 1;            endRow = (sy2 < tLy2) ? ((sy2 - 1 - tLy1)/tH) : tNumRows - 1;        if (!pixelLevel) {            // check for intersection with a non-empty cell,            for (int row = startRow; row <= endRow; row++) {                for (int col = startCol; col <= endCol; col++) {                    if (t.getCell(col, row) != 0) {                        return true;                    }                }            }            // worst case! we scanned through entire             // overlapping region and            // all the cells are empty!            return false;        } else {            // do pixel level            // we need to check pixel level collision detection.            // use only the coordinates within the Sprite frame if             // the collision rectangle is larger than the Sprite             // frame             if (this.t_collisionRectX < 0) {                sx1 = this.x;            }            if (this.t_collisionRectY < 0) {                sy1 = this.y;            }            if ((this.t_collisionRectX + this.t_collisionRectWidth)                > this.width) {                sx2 = this.x + this.width;            }            if ((this.t_collisionRectY + this.t_collisionRectHeight)                > this.height) {                sy2 = this.y + this.height;            }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品亚洲一区| 日本欧美在线观看| 日本一区二区三区免费乱视频| 欧美日韩一区三区| 欧美午夜精品一区| 欧美午夜精品电影| 精品视频在线免费| 欧美日韩精品一二三区| 欧美视频一二三区| 欧美日韩不卡在线| 91麻豆精品国产91久久久| 欧美日韩国产成人在线免费| 欧美手机在线视频| 欧美日韩久久不卡| 欧美美女视频在线观看| 欧美一区二区三区婷婷月色| 69av一区二区三区| 精品久久久三级丝袜| 久久婷婷国产综合精品青草| 久久女同互慰一区二区三区| 精品国产91久久久久久久妲己| 精品久久免费看| 国产日韩av一区| 亚洲欧洲av在线| 亚洲卡通欧美制服中文| 亚洲综合在线免费观看| 天堂成人国产精品一区| 久久超级碰视频| 国产乱码精品一区二区三区av| 国产大陆a不卡| 色综合天天综合狠狠| 欧美手机在线视频| 精品欧美乱码久久久久久1区2区 | 精品国产免费久久 | 亚洲四区在线观看| 亚洲制服丝袜一区| 麻豆精品一区二区| 成人午夜av电影| 在线看国产一区| 日韩欧美一二三区| 亚洲国产高清在线| 亚洲一区在线电影| 国产在线视频一区二区| 大胆欧美人体老妇| 欧美色涩在线第一页| 精品国产欧美一区二区| 亚洲精品高清视频在线观看| 日韩精品五月天| 国产乱国产乱300精品| 色综合夜色一区| 精品久久久久av影院| 亚洲精品日韩一| 狠狠v欧美v日韩v亚洲ⅴ| 99久久久久久| 精品欧美一区二区三区精品久久| 国产精品久久一卡二卡| 轻轻草成人在线| 成人aa视频在线观看| 91精品国产日韩91久久久久久| 国产喂奶挤奶一区二区三区| 亚洲一线二线三线久久久| 国内精品伊人久久久久av一坑 | 欧美老肥妇做.爰bbww视频| 久久久国产午夜精品| 亚洲综合免费观看高清完整版在线 | 亚洲最色的网站| 国产成人综合在线观看| 欧美日韩一区二区三区高清| 国产精品视频一二| 久久精品999| 欧美三级视频在线观看| 国产精品国产三级国产普通话蜜臀 | 亚洲一区在线看| 国产91精品免费| 日韩片之四级片| 最新国产成人在线观看| 国产一区二区主播在线| 欧美精品高清视频| 亚洲精品自拍动漫在线| 国产91色综合久久免费分享| 宅男噜噜噜66一区二区66| 亚洲精品国产成人久久av盗摄| 国产一区二区三区四区在线观看| 777奇米成人网| 一区二区高清视频在线观看| 成人免费va视频| 久久久久久99久久久精品网站| 日韩国产一二三区| 欧美日韩你懂的| 一区二区三区成人| 91在线国产观看| 国产精品妹子av| 粉嫩av一区二区三区在线播放 | 国产精品毛片久久久久久久| 狠狠色丁香久久婷婷综合_中| 制服视频三区第一页精品| 五月婷婷另类国产| 欧美午夜精品久久久久久超碰 | 成人av免费在线| 国产精品色哟哟| 成人免费毛片嘿嘿连载视频| 国产视频亚洲色图| 国产成人aaa| 国产亲近乱来精品视频| 国产aⅴ综合色| 国产色产综合色产在线视频 | 欧美一区二区三区啪啪| 日韩影院精彩在线| 制服丝袜亚洲色图| 捆绑变态av一区二区三区| 日韩欧美视频一区| 久久国产夜色精品鲁鲁99| 欧美成人video| 国产一区二区精品久久| 国产亚洲综合色| 波波电影院一区二区三区| 国产精品国产三级国产普通话99 | 日韩欧美激情四射| 久久99精品国产麻豆不卡| 日韩欧美色综合| 国产老肥熟一区二区三区| 国产亚洲精品中文字幕| 顶级嫩模精品视频在线看| 日韩久久一区二区| 欧美亚洲国产bt| 全国精品久久少妇| 日本一区二区三区在线观看| 波多野结衣中文字幕一区二区三区 | 欧美婷婷六月丁香综合色| 亚洲国产va精品久久久不卡综合| 欧美精选午夜久久久乱码6080| 免费不卡在线视频| 国产日韩精品久久久| 91官网在线观看| 日韩中文字幕麻豆| 精品国产一区二区三区四区四 | 成人在线一区二区三区| 国产精品黄色在线观看| 欧美三片在线视频观看| 蜜桃视频一区二区| 国产精品人妖ts系列视频| 在线观看亚洲a| 精品中文av资源站在线观看| 中文在线一区二区| 欧美日韩一级视频| 精一区二区三区| 亚洲人成网站精品片在线观看| 欧美日韩国产经典色站一区二区三区 | 视频在线在亚洲| 欧美精品一区二区三区蜜臀| av在线播放不卡| 日韩黄色小视频| 中文字幕精品一区二区精品绿巨人| 成人av网站在线观看| 视频在线在亚洲| 中文字幕制服丝袜一区二区三区| 在线亚洲一区观看| 国产一区二区三区最好精华液| 一二三四社区欧美黄| 久久人人97超碰com| 欧美性生活影院| 国产不卡一区视频| 亚洲国产另类av| 中文字幕免费不卡| 欧美一区二区三区免费大片| 99久久精品情趣| 美国一区二区三区在线播放| 亚洲美女免费在线| 久久综合视频网| 88在线观看91蜜桃国自产| 成人免费看片app下载| 日本人妖一区二区| 亚洲在线观看免费| 国产精品嫩草影院av蜜臀| 日韩一级完整毛片| 在线日韩一区二区| 成人黄色网址在线观看| 麻豆成人免费电影| 香蕉久久夜色精品国产使用方法| 欧美高清在线一区| 精品sm捆绑视频| 欧美色图12p| 97精品久久久午夜一区二区三区| 九九热在线视频观看这里只有精品| 亚洲一区精品在线| 亚洲欧美色综合| 国产女人18毛片水真多成人如厕| 欧美va亚洲va| 欧美剧在线免费观看网站 | 欧美日韩国产免费一区二区| 91视频在线观看| 国产宾馆实践打屁股91| 精品中文av资源站在线观看| 日本大胆欧美人术艺术动态| 亚洲综合无码一区二区| 亚洲精品国产一区二区精华液 | 成人性生交大片免费看视频在线 | 91视频免费看| 成人动漫在线一区| 国产99久久久精品|