andengine

rendering sprites using texture region andengine

廉价感情. 提交于 2019-12-20 04:07:43
问题 Note that this is my first crack at Andengine. I have been playing around with libGdx as a potential for Android game development, but it doesn't suit my needs as I want to only develop for Android and having a 3D engine doing 2D work seems like overkill. I now want to try Andengine and see if it has what I need. The biggest problem with Andengine seems to be the complex naming scheme (I am more prone to typos when engine keywords are umpteen characters long. LibGdx had a simple naming

java.lang.IndexOutOfBoundsException: Invalid index 13, size is 13

时光总嘲笑我的痴心妄想 提交于 2019-12-19 22:08:52
问题 Im getting some weird error which crashing my android app. Its a quiz app. So when user answer 2/3 question correctly then click the next button this it crash. and show index 13 error. But i couldn't figure out where to fix/ look for. here is my code snippet. public Vector<Sprite> defaultTile; private void GameResults() { if(result.equals("right")) { GameOver(); Log.e("Gaa", "Right Here ->"); } } private void GameOver() { { for (int i = 0; i < defaultTile.size(); i++) { defaultTile.get(i)

ExceptionInInitializerError Physics World

喜夏-厌秋 提交于 2019-12-18 09:34:00
问题 I searched in a number of forums and it seems to be a common question. However i couldnt find a solution. I didnt do anything crazy so it seems stange that this happens. @Override protected Scene onCreateScene() { Scene s = new Scene(); PhysicsWorld mWorld=new PhysicsWorld(new Vector2(0, SensorManager.GRAVITY_EARTH),true); s.registerUpdateHandler(mWorld); final Sprite eliSprite = new Sprite(400, 240, james_walking[3], getVertexBufferObjectManager()); eliSprite.setScale(0.5f); s.attachChild

Weird Exception when Livewallpaper is set in Android

余生长醉 提交于 2019-12-18 09:01:19
问题 04-24 13:30:59.312: VERBOSE/RenderScript(6044): RS Thread exited 04-24 13:30:59.320: ERROR/libEGL(6044): call to OpenGL ES API with no current context (logged once per thread) 04-24 13:30:59.335: WARN/WallpaperService(6044): Ignoring updateSurface: destroyed 04-24 13:30:59.335: WARN/WindowManager(108): Window android.view.IWindow$Stub$Proxy@408968d0 is already added 04-24 13:30:59.355: DEBUG/dalvikvm(6083): GC_EXTERNAL_ALLOC freed 23K, 52% free 2598K/5379K, external 1625K/2137K, paused 55ms

What is maximum size of texture (Andengine)

ぐ巨炮叔叔 提交于 2019-12-18 08:23:35
问题 What is maximum size of texture that should be used in andengine. I used this.diamondTexture = new Texture(2048, 512, TextureOptions.BILINEAR_PREMULTIPLYALPHA); When loading in device(HTC G1 T-Mobile) it shows blank screen. After reducing the image size and when replacing the above line with this this.diamondTexture = new Texture(1024, 512, TextureOptions.BILINEAR_PREMULTIPLYALPHA); Its running . Whats the problem ? 回答1: Common approach - texture max size is 1024x1024. Some hi-end devices can

Cocos vs AndEngine for android [closed]

谁说我不能喝 提交于 2019-12-18 05:56:07
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 6 years ago . I want to make a game using Tiled Map Editor and I want to move the character around using a D-Pad for moving the character So I'm wondering which Engine would be better AndEngine or Cocos2d Keep in mind i'm a beginner at this so I'd like to stare at a lot of tutorials. :-D

How to not allow kinematic physics bodies to pass through static bodies?

本小妞迷上赌 提交于 2019-12-14 02:26:18
问题 My game scene consist of four walls, which are static bodies, and one platform plate, which is of type kinematic and slides only horizontally, something like the picture below. The platform body moves based on acceleration sensor, see this codes @Override public void onAccelerationChanged(AccelerationData pAccelerationData) { mPlatformBody.setLinearVelocity(pAccelerationData.getX() * 10, 0); } My problem is when the platform goes off the boundary walls, which it should not. For resolving this

How to create alert dialog with andengine

喜欢而已 提交于 2019-12-14 01:56:50
问题 I am developing game using andengine now i need is to create a alert dialog box i am using this case MENU_OPT: mEngine.runOnUpdateThread(new Runnable() { @Override public void run() { AlertDialog.Builder alert = new AlertDialog.Builder(GameActivity.this); alert.setTitle(""); alert.setMessage(""); alert.setPositiveButton("OK", new OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { } }); alert.show(); } }); break; but getting error java.lang.RuntimeException:

How to create “circles” in Box2D?

余生长醉 提交于 2019-12-13 23:51:59
问题 I want the circle with box2d in video. http://goo.gl/39Ff3 回答1: Did you check this site? There seems to be much tutorials. And don't forget the manual especially 4.2 Circle Shapes. Circle Shapes Circle shapes have a position and radius. Circles are solid. You cannot make a hollow circle using the circle shape. b2CircleShape circle; circle.m_p.Set(2.0f, 3.0f); circle.m_radius = 0.5f 来源: https://stackoverflow.com/questions/10264012/how-to-create-circles-in-box2d

Android AndEngine: Simple sprite collision

こ雲淡風輕ζ 提交于 2019-12-13 18:27:11
问题 I am new to AndEngine game development (or game development in general) and I am working on a very simple game. The setting is that I have 4 main sprites in the game: a.) Fighter Plane b.) Tank c.) Foot soldiers d.) Bomb The game is in a current infinite loop. The fighter plane comes out from the left, zooms across the screen and comes out the right again continuously every second. The Tank comes out from the left side of the screen, makes its way to the middle of the screen, drops off some