_id
int64
0
49
text
stringlengths
71
4.19k
6
Should I used Box2D for a Flash platformer or use something for gaming like Fixel or Flashpunk? I'm trying to make a platformer with Flash AS3 and have been looking for something to help with some of the collision etc. I've look at a few engines and Box2D WCK seems the most sophisticated. Do I need that level of sophistication or should I just stick to something simple like Fixel or Flashpunk? OR should I just do everything myself?
6
How to apply numerical integration on a graph layout I've done some basic 1 D integration, but i can't wrap my head around things and apply it to my graph layout. So, consider the picture below if i drag the red node to the right, i'm forcing his position to my mouse position the other nodes will "follow" him, but how ? For Verlet, to compute the newPosition, i need the acceleration for every node and the currentPosition. That is what i don't understand. How to i compute the acceleration and the currentPosition ? The currentPosition will be the position of the RedNode ? If yes, doesn't that means that they will all overlap ? http i.stack.imgur.com NCKmO.jpg
6
How to bounce a 2d point particle off of a circular edge In a prototype I'm building, a particle can spawn anywhere within a larger, confining circle. Important to note is that the particle will not spawn in the origin of the larger circle, but anywhere within it. This particle will essentially be given a random x and y velocity and set on it's way. When the particle hits the edge of the confining circle, I want it to bounce back inwards appropriately. Unfortunately I'm extremely new to vector math, and have never really directly dealt with it before. Given that I'm treating the particle as a point, and I don't care about any loss of force or friction, what should I ultimately do to the particle's x and y velocities after the bounce? I will know the particle's x and y velocity, it's x and y coordinate when it hits the outer circle, the radius of the outer circle, and the x and y coordinates of the origin of the outer circle (since its origin will likely not be 0,0). My brief research on vector math tells me I need to find the normal velocity at the point where the particle hits the outer circle and then negate that, but unfortunately I'm not sure how to do that exactly.
6
Why do people like realistic' physics and graphics in games? If games are all about fun, then why do people tend to like realistic physics and graphics are good for games? Can you cite your source?
6
Precision problem when doing collision detection? I've got this problem, and I don't know what may be the cause of it. I finished reading this article on sphere triangle collision. My character (the sphere) stops before it reaches the triangle, and then over like 2 seconds it slowly reaches the "expected" spot where I really want it to stop. Thing is, I tried switching my whole algorithm from floats to doubles, and they problem stays. So I'm not really sure if that's a number precision problem, although after many debugging I think that there could be a problem with the precision of the next calculation (t0 and t1) Real signedDistToTrianglePlane trianglePlane.signedDistanceTo(colPackage gt basePoint) Real normalDotVelocity glm dot(trianglePlane.normal(),colPackage gt velocity) t0 ((Real) 1.0 signedDistToTrianglePlane) normalDotVelocity t1 ((Real)1.0 signedDistToTrianglePlane) normalDotVelocity Could the dot product function be a trap for precise calculations? (signedDistanceTo() uses glm dot as well) Here's my collision detection amp response algorithms. One last thing to note is that on page 47 in the article, the author uses a verySmallDistance number where he only updates some variables if distanceToCollision is bigger than it. I don't understand these lines. I've been struggling with this issue for a week now. Any help or idea on the subject will be highly appreciated!
6
Calculating collision of polygons Say I have a multitude of 2D polygons floating about on a plane. These polygons can have any side count and aren't necessarily regular. Assuming I know absolutely everything about the polygons (area, collision point, location, velocity, rotation, angular velocity... etc) how to I calculate what happens to two polygons after collision? I.e. what will their resultant velocities and angular velocities be after collision? If not an exact solution, what resources could help me learn how to accomplish this?
6
Discrepancy in Box2D Flash applied impulse I have two clients. Player A, and Player B. What Player B sees in his screen is a mirrored version of what Player A sees. This is a carrom game, hence the mirroring. Does anyone know why even if I have the same Impulse calculated for both of the clients, sometimes the resulting actions is different? The only difference is that the angle for Player B's impulse is inverted. Below is the snippet of the force calculation var angle data.originId ig.game.playerIndex ? data.angle invertRadAngle(data.angle) var dx (this.striker.powerMult data.powerDrag) (ig.game.boardControl.size.x Box2D.SCALE) Math.cos(angle) var dy (this.striker.powerMult data.powerDrag) (ig.game.boardControl.size.y Box2D.SCALE) Math.sin(angle) var force new Box2D.Common.Math.b2Vec2(Math.round(dx 100) 100, Math.round(dy 100) 100) this.striker.body.ApplyImpulse(force, this.striker.body.GetPosition()) Here's the function in charge of inverting the angle function invertRadAngle(angle) return angle Math.PI I am using ImpactJS's version of Box2D, hence the difference in syntax, but it should be the same with vanilla Box2D Flash
6
Check gap in 3d environnement I am in a 3d environnement, when I jump, i'm calculating the hitPoint of the end jump. I want to know when I jump, if there is a GAP between my initial point, and the end point. But I don't want to set any trigger in the Level Design... My Initial Idea is to do Raycast each 5 6 steps, but I wonder if this is too much cost effective. MayBe it isn't ?
6
Calculating required force for pushing a body to a desired position at once in Unity In a 3D world I simulate that a coin is being pushed over a plane (applying a force in his rigidbody where y axis 0) using a top down view. Some time ago but using Box2D, I was able to calculate the amount of force required to stop the coin in a desired position with just one push. Box2d js var fps 60 var groundFriction 0.01 var force new Box2D.Common.Math.b2Vec2(distance.x coin.box2dBody.GetMass() fps (groundFriction fps), distance.y coin.box2dBody.GetMass() fps (groundFriction fps)) coin.box2dBody.ApplyForce( force, coin.box2dBody.GetWorldCenter(), true ) In order to simulate the friction, during the update, I substracted the groundFriction(0.01) to the linearvelocity of the objects in movement in every frame. Now using Unity with a more complex physics engine I cant replicate the same. Unity3d Vector3 posFinal transform.position direction distFinal Vector3 distanceVecFinal posFinal transform.position float fps 1 Time.fixedDeltaTime 50 fps Vector3 force new Vector3(distanceVecFinal.x myBody.mass fps, 0, distanceVecFinal.z myBody.mass fps) myBody.AddForce(force) I think that in the final formula I should add the friction of the objects, but I am not sure how to do it. Maybe this is not the only thing that I should change. I need help pls! tl amp dr Calculate the required force for making move an object to a desired position in a plane with just one push.
6
I'm looking for a paper from Teknikus.dk I'm looking for this great paper about Verlet integration http www.teknikus.dk tj gdc2001.htm I've found this link on many websites, forums, blogs, everyone is recommending it ! The website is down for more than one week.
6
Using box2d with starling In my game I have a Main class in which i am initializing starling framework by passing Game class like below myStraling new Starling(Game , stage) In the game class I have Instances of Welcome class and InGame class these two classes extends starling.display.Sprite.I have a PhysicsHandling class seperately. Now i want to make instance of PhysicsHandling class in the InGame class. The physics handling class does not extend any class because it only does calculations. I have made its some variables public to position starling sprites accordingly. My question is. Is it the right way to integrate physics in starling Performance wise .I mean is there a better way to do that
6
Gravity and Jumping in Clickteam Fusion 2.5 So I'm currently building a bare bones functioning game that involves simple platforming. Quite literally a box moving left and right and jumping. I'm using Clickteam Fusion 2.5, and I know there's an option to assign platforming movement to an active object, but I honestly do not enjoy implementing that feature one bit. So instead I'm opting for simply adding or subtracting from the X and Y coordinates of the player object while the left and right arrow keys are held down for side scrolling movement. However, I have yet to figure out how to use this same method for jumping and gravity. I know being able to jump would be running an event that occurs after hitting a certain key, which takes in the current Y coordinate of the player and runs it through a parabolic formula. And then gravity would simply be constantly subtracting from (or I guess in Fusion's case, adding to) the current Y value of the player object while the frame is running. So the question simply is where and how do I implement these things in order to create jumping and gravity. I figure there's a correct syntax for a parabolic formula when creating an event after "jump" is pressed, but for the life of me I can't figure it out. As for gravity, I'm completely lost. I have managed to get down stopping movement when colliding when another object so that is not an issue. Thanks and appreciation in advance.
6
How long does the collision take? I want to simulate a simple force acceleration (rather than impulse velocity) physical world made up entirely of disks and I'm having an irritating problem with my physics. When two disks collide, I can calculate the changes in velocities quite easily using conservation of momentum and conservation of energy. Since this is going to be a force based simulation, I need to calculate the forces to apply. I thought I'd use the momentum impulse equality m v F t Sounds simple, except I don't know what to do with time( t). So I guess the question boils down to this how long does the collision take? Or rather, do the two objects stick together for a period of time ( t)?
6
How do I set an object's speed to arrive in X seconds? I want to move an object to a point in the game world, I have the distance value which is far the player should move. I want to complete the movement in X seconds. I have tried many equations and formulas to no success. Speed Distance Time This one doesn't seem to give me the right result. Thing is the game is updated 60 times a second and the movement is affected by delta time. I'm pretty sure I am not taking the framerate in consideration. What am I doing wrong? Edit This is how I calculate the speed int dst 500 int time 2 in seconds float speed dst time Doing it this way is making the movement instant and the game object is not traveling the distance in 2 seconds. Every frame each game objects gets updated this way p.x dir.x speed deltaTime p.y dir.y speed deltaTime The dir vector holds the direction of movement which is calculated on mouse click Vector2 dir new Vector2(mouseX, mouseY).subtract(objectX, objectY).normalize() Delta time calculation long time System.nanoTime() float deltaTime (time lastTime) 1000000000.0f lastTime time Please note The game object stops upon arrival.
6
Simple 2D Flight Physics with Box2D I'm trying to build a simple side scroller with an airplane being the player. As such, I want to build simple flight controls with simple but realistic feeling physics. I'm making use of cocos2D and Box2D. I have a basic system working, but just can't get the physics feeling correct. I am applying force to the plane (which is a b2CircleShape) based on the user's input. So, basically, if the user pushes up, body gt ApplyForce(b2Vec2(10,30), body gt GetPosition()) is called. Similarly, for down 30 is used. This works and the plane flys along with up down causing it to dive or climb. But it just doesn't feel right. There is no slowdown on climbs, nor speed up during dives. My simple solution is far to simple. How can I get a better feel for a plane climbing diving? Thanks!
6
Cocos2dx Chipmunk Fully elastic collision between moving bodies I'm using Cocos2dx and the built in Chipmunk physics engine, and currently I've got my PhysicsBodys' materials set up with Density 0 Restitution 1 Friction 0 in order to get fully elastic collision, and keep moving bodies moving at a constant speed. This works great if they collide against a static element, like a wall, not so much if they collide with other moving objects. I'm moving these bodies by applying an initial force Vec2 velocity moveDirection.getNormalized() moveSpeed myPhysicsBody gt getVelocity() Vec2 newForce myPhysicsBody gt getMass() velocity deltaTime myPhysicsBody gt applyForce(newForce) So I'm guessing that even though their materials would result in fully elastic collisions, the moving objects both carry an impact force, this modifies the resulting force into one with different magnitude? All these moving bodies have the same mass. Currently I'm manually catching the impact start and manually generating the resulting force in the right directing, and using the object's speed to apply it with the same previous magnitude, effectively overriding Chipmunk's collision resolution. Is this the best way to do this, or can I configure my bodies in a way that allows Chipmunk collision resolution to achieve the same effect? I'm a bit rusty on my physics.. heh..
6
Fixed timestep without physics? I read Gaffer's Fix Your Timestep article many years ago, and have since had the impression that game code should have a fixed timestep, with only non gameplay related tasks outside of that in the main loop. However, I recently reread the article, along with several others, and realized the emphasis is on physics. Which makes sense, but now I'm wondering if it only applies to physics. What about games which don't use a real physics simulation? People talk about 60fps games, doesn't that imply a fixed timestep? What about multiplayer where you have regular updates to and from the server? The only alternative I know of is variable rate with time delta, but that sounds like it wouldn't be any better, and less exact. What method is typically used?
6
Car movement in arcade racing game I am finishing a very basic 2D racing game with top down perspective. I can't get the appropriate formulas to make the movement of the cars fun and addictive... Do you have tips on how to achieve that arcade feeling a lot of games have? Do you know of any guide tutorial on this topic? Right now, these are the formulas I am using (speed changes linearly according to the user input) direction turnAmount.Value Vector3 pos Position new Vector3(speed.Value (float)Math.Cos(direction), 0, speed.Value (float)Math.Sin(direction)) I have tested other, more complex options but this is the best I have got so far...
6
How do I convert matrices intended for OpenGL to be compatible for DirectX? I have finished working through the book "Game Physics Engine Development 2nd Ed" by Millington, and have got it working, but I want to adapt it to work with DirectX. I understand that D3D9 has the option to use either left handed, or right handed convention, but I am unsure about how to return my matrices to be usable by D3D. The source code gives returning OpenGL column major matrices (the transpose of the working transform matrix shown below), but DirectX is row major. For those unfamiliar for the organization of the matrices used in the book r11 r12 r13 t1 r21 r22 r23 t2 r31 r32 r33 t3 0 0 0 1 r meaning the value of that element in the rotation matrix, and t meaning the translation value. So the question in short is How do I convert the matrix above to be easily usable by D3D? All of the documentation that I have found simply states that D3D is row major, but not where to put what elements so that it is usable by D3D in terms of rotation, and translation elements.
6
How to implement a configurable spring force to SpringJoint2D like SpringJoint does? I'm working in unity 5.3.4f1. Looking at the SpringJoint2D class I can't seem to find a similar "spring force" as in spring in SpringJoint. Is there any other way to make a spring stronger in SpringJoint2D? If not, the only option I see is to inherit the Joint2D parent class and build my own spring joint 2D.
6
How to apply numerical integration on a graph layout I've done some basic 1 D integration, but i can't wrap my head around things and apply it to my graph layout. So, consider the picture below if i drag the red node to the right, i'm forcing his position to my mouse position the other nodes will "follow" him, but how ? For Verlet, to compute the newPosition, i need the acceleration for every node and the currentPosition. That is what i don't understand. How to i compute the acceleration and the currentPosition ? The currentPosition will be the position of the RedNode ? If yes, doesn't that means that they will all overlap ? http i.stack.imgur.com NCKmO.jpg
6
Simple physics for modelling ship submarine movement for a first iteration of my sim, I need a very basic physics model for ship submarine movement. I'd guess it might be a good approach to use vectors here (ship heading but also considering sea states etc.). Basic acceleration and that stuff should be taken into account I do not need any 3D stuff...the 'client' for that 'ship movement' physics is only the 2D rendering of a navigation map. I've found some papers on the net but they are far too complex for my needs. Anybody does know some 'simplified' vector algorithms etc. for that? Thanks a lot. EDIT To be clear I do not want to simulate ship movement ocean physics in detail, because this is not the focus of my (naval) simulation. It 'just' must be somewhat believable in that sense that if you have different sea states(wind waves currents) that the vessel is somewhat believable influenced (on the navigation map) by those forces. The main issue for me is how I model calculate those forces (wind etc.) by simple vectors and (eg. for a given wind velocity like 50kn) in an easy way withouth studying physics ).
6
Fixing rootmotion by calculating a lerp force I have a json full of rotation and forward right force for rootmotion. The problem is the end position in the animations don't end on a straight line. You can see where I end up and what my desired position is. The problem is I can only add or subtract from the forward and right movement force. And the rotation of the character changes each frame. So I have to find a way to calculated a forward amp right force for current rotation to slowly lerp to the desired position while using the rootmotion data. I am working on unity
6
How to calculate falling and accelerating velocity? I'm thinking of making a lander game, where you control a spaceship and need to land it without crashing. What is a simple formula to calculate speed of falling or acceleration with relation to working time to time engines?
6
Calculating the bouncing ball bounce height while on platforms I tried to calculate the bounce height for the bouncing ball however it ends up shaking against the moving platform after it finishes bouncing. grav val in this case is 0.1872 to prevent it to shake from normal surfaces after it finishes bouncing as a temporary fix. yspeed max(0,(rounding(abs((yspeed platform) 2) (grav val) , 0.1)) platform) What the rounding function does is just rounds by a factor of whatever the second argument's number is. return (input factor) factor Finally, platform is the vertical speed of the platform that moves up, so let's hypothetically say it's in the speed of two for example platform 2 So, basically I want it to fully diminish until it hits to zero regardless of yspeed adding itself because it does right now due to gravity and the platforms. Rewrites or new methods would be appreciated.
6
How can I add an impulse to specific rigid bodies at rest? Scenario Rocks falling down a rocky slope, with a flat surface at the bottom. When they land on the surface, the rocks move slightly before coming to a rest. GLESDebugDraw shows the bright orange outline turning to a slightly darker orange once a rock comes to a rest, until the rock is agitated by another falling rock. Question I would like to add an impulse to the rock once it reaches the rest state. How would I implement that?
7
Performance problems with many entities in AndEngine I'm developing a rolling scene based game. I'm loading all the entities from a XML file and create them in the Loading Scene. I recently increased the game width, and, by doing so, I now have about 300 entities (instead of about 100) in the whole level. This causes a performance problem the game is "Lagging" "jumping" and everything moves slowly. I'm loading the entities with the "LevelLoader". I tried to add levelObject.setCullingEnabled(true) before returning the object in public IEntity onLoadEntity(final String pEntityName, final Attributes pAttributes) ... and also set Dithering in the engineOptions engineOptions.getRenderOptions().setDithering(true) but it didn't help... I'm implementing the sprite created from XML as Matin does in his tutorial http www.matim dev.com full game tutorial part 11.html Is there a better way to handle such a high number of entities? Or is there another way to improve the performance?
7
Cocos2dx Touch not recognized on Android I'm having trouble with a touch listener not picking up touch events on android, but doing fine in windows (mouse input). I've got a Node listening for touches (not a Layer), but from what I've been seeing around it seems having it on a Layer isn't a requirement anymore? Setup void DodgePlayerController setupPlayerInput() CCLOG("DodgePlayerController setupPlayerInput()") if (myPawn) Pellet myPellet dynamic cast lt Pellet gt (myPawn) if (myPellet) CCLOG("DodgePlayerController setupPlayerInput() !!2!!") setup the player input and events (should build some sort of player controller) auto listener EventListenerTouchAllAtOnce create() listener gt onTouchesBegan CC CALLBACK 2(Pellet setTargetPosition, myPellet) listener gt onTouchesMoved CC CALLBACK 2(Pellet setTargetPosition, myPellet) listener gt onTouchesEnded CC CALLBACK 2(Pellet clearTargetPosition, myPellet) listener gt onTouchesCancelled CC CALLBACK 2(Pellet clearTargetPosition, myPellet) auto dispatcher getEventDispatcher() dispatcher gt addEventListenerWithSceneGraphPriority(listener, this) When logging on Android, I'm getting through both CCLOG messages correctly (I have a 'disablePlayerInput()' which isn't being called, so the listener shouldn't be removed). This all works fine in the windows application, but when I load it in Android the touches aren't picked up (Pellet setTargetPosition also has a log message which doesn't get thrown in android). Anyone know what I might be missing?
7
Using Unity3D from within Eclipse Is it possible to use Unity3D from within Eclipse? I've seen that I can import a Unity3D project into Eclipse, but I cannot seem to be able to access classes such as Terrain or Ray. I don't know if that's because I haven't imported the correct libraries or if that's a limitation and that data can only be accessed by methods within Unity3D. I am designing an Android game within Eclipse and would prefer to use Eclipse than Unity3D, even if that means my game will only be available for Android. The only real reason I'm using Unity3d is for use of the 3D terrain and to hopefully help in getting the data, such as slope, terrain type, collisions, etc.
7
Units of measurement in a tile world I've started to make a 2D sidescroller, the camera and world rendering works as I expect, but now comes the physics part of world. What I need is that one tile in x or direction should correspond to 1 meter. Since I have a variable time step (Android mobile game), I can't figure it out, since the timing and velocity always will be dependent of the device. So, is there any good way to make one tile to correspond 1 meter? This would be good, otherwise the physics implementation would later be weird.
7
Slowdown in sliding background with Libgdx I m new with libgx and i have a basic question. I want an background like an image that repeats indefinetely, and moves down. I did with 2 images and it worked, but the problem is that is very slow. I stored the images with 512x512px. My code is very simple but i dont know what im doing wrong. public void render() Gdx.gl.glClearColor(0, 0, 0.2f, 1) Gdx.gl.glClear(GL20.GL COLOR BUFFER BIT) offset 600 Gdx.graphics.getDeltaTime() offset offset 512 camera.update() batch.setProjectionMatrix(camera.combined) batch.begin() batch.draw(backgroundImage, 0, offset) batch.draw(backgroundImage, 0, offset 512) batch.draw(bucketImage, 0, offset 1024) batch.end() Any suggestions will be appreciated Thanks a lot!
7
Relationship between Desktop and Android on LibGDX So I finished tweaking a tutorial called Rain Catcher and I ran the desktop application. It works fine. I then proceeded to run the application using the android emulator the game then crashes. I set up the project using libGDX's project set up. Why won't it run properly on the android emulator even though it runs fine on the desktop application? I don't know if you can see it but if you zoom you would be able to see it easier.
7
How is it possible to use Android libraries in libGDX? I want to make an android application game that uses both android API like Location, even Google Maps API and also use libGDX framework as well. How is this possible? I noticed there's an Android and a core folder created when making a libGDX project, where do all the classes go, but I'm very confused.
7
Using LibGDX within Android Fragment I want to use LibGDX with Android, but instead of modifying my Activity to extend AndroidApplication I want my to render my graphics inside Android Fragment The problem is that my class already extends Fragment, so I can't make it extend LibGDX AndroidApplication (Multiple Inheritance) is there any workaround for this ? Thanks
7
Marmalade SDK views navigation concepts I want to develop a simple multi Activity Android game using Marmalade SDK. I looked at the SDK samples and found that most of them are a single view (Android Activity) apps. The Navigation model in Android is a stack like model where views are pushed and popped. I can't find whether Marmalade has a similar model or it uses a different approach. would you please explain this to me and provide tutorials and samples to navigation in Marmalade if possible ? Thanks
7
Reloading Resources on Resume I'm having a problem with my game. If I press the "Home button" the game is paused... everythings fine, but if I then go back to the game all the resources are reloaded before I can continue the game. And it takes quite a bit. Is this normal, or is there a way to avoid the reloading? I have write following code in onResume and onPause method. It loads same texture again and again on resume of game. Override protected void onPause() super.onPause() if (Utility.flagSound amp amp mScene ! null) if (mScene.getUserData().equals(Constants.GAME SCENE)) Utility.isPlayLevelMusic false else Utility.isPlayLevelMusic true audioManager.gameBgMusic.pause() audioManager.levelBgMusic.pause() if (this.mEngine ! null amp amp this.mEngine.isRunning()) this.mEngine.stop() Override protected void onResume() super.onResume() if (audioManager ! null amp amp Utility.flagSound amp amp dataManager ! null) if (Utility.flagSound) if (Utility.isPlayLevelMusic) audioManager.levelBgMusic.play() else audioManager.gameBgMusic.play() if (this.mEngine ! null amp amp !this.mEngine.isRunning()) this.mEngine.start() I would be glad if anybody could help...
7
Do I need a company name to publish on Google Play? I'm going to upload my Android mobile game on Google Play. But it seems like all games are developed by companies(such as Zynga, and King) and I don't see individual's names as developers. Do I need to register a company name officially? I think it costs a few hundred dollars... If I have to, how and where do I register? or instead of registering a company for a few hundred dollars, if I make a domain website that is named as my company name, would it provide me some protections? Also, do I need to trademark my game's title as well? Thanks!
7
Counting multiple touches using Cocos2dx 3.2 I'm trying to count the number of active touches in screen in order to perform an an action in case that there are two touches auto jumpListener EventListenerTouchAllAtOnce create() jumpListener gt onTouchesBegan (const std vector lt Touch gt amp touches, Event event) CCLOG("Multi touch detected d", touches.size()) if(touches.size() 2) this gt player gt jump() But even if I'm touching with two fingers, I get that only 1 touch has been made, any suggestions?
7
Run Love2D on iphone and android I have a game developed in lua using love 2d, and now i want to run it in ios android. Is there any porting or way available to do that. Thanks.
7
How do you increase the spacing on text within LibGDX labels So I'm following along with some tutorials for creating an application with LibGDX, and when I go to print parts of the UI to the screen, the text is all bunched up. How do I increase the spacing, or is it due to something else I've done? .... game gam stage new Stage(new StretchViewport(800, 400)) Gdx.input.setInputProcessor(stage) uiSkin new Skin(Gdx.files.internal("uiskin.json"), new TextureAtlas(Gdx.files.internal("uiskin.atlas"))) Label nameLabel new Label("Name ", uiSkin) TextField nameText new TextField("", uiSkin) Label addressLabel new Label("Address ", uiSkin) TextField addressText new TextField("", uiSkin) table new Table() table.add(nameLabel).expandX() table.add(nameText).width(200) table.row() table.add(addressLabel) table.add(addressText).width(200) table.setFillParent(true) stage.addActor(table) table.setDebug(true)
7
Resolution Independence in libGDX How do I make my libGDX game resolution density independent? Is there a way to specify image sizes as "absolute" regardless of the underlying density? I'm making a very simple kids game just a bunch of sprites displayed on screen, and some text for menus (options menu primarily). What I want to know is how do I make my sprites fonts resolution independent? (I have wrapped them in my own classes to make things easier.) Since it's a simple kids game, I don't need to worry about the "playable area" of the game I want to use as much of the screen space as possible. What I'm doing right now, which seems super incorrect, is to simply create images suitable for large resolutions, and then scale down (or rarely, up) to fit the screen size. This seems to work okay (in the desktop version), even with linear mapping on my textures, but the smaller resolutions look ugly. Also, this seems to fly in the face of Android's "device independent pixels" (DPs). Or maybe I'm missing something and libGDX already takes care of this somehow? What's the best way to tackle this? I found this link is this a good way of solving the problem? http www.dandeliongamestudio.com 2011 09 12 android fragmentation density independent pixel dip It mentions how to control the images, but it doesn't mention how to specify font image sizes regardless of density.
7
Word game board implementation? I'm working on a boggle type game for android, using libgdx. The user is presented with a 4x4 grid of letters and must find words by dragging their finger over the letters. Unlike boggle I want used letters to disappear. Remaining letters will fall down (to the bottom of the board, screen orientation is fixed) and the board is refilled from the top. Users can rotate the board to try and put hard to use letters in a better place by strategic word selection. An example d g a o u o r T h v R I d G n a If i selected the word GRIT, those letters would disappear and the remaining fall down d u g a h o r o d v n a and then get replaced by new letters d w x y u g a z h o r o d v n a I'm stuck figuring out how to represent the board and tiles. I tried representing the board as a matrix to keep track of tiles selected and valid moves and the tiles stored in a matrix as well so that there was an easy mapping. This works, but I had to write some convoluted code to rotate the board. How do other games handle this problem? EDIT So thinking about it, I should really just process my touch point according to the board rotation so cells stay constant. Attached an image of what I'm thinking.
7
How to make ranked matches in a head to head multiplayer game? I am working on a field hockey like game for Android and iOS. Currently I support being able to play against another player online in a client server fashion where one device host and the other provide an IP address. I would like to be able to have ranked matches that are recorded in something like Amazon's GameCircle or something similar. For recording the win loses I thought having one leaderboard for wins, one leaderboard for loses and perhaps another leaderboard for amount of games in progress... That is assuming I can read the leaderboard result for each player which I think I can. Other than that, there are many issues in how to have ranked matches. I am guessing the biggest difficulty is actually being able to have a client server session since most devices are not set up to have a direction communication with another device? What are your suggestions for having ranked matches given no extra server? And what are your suggestions given my own server?
7
How do I check for collision between an ellipse and a rectangle? I am working on LibGdx framework for developing a 2D isometric tower defense game.All my sprites are drawn in 2D isometric view. I have used an array list to store 8 points at boundary in the rectangle.LibGdx has an inbuilt function (returns Boolean) ellipse.contains(x,y),by iterating through array list I can check whether any points are inside ellipse But the problem is as shown in below picture,it wont detect the enemies in some particular cases So my question is 1)Is this a correct approach for solving these kinds of problems 2)If not can you suggest better approach for solving this problem Thank you.
7
Java code to get android phone hardware specs Is there code available to view the specs of a phone that is running your application?
7
Android TV game development Anybody develop games for Android TV? Especially with libGDX? I would like to know what game controllers Android TV uses? And whether we can use libGDX to control the game controllers?
7
Disable autorotation if Android has it disabled I'm making a game for Android in Unity. I wanted the game to handle screen rotations, so I set "Default Orientation" to "Auto Rotation. This works well, except for one issue If you disable auto rotation in the device's settings, the game ignores this and keeps autorotation. How would I go about making it disable autorotate when the Android device is set to disable autorotate?
7
No sound in android using Phaser I have developed a simple game using Phaser. It's work perfect on ios webkit, but on android there is no sound. What causes this problem on one platform but not the other? We are using this code to load this.load.audio('game audio', 'audio bgm.mp3') Playing this.music this.add.audio('game audio') this.boom.play()
7
Changing background images frequently within a specific time range with Cocos2D I am working on a game development project for Android. We use the Cocos2d framework. I have to design a page which contains two background images, I need to switch these images repeatedly within 1sec. How can I do this? How can I use CCTransitionScene in my Java code and change these images repeatedly? Thanks in advance.
7
Amazon GameCircle Integration I'm trying to integrate Amazon GameCircle and I have been able to successfully initialize GameCircle in my app, but the problem is when I click on the button that displays achievements, the GameCircle achievement list comes up but it says "You have unlocked 0 of 0 achievements". Same happens with leaderboards i.e there are no leaderboards for this app. I have created a Leaderboard and a few achievements on the online developer portal for Amazon but they don't show for some reason. Can someone help me with this. Any links resources that help with integrating GameCircle will be appreciated. Thanks.
7
How to make Box2D bodies automatically return to a initial rotation I have two long Box2D bodies, that can collide while moving one of them around with MouseJoint. I want them to try to hold their position and rotation. Blue body is moved using MouseJoint (yellow) towards the Red body. Red body has another MouseJoint Blue can push Red, but Red will try to return to the start point thanks to the MouseJoint this works just fine. Both bodies correctly rotate along the middle. This is still as I want. I change the MouseJoint to move the Blue away. What I need is both bodies return to their initial rotation (green arrows) Desired positions and rotations Is there anything in Box2D that could do this automatically? The MouseJoint does that nicely for position. I need it in AndEngine (Java, Android) port, but any Box2D solution is fine. EDIT By automatically I mean having something I can add to the object "Paddle" without the need to change game loop. I want to encapsulate this functionality to the object itself. I already have an object Paddle that has its own UpdateHandler which is being called from the game loop. What would be much nicer is to attach some kind of "spring" joint to both left and right sides of the paddle that would automatically level the paddle. I will be exploring this option soon.
7
Orthogonal projection matrix affecting z buffer on one device I am experimenting using Matrix.orthoM for a isometric projection, rather than Matrix.frustumM. On one device, the z buffering does not appear to be working correctly and I get a cut away effect seen below on the wheels in particular. Both devices work fine with frustum projection. Sorry not much to go on, just hoping someone will just be able to take one look and recognise the problem. Sony Xperia Z LG P920 Sony Xperia Z LG P920
7
How to create multiple balloon bodies in Box2D? In Box2D, how would I go about making a body that's being lifted by multiple "balloons"? These balloons would have to be able to be destroyed (for example, by a bow and arrow).
7
How well does Unity 3d work for both Android and iPhone? First off this question might be a bit broad so I apologize if it is. I am really just looking for peoples experiences and personal knowledge on the subject. I am looking to create a game for both Android and iPhone platform. I know Unity is a great game engine and my question is how well does it work for creating one code base to build for both Android and iPhone platforms? Time is a constraint on this project so I am very interested in how smoothly the process usually is when trying to build both applications and how much custom code must be written for each specific application. Any insite that people have on this topic would be much appreciated thanks.
7
Detect if a sprite has left the camera in libgdx? Is there a method to know if a sprite has left the camera of the stage? or I have to do my operations? P
7
TurnBasedGame with libGDX Google Play Services I'm trying to write a small card game for Android using libgdx framework. My game is turn based. I wrote to interface with the necessary methods to access the API interface from Google. I faced the problem after I called Games.TurnBasedMultiplayer.createMatch(gameHelper.getApiClient(), tbmc) I got the result of the callback. If initiateMatchResult.getMatch().getData() is null I am initiating games data, and here's the PROBLEM I don't know how to go back in GameScreen??? This is piece of code in AndroidLauncher Games.TurnBasedMultiplayer .createMatch(gameHelper.getApiClient(), tbmc) .setResultCallback(new ResultCallback lt TurnBasedMultiplayer.InitiateMatchResult gt () Override public void onResult( NonNull TurnBasedMultiplayer.InitiateMatchResult initiateMatchResult) if (!initiateMatchResult.getStatus().isSuccess()) gameHelper.showFailureDialog() return TurnBasedMatch match initiateMatchResult.getMatch() if (match.getData() ! null) Log.d("MyLogs", "match not null") initGame() myGame.setScreen(myGame) ) If just call myGame.setScreen(new GameScreen(myGame)) is the GameScreen displaying is not correct. In GameScreen I have table and images in this table and the images displaying is not correct!!! This code of my GameScreen public class GameScreen implements Screen final MyGame myGame private Stage stage private Table table private Image card1, card2, card3, card4, card5, card6 public GameScreen(MyGame myGame) this.myGame myGame stage new Stage() Gdx.input.setInputProcessor(stage) card1 new Image(new Texture(Gdx.files.internal("1.png"))) card2 new Image(new Texture(Gdx.files.internal("2.png"))) card3 new Image(new Texture(Gdx.files.internal("3.png"))) card4 new Image(new Texture(Gdx.files.internal("4.png"))) card5 new Image(new Texture(Gdx.files.internal("5.png"))) card6 new Image(new Texture(Gdx.files.internal("6.png"))) table new Table() table.setFillParent(true) table.setDebug(true) table.add(card1).width(140).height(202).padLeft(15).padRight(15).padBottom(10) table.add(card2).width(140).height(202).padBottom(10) table.add(card3).width(140).height(202).padLeft(15).padRight(15).padBottom(10).row() table.add(card4).width(140).height(202).padLeft(15).padRight(15) table.add(card5).width(140).height(202) table.add(card6).width(140).height(202).padLeft(15).padRight(15).row() stage.addActor(table) Override public void show() Override public void render(float delta) Gdx.gl.glClearColor(0, 0, 0, 1) Gdx.gl.glClear(GL20.GL COLOR BUFFER BIT) stage.act(delta) stage.draw() Override public void resize(int width, int height) Override public void pause() Override public void resume() Override public void hide() Override public void dispose() stage.dispose() mySkin.dispose() dixit.getScreen().dispose() SCREENSHOT BELOW this screenshot shows how to display images in my table Tell me what my mistake and what am I doing wrong? Can anyone advise how best to do otherwise??
7
OpenGL ES 2.0 Best Practices Architecture Guide I've recently started working with OpenGL (ES 2.0) on the Android. While there is lots of documentation about the basics, I can't seem to find much about the overall architecture of OpenGL. In particular, while I see how a Program works, shaders are linked, and vertices are loaded, I can't find any indication of how this should be used to create entire scenes. That is, does one create multiple programs, reuse the programs, create multiple indexes, try to share textures shaders, etc. What I'm looking for are some solid references that explain the trade offs, and intended use, of these functions in the production of scenes. The various Android docs, and OpenGL docs also hint at several limitations in using the API, but don't give concrete information in many cases. I understand this may be a bit subjective, but I really can't find anything useful on this topic by searching. I'm unsure where else to ask and I believe that concrete useful answers can be given.
7
Integration of LibRocket and Android I am using OpenGL ES 2.0 to create a 2D game for Android 2.2 and was planning on using LibRocket for the GUI. Does anyone have any links or knowledge they would share on how to integrate LibRocket with the android platform? I know that it is a c library that would need to go through the NDK, however I rather not change my OpenGL rendering code to the NDK unless I have to.
7
TurnBasedGame with libGDX Google Play Services I'm trying to write a small card game for Android using libgdx framework. My game is turn based. I wrote to interface with the necessary methods to access the API interface from Google. I faced the problem after I called Games.TurnBasedMultiplayer.createMatch(gameHelper.getApiClient(), tbmc) I got the result of the callback. If initiateMatchResult.getMatch().getData() is null I am initiating games data, and here's the PROBLEM I don't know how to go back in GameScreen??? This is piece of code in AndroidLauncher Games.TurnBasedMultiplayer .createMatch(gameHelper.getApiClient(), tbmc) .setResultCallback(new ResultCallback lt TurnBasedMultiplayer.InitiateMatchResult gt () Override public void onResult( NonNull TurnBasedMultiplayer.InitiateMatchResult initiateMatchResult) if (!initiateMatchResult.getStatus().isSuccess()) gameHelper.showFailureDialog() return TurnBasedMatch match initiateMatchResult.getMatch() if (match.getData() ! null) Log.d("MyLogs", "match not null") initGame() myGame.setScreen(myGame) ) If just call myGame.setScreen(new GameScreen(myGame)) is the GameScreen displaying is not correct. In GameScreen I have table and images in this table and the images displaying is not correct!!! This code of my GameScreen public class GameScreen implements Screen final MyGame myGame private Stage stage private Table table private Image card1, card2, card3, card4, card5, card6 public GameScreen(MyGame myGame) this.myGame myGame stage new Stage() Gdx.input.setInputProcessor(stage) card1 new Image(new Texture(Gdx.files.internal("1.png"))) card2 new Image(new Texture(Gdx.files.internal("2.png"))) card3 new Image(new Texture(Gdx.files.internal("3.png"))) card4 new Image(new Texture(Gdx.files.internal("4.png"))) card5 new Image(new Texture(Gdx.files.internal("5.png"))) card6 new Image(new Texture(Gdx.files.internal("6.png"))) table new Table() table.setFillParent(true) table.setDebug(true) table.add(card1).width(140).height(202).padLeft(15).padRight(15).padBottom(10) table.add(card2).width(140).height(202).padBottom(10) table.add(card3).width(140).height(202).padLeft(15).padRight(15).padBottom(10).row() table.add(card4).width(140).height(202).padLeft(15).padRight(15) table.add(card5).width(140).height(202) table.add(card6).width(140).height(202).padLeft(15).padRight(15).row() stage.addActor(table) Override public void show() Override public void render(float delta) Gdx.gl.glClearColor(0, 0, 0, 1) Gdx.gl.glClear(GL20.GL COLOR BUFFER BIT) stage.act(delta) stage.draw() Override public void resize(int width, int height) Override public void pause() Override public void resume() Override public void hide() Override public void dispose() stage.dispose() mySkin.dispose() dixit.getScreen().dispose() SCREENSHOT BELOW this screenshot shows how to display images in my table Tell me what my mistake and what am I doing wrong? Can anyone advise how best to do otherwise??
7
What is wrong with my collision detection code? I want to check collision detection between two bitmaps but I am not getting how to do it. I read several queries and tutorials but didnt get properly. I want to check by their width and height. I have implemented some logic also but not getting where I am doing wrong public boolean collision() for(int i 0 i lt 9 i ) for(int j 0 j lt 14 j ) if(frog.getX() lt x getX() frog.getY() lt y getY() frog.getX() gt x frog.getY() gt y) if(other.getWidth() gt x amp amp other.getWidth() lt x width amp amp gt other.getHeight() gt y amp amp other.getHeight() lt y height) frog.frogShiftDown() return true public void draw(Canvas canvas) canvas.drawBitmap(bmp, x, y,null) carmove() collision()
7
How can set vibration option with my game in android? I am using AndEngine to develop an Android game and I want vibration to be triggered when an enemy hits a player. How can I implement this into my game?
7
LibGDX I need to get from SpriteBatch to Batch in order to draw a Touchpad I have created a little game using LibGDX and it uses a SpriteBatch when it renders the game objects. Now I want to add a Touchpad to it, and the draw method of Touchpad takes a Batch as a parameter, but my game uses SpriteBatch. What can I do?
7
Advantages and disadvantages of libgdx I've been an android developer for a while and am thinking about getting into gaming. While looking for a game dev framework, I thought libgdx provides very friendly documentation and functionality. So I would like to use it if there is no big obstacle. But when I tried to see how many developers employ this library, I could find not that many. Is there anything wrong with this library? In other words, I would like to know its advantages or disadvantages from any experienced developer. UPDATE After reviewing its documentations and trying to build simple games with libgdx, I decided to go with it as its documentations are good enough and its community is very active. What I liked the most is that it provides a bunch of demo games that I can learn a lot from.
7
How do I change my gravity and jumping logic to put the character at a specific height at a specific point in time? I'm making a 2D platformer on Android using libGDX. One thing I've had a problem with recently is gravity and jumping. I found a few tutorials on the internet and was able to come up with this... public static final int JUMP HEIGHT 64 public static final float JUMP GRAVITY 6.0f public static final float MAX GRAVITY 20.0f public static final float GRAVITY 19.0f private void updateGravity(float delta) if(Gdx.input.isTouched() amp amp !jumping) jumping true gravity Config.JUMP GRAVITY if(jumping) change frame to jump sprite.setRegion(walkFrames 0 ) sprite.translate(0, ( 1 gravity)) runner has landed? if(sprite.getY() lt idleY) jumping false sprite.setPosition(Config.RUNNER X, idleY) slowdown fall if (gravity lt Config.MAX GRAVITY) gravity Config.GRAVITY delta The code works and my character will jump and fall smoothly. Although the time it takes for him to jump and comedown is independent from delta the height he jumps is not. If the device lags while jumping he will jump only a portion of how high he should. For the life of me I cannot get it to make sure it jumps a specific height (JUMP HEIGHT) and in a specific time independent of the delta.
7
AndEngine Font Issue I am learning AndEngine. I am displaying Hello world using this code public class myactivity extends SimpleBaseGameActivity private final int CAMERA WIDTH 320 private final int CAMERA HEIGHT 480 private Camera m Camera private Scene m Scene private Font font private Text text Override public EngineOptions onCreateEngineOptions() m Camera new Camera(0, 0, CAMERA WIDTH, CAMERA HEIGHT) EngineOptions en new EngineOptions(true, ScreenOrientation.PORTRAIT FIXED, new RatioResolutionPolicy( CAMERA WIDTH, CAMERA HEIGHT), m Camera) return en Override protected void onCreateResources() determine the density WindowManager windowManager (WindowManager) getSystemService(WINDOW SERVICE) Display display windowManager.getDefaultDisplay() DisplayMetrics displayMetrics new DisplayMetrics() display.getMetrics(displayMetrics) int density (int)(displayMetrics.density) scale desired size 25 by density int fontSize (int) (25 density) font FontFactory.createFromAsset(this.getFontManager(), this.getTextureManager(), 1024, 1024, this.getAssets(), "times.ttf", fontSize, true, android.graphics.Color.BLACK) font.load() Texture fontTexture new BitmapTextureAtlas(1024, 1024, TextureOptions.BILINEAR PREMULTIPLYALPHA) font new Font(fontTexture, Typeface.create(Typeface.DEFAULT, Typeface.NORMAL), fontSize, true, Color.WHITE) mEngine.getTextureManager().loadTexture(fontTexture) mEngine.getFontManager().loadFont(font) Override protected Scene onCreateScene() m Scene new Scene() m Scene.setBackground(new Background(Color.WHITE)) text new Text(0, 0, font, "Hello Android", this.getVertexBufferObjectManager()) m Scene.attachChild(text) text.setPosition(CAMERA WIDTH 2 (text.getWidth() 2), CAMERA HEIGHT 2 (text.getHeight() 2)) return m Scene It is displaying the font like this As you can see that pixels are stretching and font is looking ugly with too much pixelation. How do I display proper font text with no pixelation or add anti aliasing to the font?
7
Android multiplayer via bluetooth How do I transfer game commands between 2 android devices via bluetooth first of all is possible to do this??If possible then someone please help in doing so.Thank u
7
LibGdx set TextButton font to a TrueTypeFont I am making my first LibGdx game, and having an hard time understanding font scaling on TextButtons. Here is a comparison between the rendering on my Kindle Fire 7 and an high resolution tablet I tried using the scale() method, but the result is a pixelated mess. I've read about TrueType fonts, and I'd like to set the font size by calculating the screen density. I've tried to create a TextButtonStyle containing a font with the following Generate the font FreeTypeFontGenerator generator new FreeTypeFontGenerator(Gdx.files.internal("fonts Merriweather Regular.ttf")) TextButtonStyle style new TextButtonStyle() FreeTypeFontParameter param new FreeTypeFontParameter() Set the font size (12 as an example) param.size 12 style.font generator.generateFont(param) Set the new style to the button button new TextButton("START GAME", style) The TextButton correctly gets the new font, BUT loses the actual button as only the text gets rendered I guess that's because the new TextButtonStyle only contains information about the font and is otherwise empty. I tried setting the new font to a Skin also, but only ended with further confusion most resources I found online don't mention font rendering on TextButtons, or end up being confusing with convulted methods. Is there a simple way to achieve what I want? Thanks.
7
box2d rendering performance degrading extremely even with sleeping bodies? I'm working on my first smartphone game, a simple 2D platformer built with libgdx. Game maps use the Tiled level format, so a map is just a bunch of blocks. I recently started using box2d to implement character collision and movement. So this is probably naive, but what I did is for a level consisting of 64x50 ( 3200) blocks, I added a static body for every block to represent the physics for this geometry. I set these blocks to sleep, which I thought would be a hint for box2d to disregard these blocks when stepping the simulation unless they're actually interacting with the player (the only dynamic body), so this shouldn't hinder performance very much? I recall reading in the box2d manual that it employs a spatial algorithm to only even look at the bodies relevant to render the current frame. Yet having these 3500 sleeping static bodies degrades performance to such a degree that even when running the game on my MacBook Pro 2012 in a Genymotion emulator, I get about 5 FPS. I suppose I'm doing something terribly wrong. My questions would be when dealing with bodies in the thousands, am I supposed to remove add box2d bodies for my level geometry dynamically to improve performance, e.g. based on a fixed box around the player? that sounds painful and I'm wondering why the library wouldn't be able to figure out itself maybe I've just made a mistake mapping map tiles to box2d bodies? I've posted my setup code below Any help appreciated. Here's how I attach the static bodies to the level geometry it just walks the map and creates a static body for every block private void addB2Bodies(World b2World) for (int row 0 row lt blocksLayer.getHeight() row ) for (int col 0 col lt blocksLayer.getWidth() col ) BodyDef bodyDef new BodyDef() bodyDef.type BodyDef.BodyType.StaticBody bodyDef.awake false bodyDef.position.set(col 0.5F, row 0.5F) final PolygonShape shape new PolygonShape() shape.setAsBox(0.5F, 0.5F) FixtureDef fixtureDef new FixtureDef() fixtureDef.shape shape fixtureDef.friction 0 final Body body b2World.createBody(bodyDef) body.createFixture(fixtureDef) blocks col row body I only have one dynamic body, the player. As for the simulation, I step it at 1 60, with the default recommended iteration counts of 6 and 2.
7
cannot implement GLSurfaceView.RENDERMODE WHEN DIRTY I'm trying simply to display an openGL surface when I click the screen using GLSurfaceView.RENDERMODE WHEN DIRTY mode but the surface does not display when I click it , why ? my Activity public class ViewManager extends Activity private GLSurfaceView surfaceView Override protected void onCreate(Bundle savedInstanceState) super.onCreate(savedInstanceState) surfaceView new GLSurfaceView(this) surfaceView.setEGLContextClientVersion(2) surfaceView.setRenderer(new MyRenderer()) surfaceView.setRenderMode(GLSurfaceView.RENDERMODE WHEN DIRTY) surfaceView.setOnTouchListener(new View.OnTouchListener() Override public boolean onTouch(View v, MotionEvent event) if(event! null) if (event.getAction() MotionEvent.ACTION DOWN) surfaceView.requestRender() return true else return false ) Override protected void onResume() super.onResume() surfaceView.onResume() Override protected void onPause() super.onPause() surfaceView.onPause()
7
Turn based multiplayer, Google services or Parse or.. I have a turn based game on Google play already (paid with around 2000 users and free with around 50k).i am thinking of adding multiplier option to it. I am unable to progress because I don't know which path to take (given its my first multiplier game). I need your help Like any turn based app, you have the concept of players joining in, rooms, scores and ranking (linking it with fb is preferred) For my backend server, which option should I go with? Google play game services, Parse, AppWrap.. Etc or simply me use my website server and do the server code? I am leaning towards Google Game services just because the infrastructure is there and it's free. But I don't find it to provide flexibility and control (such as using nicknames, listing rooms.. Etc) I just heard about Parse so no experience Any help or recommendations? Plzzzz need your advice
7
How do I store level data in Android? I'm building a game where enemies come in waves. I want to create a file where I can define data about the waves ( of enemies, spawn times, speeds, etc.). I come from a background in iOS and would normally use something like a plist. What would be the best way to do something like this in Java and Android?
7
Android developer publisher royalty sharing I am creating and Android game, and will need to partner with a publisher. I am curious about how this is typically implemented. Probably publishers are going to have a difficult time trusting some developer that they don't know to pay them, assuming the develop puts the game up on Google Play. So will the publisher want the apk file so that they can put it up on Google Play themselves? Or does Google Play have a mechanism where the royalties can be automatically split between two parties from sales IAP? I know that all contracts will be different and it will depend, but I'm just looking to get a general idea of what is usual typical.
7
Who makes the art assets for mobile games? I know how to develop apps for Android but never tried developing games, and I want to start soon. For developing games we need sounds and high quality images (say a background, characters, logos, etc.), so how to create these? For this should we have a separate team? Or a developer can create these using any tools?
7
How to debug Android App Eclipse? Ok. So while this isnt a programming question. I wanted to know how do people debug apps? How do you view log cat, and where these exceptions are thrown etc? And do I need to run the app on the emulator to see all the stuff, or is there a way to view this after running the app on my phone(while not being connected to the computer) Links to plugins and tips would be really helpful, as im gonna start work on my next game, and while the first one works fine, had a lot of problems while debugging.
7
How can i Zoom and Drag The Multiple Image in RelativeLayout i try but it did not see the effect for the zoom and Rotate the image ..Here is my code.... ima1 (ImageView) findViewById(R.id.image) ima1.setOnTouchListener(new View.OnTouchListener() Override public boolean onTouch(View v, MotionEvent event) TODO Auto generated method stub int x cord (int) event.getRawX() int y cord (int) event.getRawY() layoutParams1 (RelativeLayout.LayoutParams) ima1 .getLayoutParams() switch (event.getActionMasked()) case MotionEvent.ACTION DOWN savedMatrix.set(matrix) start.set(event.getX(), event.getY()) mode DRAG lastEvent null break case MotionEvent.ACTION POINTER DOWN oldDist spacing(event) if (oldDist gt 10f) savedMatrix.set(matrix) midPoint(mid, event) mode ZOOM lastEvent new float 4 lastEvent 0 event.getX(0) lastEvent 1 event.getX(1) lastEvent 2 event.getY(0) lastEvent 3 event.getY(1) d rotation(event) break case MotionEvent.ACTION POINTER UP mode NONE lastEvent null break case MotionEvent.ACTION MOVE if (mode ZOOM) float newDist spacing(event) if (newDist gt 10f) matrix.set(savedMatrix) float scale (newDist oldDist) matrix.postScale(scale, scale, mid.x, mid.y) layoutParams1.leftMargin x cord layoutParams1.topMargin y cord ima1.setLayoutParams(layoutParams1) System.out.println(" Mode Zoom " mode " " scale ) else if (mode DRAG) System.out.println(" DRAG " x cord " " y cord) if (x cord gt windowwidth) x cord windowwidth if (y cord gt windowheight) y cord windowheight layoutParams1.leftMargin x cord layoutParams1.topMargin y cord ima1.setLayoutParams(layoutParams1) else if (lastEvent ! null amp amp event.getPointerCount() 2) newRot rotation(event) float r newRot d float values new float 9 matrix.getValues(values) float tx values 2 float ty values 5 float sx values 0 matrix.postRotate(r, mid.x, mid.y) System.out.println(" Mode Rotate " mode) break ima1.setImageMatrix(matrix) return true ) my Layout XML file is ... lt ImageView android id " id image" android layout width "50sp" android layout height "50sp" android clickable "true" android src " drawable ic launcher" gt lt ImageView gt lt ImageView android id " id image1" android layout width "50sp" android layout height "50sp" android layout x "118dip" android layout y "30dip" android src " drawable ic launcher" gt lt ImageView gt
7
How do I make a Box2D object that makes objects passing through it slower? I wish to have a sort of "slow motion" or "slow down" effect on a players character when they walk in a mud area, usually the character velocity is 3f constant in any one direction. The problem is I tried to declare a rectangle to cover the object mud area but I am only able to get a solid rectangle area and therefore the character cannot walk through or over this area, the desired action would be having the character movement slow down while walking in the mud area. The code below is what I have tried to make this sort of region, but this code only makes a solid object which the character cannot pass through. final Rectangle rect new Rectangle( object.getX(), object.getY(), object.getWidth(), object.getHeight(), vbom ) final FixtureDef fixDef PhysicsFactory.createFixtureDef( 0.0f, 0.0f, 1.0f ) Body body PhysicsFactory.createBoxBody( physicsWorld, rect, BodyDef.BodyType.KinematicBody, fixDef ) body.setUserData( typeOfObject ) physicsWorld.registerPhysicsConnector( new PhysicsConnector( rect, body ) )
7
Why doesn't RGB565 lead to a smaller memory footprint on Android? I'm using LibGDX for my game. I'm loading 9 bitmaps into memory at once using the AssetManager, about 512x512 pixels each on average. TextureParameter texParam new TextureParameter() texParam.format Format.RGBA8888 assetManager.load("islands island 0.png", Texture.class, texParam) assetManager.load("islands island 1.png", Texture.class, texParam) assetManager.load("islands island 2.png", Texture.class, texParam) assetManager.load("islands island 3.png", Texture.class, texParam) assetManager.load("islands island 4.png", Texture.class, texParam) assetManager.load("islands island 5.png", Texture.class, texParam) assetManager.load("islands island 6.png", Texture.class, texParam) assetManager.load("islands island 7.png", Texture.class, texParam) assetManager.load("islands island 8.png", Texture.class, texParam) However, if I switch the format to Format.RGB565, then run the Heap allocation tracker in the DDMS view of Eclipse, I see absolutely no change in the memory allocated. The bitmaps being drawn on the screen though are being rendered differently (without an alpha channel when I use RGB565). Am I missing something? Why aren't the bitmaps using less memory?
7
Pop up screen on libgdx Hi I want to make a pause and credits screen for an android game with libgdx the idea I have is creating a new screen like a popup that pauses the background screen and then, I can render the screen I want to show. Please give me some info or ideas for this.
7
Do Google Apple provide the multiplayer servers for an app themselves? I have an app that I have been working on and I was wondering does Google Apple host the server requirements for the multiplayer aspects of an app?
7
Is there any "object" in monogame for windows phone 8, that is similar to Toast in Android? The title pretty much sums it all. Is there any "object" in monogame for windows phone 8 (for monogame to be exact), that is similar to Toast in Android? My purpose is to give a notification hint at what user do, until certain period until next user input. For example If the player tapped "attack", then there is text shown "Select your target" in either top or bottom screen. Just like Toast in android. Note 1 I can do it manually, but i'm just curious. If I can use a pre made function (such as Toast) it'll be simpler to implement, rather than making it myself. Note 2 Mine is a turn based tactic game (such as FF Tactic) Thank you.
7
Poor performance in android when running APK, runs fine in browser I have created a small game project in HTML5 using Phaser engine (tried both 1.1.5 and 1.1.6). Then to port it to mobile platform, used Phonegap Cordova for Windows Phone 8, Android and iOS. In my game, there are around 10 elements, which get animated (moving from point a to point b and some rotation at same time). On iOS and Windows Phone 8, I didn't face any issue. But with Android, performance is unacceptable. On the other hand, if I run my game via device browser, it run smooth without any lag. But compiled APK runs very jerky and elements move very slow amp in flickering manner. I have checked android hardware acceleration flag is set to "true" in manifest file. Tried changing it false too, but that didn't reflected any change in performance. I have checked same on Android 4.2 on Samsung S2 device and on that performance is better. But on Asus Nexus Tab 7 (running Android 4.4) its very jerky, while the OS and Device both are latest. Also checked on another device running Android 4.3 (Samsung Galaxy Grand Duos) and on that too performance is not good at all. In my game tried both WebGL Canvas rendering (Phaser engine uses Pixi.js, which fallback to 2d canvas if WebGL isn't supported), but no change. Similarly with easeljs. If anyone else faced similar issue and can suggest any way to get native like performance. I checked cocoonjs examples and while they seems smooth and acceptable, I can't go for that route.
7
android game how to approach mutliplayer I'm making a single player game that is near completion, and I am already starting to think about giving the game multiplayer. The multiplayer would basically be finding someone to play against, likely in a waiting room or just have a match making function, and then having a pokemon style battle between the people in real time. I think it would be relatively simple as I'm just sending information about each attack(move chosen and damage) and what it did back and forth, but I'm not sure what resources to consult for this. I am very new to Android Java development and really just learning as I go. I have heard a bit about Skiller, but I'm still unfamiliar with using other SDK's and how easy it may be. Does anyone have any suggestions as to what SDK's or methods for accomplishing this. I currently have no money to spend on software development, but I'd like to get started on learning how to do this.
7
Making color of sprite darker or lighter Is there any way to make a sprite darker or lighter in AndEngine? I dont want to use the alpha thing. Nor I want to loose the texture design of the image.
7
Libgdx Animation Timing I'm having a small issue with libgdx animation. I'm using getKeyFrame() to get the current frame of the animation and I'm updating the state time by adding on deltaTime in my update function for the object. The animation is not looping. My problem is that the animation seems to play at different speeds depending on the frame rate. On my phone this animation plays particularly slow. My thinking was that the stateTime would cause it to skip a few frames when it's going slow, but this doesn't seem to be happening. Here is the code sprite Animation.getKeyFrame(stateTime, false) sprite.setRotation(angle) sprite.setPosition(position.x, position.y) sprite.draw(batch) Has anyone else experience this issue.
7
Selling Android apps from Android Market unsupported countries I am in Latvia (which the Android market doesn't support as a country for selling apps from), and I am thinking about the best way of monetizing my app. So far I've come up with these options Pretend I am from a supported country. Get a bank account there, etc. Use PayPal for in app purchases. The player gets, say, the first 10 levels for free, but is then asked to pay 0.99 for the rest of the game. Downside Players might not feel comfortable entering PayPal details into an app. Android market might not like it either. Making the app free and earning money through advertising. Let's do some calculation here Say I get 1M free downloads, each user during his playtime would see 10 banners, so 10m 1000 0.3 is about 33k if we use AdMob with their 0.3 per 1000 impressions. On the other hand, if we use PayPal and in app purchases, we need a 3 conversion rate to beat this.. What should I do? Edit From what I just read all over the net, it looks like advertisers will change their eCPM price a lot without telling you. Using in app PayPal purchases at least allow you to monitor the cash flow.
7
android game performance regarding timers Im new to the game dev world and I have a tendancy to over simplify my code, and sometimes this costs me alot fo memory. Im using a custom TimerTask that looks like this public class Task extends TimerTask private MainGamePanel panel public Task(MainGamePanel panel) this.panel panel When the timer executes, this code is run. public void run() panel.createEnemies() this task calls this method from my view public void createEnemies() Bitmap bmp BitmapFactory.decodeResource(getResources(), R.drawable.female) if(enemyCounter lt 24) enemies.add(new Enemy(bmp, this)) enemyCounter Since I call this in the onCreate method instead of in my views contructor (because My enemies need to get width and height of view). Im wondering if this will work when I have multiple levels in game (start a new intent). And if this kind of timer really is the best way to add a delay between the spawning time of my enemies performance wise. adding code for my timer if any1 came here cus they dont understand timers private Timer timer1 new Timer() private long delay1 5 1000 5 sec delay public void surfaceCreated(SurfaceHolder holder) timer1.schedule(new Task(this), 0, delay1) I call my timer and add the delay thread.setRunning(true) thread.start()
7
OpenGL ES 2.0 basic camera issues I am having issues with the camera, I cant find how to invert the AXIS Now A point is 0,0,0 B point is 1,0,0 C point is 0,0,1 What I want is A point 0,0,0 B point 0,0,1 C point 1,0,0 I cant find the way to do this, so if you can explain also why is this happening it will be great! (if you need more code ask for it) Code final float eyeX 2.0f final float eyeY 10f final float eyeZ 6.0f final float lookX 1.0f final float lookY 0.0f final float lookZ 6.0f final float upX 1.0f final float upY 0.0f final float upZ 0.0f Matrix.setLookAtM(mViewMatrix, 0, eyeX, eyeY, eyeZ, lookX, lookY, lookZ, upX, upY, upZ) ViewPort GLES20.glViewport(0, 0, width, height) final float ratio (float) width height final float left ratio final float right ratio final float bottom 1.0f final float top 1.0f final float near 1.0f final float far 25.0f Matrix.frustumM(mProjectionMatrix, 0, left, right, bottom, top, near, far)
7
How to move a sprite automatically using a physicsHandler in Andengine? I use a DigitalOnScreenControl (knob with a four directional arrow control) to move the entity and the entity which is bound to a physicsHandler. physicsHandler.setEntity(sprite) sprite.registerUpdateHandler(physicsHandler) From the DigitalOnScreenControl, I know which direction I want my sprite to move. Inside its overridden onControlChange function, I call a function animateSprite that checks which direction I chose. Based on the direction, I animate my sprite differently. Problem I want to automatically move the sprite to a specific location on the scene, say at coordinates (207, 305). My sprite is at (100, 305, which means it has to move down by 107 pixels. How do I tell the physicsHandler to move the sprite down by 107 pixels? My animateSprite method will take care of animating the sprite's downward motion.
7
What debugging info should I put in the "About" box I'm developing an Android game with the idea of publishing it, and I wonder what info should I put in the "About" dialog that many main menus have. The idea is to make bug report and debugging easier. Users can click in the "About" box and read the details of their device, and include them in any bug report they send me I know Google sends relevant device data to the developer when there's a crash, but I'm thinking in bugs that not necessarily end with an abnormal program termination. So far, I've added API number of device, screen size, screen density, and number of processors. My current "About" screen is something like this Game titleGame iconAPI versionScreen sizeScreen densityNumber of processors (just in case, because game uses threading)Game version numberDeveloper e mailCopyright information If anyone has experience publishing and maintaining an app, specially in Android, I want to know what can I add there to make user reporting and debugging easier.
7
How do games such as aa Game have high levels in the structure of their code How do games such as aa Game have high levels in the structure of their code? I mean if we want create a game with high levels, should we create and use a class for each level? I do not want code from you. only I want know for creating a game with high levels in android, What we should do in coding? Is it good if we create and use a class for each level?
7
Android notifications with Unity I'm working for the first time on a game for Android using Unity and I need to use Google Cloud Messaging to receive push messages. I've already done the integration of my Unity project with GCM, using this project, and of now I can receive and read messages sent to my phone while the game is running. However, I want to be able to receive them while the app is closed. Currently, if I send a message and the app is not running, I get an error stating that my app stopped working. So, in essence, I want to know what are the steps to handle incoming push messages when my app is closed, display them as a notification in Android and launch my game app when I open such notification? What else should I do outside Unity so my project can handle Android notifications while closed?
7
OpenGL ES 2.0 basic camera issues I am having issues with the camera, I cant find how to invert the AXIS Now A point is 0,0,0 B point is 1,0,0 C point is 0,0,1 What I want is A point 0,0,0 B point 0,0,1 C point 1,0,0 I cant find the way to do this, so if you can explain also why is this happening it will be great! (if you need more code ask for it) Code final float eyeX 2.0f final float eyeY 10f final float eyeZ 6.0f final float lookX 1.0f final float lookY 0.0f final float lookZ 6.0f final float upX 1.0f final float upY 0.0f final float upZ 0.0f Matrix.setLookAtM(mViewMatrix, 0, eyeX, eyeY, eyeZ, lookX, lookY, lookZ, upX, upY, upZ) ViewPort GLES20.glViewport(0, 0, width, height) final float ratio (float) width height final float left ratio final float right ratio final float bottom 1.0f final float top 1.0f final float near 1.0f final float far 25.0f Matrix.frustumM(mProjectionMatrix, 0, left, right, bottom, top, near, far)
7
Sprites are rendered as black rectangles in android 4.0.x only I have some problems rendering sprites correctly on a LG optimus vu (android version 4.0) with libgdx. Basically sprites are black rectangles, while other images that i declare as Texture are correct. I've tested my game with android 4.2 4.3 and 5.0 and I have no problems... Is there some difference between 4.0 and 4.2 in graphics rendering? Maybe it's Gl10 and not Gl20?
7
No sound in android using Phaser I have developed a simple game using Phaser. It's work perfect on ios webkit, but on android there is no sound. What causes this problem on one platform but not the other? We are using this code to load this.load.audio('game audio', 'audio bgm.mp3') Playing this.music this.add.audio('game audio') this.boom.play()
7
Creating new games on Android and or iPhone I have a succesfull Facebook poker game that is running very nicely. I was asked if I can port my game to other platforms mainly mobile devices (phones as well as tablets, would tablets need a separate version)? I am currently a PHP programmer (and game designer) and I simply don't have the time to learn Android or other languages so I have decided to pay third parties to port the game for me (if possible). Which programming language is needed for the following four devices Android phone, iPhone, iPad and tablets? Can they all run off a central SQL database? If no then I don't think I'm interested. Do any of these run Flash? Have I covered all my main bases here? For example is programming for an Android phone that much different from programming for an Andorid tablet? They will have slightly different graphics (because the tablet has a greater screen area might as well use it) but does either version need to be developed separately, from scratch? Same goes for iPhone iPad, do they really need to be programmed separately if the only difference is the graphics?
7
Can I publish games with adult content to Android Market? I have a very old adult (e.g. boobs and stuff) arcade game (think Delphi 7 DirectX 8 age), that currently is backported to Droid. Can the game be published to Android Market? Are there any age restrictions?
7
Move a 2D square on y axis on Android GLES2 I am trying to create a simple game for Android. To start, I am trying to make the square move down the y axis, but the way I am doing it, it doesn't move the square at all and I can't find any tutorials for GLES20. The onDrawFrame function in the render class updates the user's position based on acceleration due to gravity, gets the transform matrix from the user class which is used to move the square down, then the program draws it. All that happens is that the square is drawn no motion happens public void onDrawFrame(GL10 gl) user.update(0.0, phy.AccelerationDewToGravity) GLES20.glClear(GLES20.GL COLOR BUFFER BIT GLES20.GL DEPTH BUFFER BIT) Re draws black background GLES20.glVertexAttribPointer(maPositionHandle, 3, GLES20.GL FLOAT, false, 12, user.SquareVB) triangleVB) GLES20.glEnableVertexAttribArray(maPositionHandle) GLES20.glUniformMatrix4fv(maPositionHandle, 1, false, user.getTransformMatrix(), 0) GLES20.glDrawArrays(GLES20.GL TRIANGLE STRIP, 0, 4) The update function in the player class is public void update(double vh, double vv) Vh vh Increase horrzontal Velosity Vv vv Increase vertical velosity Matrix.translateM(mMMatrix, 0, (int)Vh, (int)Vv, 0) Matrix.translateM(mMMatrix, 0, mMMatrix, 0, (float)Vh, (float)Vv, 0)
7
Do I need to copyright my game before releasing it on the Android Play store? I am developing a game on Android and I was wondering if I have to copyright it before putting it on the store (so no one can steal the idea)?
7
How can I display an image larger than the screen and allow the user to scroll to see more? I am new to development and trying to understand my options. I have found no info or threads on this idea so I was hoping some of you folks could weigh in. When developing for Android, I know that different images optimized for different screen densities and sizes are typically used. I am wondering if anyone just flicks in the resizing and develops so that the smallest device (i.e. phone) shows enough of say a game world to make it relevant for the user and larger screens (i.e. tablet) just show more of that world but at the same scale. I guess you would have to have a couple versions for different densities or graphics could appear too small, but it could really cut down on the number of asset files the user would have to download. Though the whole background world image would be one big file. I assume when downloading an app graphics files for all screen sizes and resolutions are downloaded and then the app detects the screen size and chooses from among them for display.
7
How to execute a piece of code for X seconds in Andengine? I need to execute some code in my game for 5 seconds using the Andengine framework. So far, I've tried with the onTimePassed update handler scene.registerUpdateHandler(new TimerHandler(5f, true,new ITimerCallback() public void onTimePassed(final TimerHandler pTimerHandler) code here But that only executes AFTER 5 seconds have passed by. I've also tried with the onUpdate but, keeping apart performance issues, there's no way I can count how many seconds have passed by since the execution entered the loop. If it helps, I only need the code to execute once per second for 5 seconds. Thank you!