andengine

Top 5 scores from google leaderboard

时光总嘲笑我的痴心妄想 提交于 2019-11-28 22:07:25
My requirement is to get top 5 scores from leaderboard and display it in my app. There is a method loadTopScores but it shows the scores in its own UI i guess. mGamesClint.loadTopScores(new OnLeaderboardScoresLoadedListener() { public void onLeaderboardScoresLoaded(int arg0, LeaderboardBuffer arg1, LeaderboardScoreBuffer arg2) { // TODO Auto-generated method stub } }, LEADERBOARD_ID,LeaderboardVariant.TIME_SPAN_ALL_TIME , LeaderboardVariant.COLLECTION_PUBLIC, 5, true); So is there any way I can get individual data like Name and score..? Name 1 : Name of the top scorer 1 score 1 : score of the

Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1) error

↘锁芯ラ 提交于 2019-11-28 14:52:47
i am on a game project in android with andengine like FruitNinja in which i am using to throw images from bottom to top project is working fine but giving error this sometimes i used System.gc() but not helpful Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1) my code is private void throwHardware(final float pX, final float pY) { final FixtureDef boxFixtureDef = PhysicsFactory.createFixtureDef(0.1f, 0.5f, 0.5f); boxFixtureDef.filter.categoryBits = 0x0002; boxFixtureDef.filter.maskBits = 0x0004; boxFixtureDef.filter.groupIndex = 2; Random rng = new Random(); generated1 = new ArrayList<Integer>(

How to pass elements of an arrayList to variadic function

五迷三道 提交于 2019-11-28 11:55:05
I've got an arrayList filled with elements. I would like to pass the elements of that array list as arguments to a variadic function. My function public SequenceEntityModifier(final IEntityModifier... pEntityModifiers) My ArrayList ArrayList<IEntityModifier> arr = new ArrayList<IEntityModifier>(); arr.add(new MoveXModifier(1, 50, 120)); arr.add(new MoveXModifier(1, 120, 50)); I'd like to pass it to the function as if I would pass them individually. new SequenceEntityModifier( /* elements of arr here */ ); Is something like this possible? Thanks in advance. Brian Just do: new

Why I am Getting Error 'Channel is unrecoverably broken and will be disposed!'

扶醉桌前 提交于 2019-11-28 03:52:50
When I try to launch my AndEngine Activity , I get this error: ERROR/InputDispatcher(21374): channel '4122e148 my.package.AcGame (server)' ~ Channel is unrecoverably broken and will be disposed! The app doesn't crash, but there's a black screen and the device doesn't react to pressing the 'back' or 'home' buttons. Does anyone know what the problem is? One of the most common reasons I see that error is when I am trying to display an alert dialog or progress dialog in an activity that is not in the foreground. Like when a background thread that displays a dialog box is running in a paused

Top 5 scores from google leaderboard

走远了吗. 提交于 2019-11-27 21:04:43
问题 My requirement is to get top 5 scores from leaderboard and display it in my app. There is a method loadTopScores but it shows the scores in its own UI i guess. mGamesClint.loadTopScores(new OnLeaderboardScoresLoadedListener() { public void onLeaderboardScoresLoaded(int arg0, LeaderboardBuffer arg1, LeaderboardScoreBuffer arg2) { // TODO Auto-generated method stub } }, LEADERBOARD_ID,LeaderboardVariant.TIME_SPAN_ALL_TIME , LeaderboardVariant.COLLECTION_PUBLIC, 5, true); So is there any way I

Sprite size on different screen size Andengine Android

混江龙づ霸主 提交于 2019-11-27 19:53:19
` I am developing my first game in Android Adnengine. It's a racing game from top view. I used parallax background and some cars. I tested it on my device which is of smaller width and height. I placed the cars of with 32 and height 64 according to the camera width, height. It is working fine with my screen size but on larger screen sizes, like the Galaxy Tab, there is a huge space left behind in the game, because cars sizes remain the same as I have to use them in the power of two. How can I use images that fit all screen sizes? Do I have to use different images according to the image size

Android Custom Event Listener

别来无恙 提交于 2019-11-27 16:26:26
I'm using AndEngine and Box2d in android application. How to make my object "Player" to throw an event and the "GameScene" subscribes to it? public class Player { @Override public void Collision(GameObject object) { if(object instanceof Coin) { //throws an event here } } } public class GameScene { private Player player = new Player(); //catch the event here } You should use interface s. Make an interface something like: public interface Something { void doSomething(GameObject object); } Where doSomething is the method which will be called (In this case could be objectCollision ) same for

Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1) error

别来无恙 提交于 2019-11-27 09:06:20
问题 i am on a game project in android with andengine like FruitNinja in which i am using to throw images from bottom to top project is working fine but giving error this sometimes i used System.gc() but not helpful Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1) my code is private void throwHardware(final float pX, final float pY) { final FixtureDef boxFixtureDef = PhysicsFactory.createFixtureDef(0.1f, 0.5f, 0.5f); boxFixtureDef.filter.categoryBits = 0x0002; boxFixtureDef.filter.maskBits =

How to pass elements of an arrayList to variadic function

非 Y 不嫁゛ 提交于 2019-11-27 06:35:22
问题 I've got an arrayList filled with elements. I would like to pass the elements of that array list as arguments to a variadic function. My function public SequenceEntityModifier(final IEntityModifier... pEntityModifiers) My ArrayList ArrayList<IEntityModifier> arr = new ArrayList<IEntityModifier>(); arr.add(new MoveXModifier(1, 50, 120)); arr.add(new MoveXModifier(1, 120, 50)); I'd like to pass it to the function as if I would pass them individually. new SequenceEntityModifier( /* elements of

How do I apply a force to a body in the direction it is traveling (Box2D)?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 03:35:31
问题 I'm using AndEngine/Box2d to develop a game. I have a ball that bounces around the screen. I've successfully made it ignore gravity by applying an opposite force, but it has a tenancy to slow down after the initial impulse, even with the elasticity set to 1. Essentially I want to: if(speed < a number ) apply force or impulse (which is better?) in direction of motion How might I do this? 回答1: Well unfortunately, the ball is interacting with other objects so setting velocity did not work, but I