andengine

Progress bar while loading Textures in AndEngine

倖福魔咒の 提交于 2020-01-15 15:59:19
问题 when I start my game black screen comes for a while because resources are being loaded. I went thorough a tutorial which show how to show progress bar while leading resources I followed it and now I can see progress bar. But the problem is this when progress bar is visible every thing else is stopped. And nothing happens. Only a black screen and a progress bar on it. Can any one tell me why every thing is paused and why loadresources and loadscene methods are not working? Please provide a

Health for each enemy

孤者浪人 提交于 2020-01-15 12:27:06
问题 as my game progresses the enemies get stronger. To make the enemies stronger I made a private int called thealth (probably a bad programming choice) and each time the sprite is touched thealth--; until it reaches zero and the sprite is removed. This worked fine until I decided to have more than one sprite in my scene at a time. The problem I am having is that if this sprite has a thealth of two (for example)and I touch it, all the other sprites have their thealth--; too. So how can I give

Out of memory error when restarting app (Android)

爷,独闯天下 提交于 2020-01-13 11:05:24
问题 I am working on an game that uses 5 large images that are around 900x600. When I exit the game(press the back button) and then try to launch the game, I get the following error: 12-29 15:59:16.633: E/AndroidRuntime(18642): FATAL EXCEPTION: GLThread 17 12-29 15:59:16.633: E/AndroidRuntime(18642): java.lang.OutOfMemoryError: (Heap Size=20423KB, Allocated=3473KB, Bitmap Size=77KB) 12-29 15:59:16.633: E/AndroidRuntime(18642): at org.andengine.opengl.util.GLHelper.getPixelsARGB_8888(GLHelper.java

Attach canvas drawed line to scene in Android

好久不见. 提交于 2020-01-07 06:41:06
问题 I would like to attach a line drawed with canvas to a Scene. I'm using andengine library. I know that andengine provides line objects that can be draw and attached to a scene, but this is not an option for me because i'm trying to make a pretty glow line. This is how a andengine line is attached to the scene. public class MainActivity extends SimpleBaseGameActivity implements OnClickListener { //--Declaration and implementation of all overrides, etc.-- @Override protected Scene onCreateScene(

Throws file not found Exceptions

旧城冷巷雨未停 提交于 2020-01-06 22:45:57
问题 I created a gfx folder inside an android project's assets folder. I stored images which i will be using in my game for android. Since i need to pass the image height and image width converting it to the nearest highest powwer of 2 in andEngine, so i create a ImageUtility class to read image inside the gfx folder and get its height and width. package org.ujjwal.androidGameUtility; import java.awt.image.BufferedImage; import java.io.File; import java.io.FileNotFoundException; import java.io

Throws file not found Exceptions

余生颓废 提交于 2020-01-06 22:43:28
问题 I created a gfx folder inside an android project's assets folder. I stored images which i will be using in my game for android. Since i need to pass the image height and image width converting it to the nearest highest powwer of 2 in andEngine, so i create a ImageUtility class to read image inside the gfx folder and get its height and width. package org.ujjwal.androidGameUtility; import java.awt.image.BufferedImage; import java.io.File; import java.io.FileNotFoundException; import java.io

OpenGL stencil (Clip Entity)

核能气质少年 提交于 2020-01-06 19:49:24
问题 I am trying to use a sprite as clip-entity. This means I want that all it's child entities are clipped so that only the parts of the children that overlap the clip-entity (parent) are visible. I'm trying to do that using the OpenGL stencil function. On my emulator I got it working, but on my Android phone it doesn't. What am I doing wrong? GLES20.glEnable(GLES20.GL_STENCIL_TEST); GLES20.glClearStencil(0); GLES20.glStencilMask(1); GLES20.glClear(GLES20.GL_STENCIL_BUFFER_BIT); // pre draw

Android AndEngine problem with touch events

Deadly 提交于 2020-01-06 10:54:45
问题 I'm learning andEngine and trying to make a simple game based on some examples. My problem is that the game stops in some random moments and I can only use back button ;/ I used logcat and found problem, here's log: /release-keys' I/DEBUG ( 2656): pid: 4918, tid: 4926 >>> com.homework.mygame <<< I/DEBUG ( 2656): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 3f8191d 4 I/DEBUG ( 2656): r0 00000000 r1 00000000 r2 3f800000 r3 000191d4 I/DEBUG ( 2656): r4 00140a30 r5 00149978 r6 449d9b18

Set contact enabled in box2d andengine

放肆的年华 提交于 2020-01-06 08:39:17
问题 How to disable the contact between two bodies in box2d (Andengine). I have used contact.setEnabled(false) but this was not working for me. I have given code below for reference. @Override public void beginContact(final Contact pContact) { final Fixture fixtureA = pContact.getFixtureA(); final Body bodyA = fixtureA.getBody(); final Object userDataA = bodyA.getUserData(); final Fixture fixtureB = pContact.getFixtureB(); final Body bodyB = fixtureB.getBody(); final Object userDataB = bodyB

How to fall a sprite over another using And engine in android?

随声附和 提交于 2020-01-06 07:29:48
问题 Hi how can i put a one sprite over another sprite as seen in the image below as you can seen there is two sprite in the image (1).The sprite in the top should place over the sprite in the bottom as seen in the image (3).I tried some And engine example but did not get any solution yet .If any one know how to handle this problem please find some solution or any source.Thanks in advance Attaching code as per the edit public class MainActivity extends SimpleBaseGameActivity { // =================