我正在使用andengine在android中开发游戏.我在sprite中放置了一个对象
this.mTexture = new Texture(32, 32, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
this.mFaceTextureRegion = TextureRegionFactory.createFromAsset(this.mTexture, this, "gfx/bike.png", 0, 0);
---- and i place like
Sprite bikeSprite= new Sprite(20, 50, this.mFaceTextureRegion);
Run Code Online (Sandbox Code Playgroud)
我想在j2me精灵中使用这个精灵
bikeSprite.move(--);我怎么在android中做到这一点.我不想使用setPosition.
有谁知道为什么applyforce只适用于我的一个精灵?此外,当我按下其他精灵时,它也会对一个单独的精灵施加力.nextTile方法工作正常.
enter code here包com.martynnorman.jude;
/***@author Nicolas Gramlich*@since 11:54:51 - 03.04.2010*/public class MainActivity扩展BaseGameActivity实现IOnAreaTouchListener {// ================== ========================================= //常量// ==== ================================================== =====
private static final int CAMERA_WIDTH = 720;
private static final int CAMERA_HEIGHT = 480;
int centerX;
int centerY;
// ===========================================================
// Fields
// ===========================================================
private Camera mCamera;
private BitmapTextureAtlas mBitmapTextureAtlas;
private TiledTextureRegion mFaceTextureRegion;
private BitmapTextureAtlas mBitmapTextureAtlas2;
private TiledTextureRegion mFaceTextureRegion2;
Random random = new Random();
Ball sprite;
int scale;
Scene scene;
private BitmapTextureAtlas mFontTexture;
private Font mFont;
Text textcenter;
int t …Run Code Online (Sandbox Code Playgroud) 我在And引擎中开发了一个引发异常的游戏.实际上我不知道异常发生的地方.它在市场上报道很多次.
java.lang.RuntimeException: eglSwapBuffers failed: EGL_BAD_ALLOC
at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1080)
at android.opengl.GLSurfaceView$EglHelper.swap(GLSurfaceView.java:1038)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1364)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
Run Code Online (Sandbox Code Playgroud)
这个有什么解决方案吗?
我正在做一个非常简单的应用程序,一个测试AndEngine的基本hello世界,我在运行它时遇到了一些问题:我将我的模拟器属性设置为RealMayo在他的视频中建议它应该可以工作但是我得到了这个错误而不是
07-23 13:10:23.014: E/AndroidRuntime(1485): java.lang.IllegalArgumentException: No EGLConfig found!
Run Code Online (Sandbox Code Playgroud)
任何人都遇到过相同的情况,或者可能知道如何解决它?
我几乎不想让我们成为AndEngine ...因为一个简单的应用程序真的很难运行.
注意:我发现了一些帖子,但它们至少有3个月的历史,并且不久前修复了模拟器的使用.
无论如何谢谢!:)
嗨,我在Android游戏开发中的新功能,我使用AndEngine我需要打开路径但是有一个问题
看看图像.我需要的路径就像第一个物体应该从屏幕的底部移动到屏幕的中间.但是当我绘制路径时它会移动到屏幕的中间但是回到第二个点.在第二张图像中.图像在路径中移动,但它就像第二张图像.我需要它作为第一张图像.它应该在第3点停止并且应该从第一点开始.
我的代码如下
package com.example.sss;
import org.andengine.engine.camera.Camera;
import org.andengine.engine.options.EngineOptions;
import org.andengine.engine.options.ScreenOrientation;
import org.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;
import org.andengine.entity.IEntity;
import org.andengine.entity.modifier.LoopEntityModifier;
import org.andengine.entity.modifier.PathModifier;
import org.andengine.entity.modifier.PathModifier.IPathModifierListener;
import org.andengine.entity.modifier.PathModifier.Path;
import org.andengine.entity.scene.Scene;
import org.andengine.entity.scene.background.RepeatingSpriteBackground;
import org.andengine.entity.sprite.AnimatedSprite;
import org.andengine.entity.util.FPSLogger;
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas;
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory;
import org.andengine.opengl.texture.atlas.bitmap.source.AssetBitmapTextureAtlasSource;
import org.andengine.opengl.texture.region.TiledTextureRegion;
import org.andengine.ui.activity.SimpleBaseGameActivity;
/**
* (c) 2010 Nicolas Gramlich
* (c) 2011 Zynga
*
* @author Nicolas Gramlich
* @since 13:58:48 - 19.07.2010
*/
public class MainActivity extends SimpleBaseGameActivity {
// ===========================================================
// Constants
// ===========================================================
private static final int CAMERA_WIDTH = …Run Code Online (Sandbox Code Playgroud) 我正在制作小型气球游戏.气球随机弹出并在一段时间后消失.当我点击它们时,我想要消失它们并显示+1而不是气球.当我点击气球时,我想要取消气球精灵.我的问题是当我在代码中调用sprite.detachSelf()时,精灵只是消失了,但实际上精灵还没有被删除.它只会变得无形.当我再次点击那个地方时,气球就会出现,即使在气球消失后它也会显示+1.这意味着我认为气球没有正确脱落.
这是我的代码:
@Override
protected Scene onCreateScene() {
//this.mEngine.registerUpdateHandler(new FPSLogger());
scene = new Scene();
backgroundSprite = new Sprite(0, 0, this.mBackgroundTextureRegion,
getVertexBufferObjectManager());
backgroundSprite.setSize(CAMERA_WIDTH, CAMERA_HEIGHT);
scene.attachChild(backgroundSprite);
scene.unregisterTouchArea(backgroundSprite);
text = new Text(0, 0, font, "Score : 00",
getVertexBufferObjectManager());
scene.attachChild(text);
textTime = new Text(displayMetrics.widthPixels - 220, 0, font,
"00 : 60", getVertexBufferObjectManager());
scene.attachChild(textTime);
timer = new TimerClock(1, new TimerClock.ITimerCallback() {
TimerClock t = timer;
public void onTick() {
System.out.println("timer inside");
if (time > 0) {
time = time - 1;
System.out.println("timer inside : " + …Run Code Online (Sandbox Code Playgroud) 我一直在寻找一段时间,似乎无法找到如何将场景的背景设置为渐变......很难找到与Andengine相关的可靠答案,
我想我的选择是:
任何帮助表示赞赏.
我levelstatus在A(()类中有一个整数(),LevelSelectScene我想在B((GameScene)中更改它,是否可能?
这是我的代码:
(GameScene中的代码)
public class levelComplete()
{
levelSelectScene.getInstance.levelstatus=1;
}
Run Code Online (Sandbox Code Playgroud)
LevelSelectScene有一个公共整数levelstatus.
并且在事件发生后,levelComplete将触发并将levelstatus从null 更改为1.
有没有很好的资源来开始使用Andengine?任何好的教程,博客或书籍?
当然,我访问过它的官方网站http://www.andengine.org/,但我认为他们的文档并不是一个很好的起点.
我的应用中有两项活动,我在这些活动中展示了Google AdMob横幅广告.第一个活动运行良好,它也显示横幅广告,但每当我开始第二个活动时,它会生成强制关闭错误,说这些行随机
"找不到资源错误"
"由于错误2,谷歌播放服务不可用"
需要此"... "发现这个"......"
我已经仔细检查了代码,两个活动都是一样的,但无法解决问题.
任何帮助将不胜感激.
android banner andengine android-activity google-play-services