Tag Info

Hot answers tagged

4

I don't know if it is because of a poor component that causes the false readings or a extremely precise component that registers the spinning of the earth, as it orbits the sun, as our solar system spirals through the galaxy. Either way, this is a common problem. The solution is to use some type of filter to smooth out the "extra" readings. There are ...


3

You might be interested in a so called quad tree. A quad tree is basically a structure where you divide the area in boxes and put all objects in lists on these boxes. You can then check for collisions only in the boxes that are actually in range of the object. The advantage of quad trees over say 2d arrays is that you they scale very well, if you have a ...


3

If you have seen a game running at 60fps, then reverting to 30fps will always be noticeably less smooth - it's a perception thing. Get someone who has never played your game before to play it at 30fps and they'll probably think it's just fine. Most games target 60fps these days as games running at 60fps have a much better feel. Most recent (high end?) ...


3

If you use an alpha-channel for your assets (which is most likely), then you're out of luck with vanilla JPEG anyway. PNG provides a pretty good compression while also being lossless and a format with alpha-channel. There's not much you can improve there, except using a specialized GPU format such as PVR or similar which will allow you to specify different ...


2

First of all I'd start with the MP3 file. If you've got Ogg Vorbis already, why having a MP3 as well? Especially 128 kbit/s on a mobile device sounds excessive. The MP3 is taking like 1/3 of your assets, with the PNG files being significantly smaller. As such I'd start trying to convert the MP3 to Ogg Vorbis. I'd expect the file to become smaller. Also let ...


2

YES. If we put cross-platform aside, I think you should use a game engine just for the basic features that many game engines provide: Object/Layer management + Level loading A Renderer for either 2D or 3D Texture management (texture groups, texture sizing, texture-atlasing) Physics Animation engine (support opacity, rotation, position, etc.. with different ...


2

Just found it. For anyone else wondering about this, the correct method to call is: adView.release();


2

First, do a preselection When a weapon has a low range, it usually doesn't make much sense to check it for collisions with objects at the other end of the world. You can drastically reduce the number of comparisons when you can narrow it down to objects in local vicinity. One option is to use a two-dimensional tree structure. These usually allow you to ...


2

I don't know what you want to use to render the games, but in general, that is possible. In Monogame for example it is just changing the "Color.White" to the color you want (e. g. Color.Green) What you are trying to archive in the image above won't be possible using a pure tile-based approach: Some tiles on the border between the green and the original are ...


1

For me the best choice is libGDX (Tutorial for libGDX 3d by xoppa Here) With it you can create games for Desktop, Html, Android and iOS at the same time I've been using Unity before (only trial) but it seemd hard to understand and It's not free. With libGDX you can still use eclipse, so you don have to learn and adapt to completely new environment. For me ...


1

What I would try to do is get rid of the draw depth calculation by drawing your tiles in the correct order to start with. What this means is, you'll be drawing your back layer first, then the middle layer, then the top layer. If your tile sprites overlap (e.g. isometric view) you may also need to draw the back row first, then the next and so on and ...


1

Of course it is. I've only seen very few games implementing their own limited input buttons, but never a full keyboard. Based on the framework you're using this might be tricky to get it working, but overall, it shouldn't be a problem.


1

Your package name doesn't need to match the package where you put your classes. When you write your AndroidManifest.xml you specify both the package for the game and the path to your activity. So use something like com.company.engine for your activity and your C++ and just create a new package name for the game.


1

Your car is slipping for the same reason that a car hanging up-side down, riding the ceiling, with 100% friction would slip. 100% friction roughly means that 100% of the force exerted via the wheels on the terrain is used to counter movement perpendicular along the normal of the terrain. But this force still isn't enough to counter the force of gravity. This ...


1

Copied from here: http://stackoverflow.com/questions/15733442/drawing-filled-polygon-with-libgdx Basically, you define a PolygonSpriteBatch using a PolygonSprite and a PolygonRegion: PolygonSprite poly; PolygonSpriteBatch polyBatch; Texture textureSolid; You then create them like this, giving the region a texture and the 4 corners coordinates (for the ...


1

You have multiple choices: Shared preferences file is the one you are now using. It's usable and nice key-value store, but should be used only for settings type data. Maybe for username, time played, etc. Nothing too complicated. Saving files in Android's file system is better choice for your problem. How ever, you wanted to secure the file, so that user ...


1

As you mention that your current game is simple I assume you are learning, or at least expanding upon other non-game related knowledge. Game engines are useful tools in industry, the games you make will work more efficiently and turn around time will be faster. My opinion is that it is far better to create your own engine if not working on a commercial ...


1

Although libgdx largely abstracts away the OpenGL component for most of the basic things, you can still use it in your code for the more advanced stuff. Usually though, if you dig a round for a while you'll probably find that about 99% of the time whatever you want to do with OpenGL has already been implemented somewhere in libgdx. Source: ...


1

JPG is a photo format. It's a very efficient format for real-world images. PNG is a successor to GIF. It's a very efficient format for artificial images. The reason is that the compression algorithms differ. The compression for both works by assuming some data is more common than others, and optimizing for that. Photo's have lots of smooth gradients, and ...


1

Essentially a series of flood fills - one for each cell in the grid, but skipping over any you've already visited, and dropping out early if you find a cell not connected to a group you've already flood-filled/gathered but of the same type as that group. Written blind, so please excuse any code typos or holes; highlight them in a comment and I will amend. ...


1

You seem to want to keep the same textsize/screensize ratio. Basically what you do is develop at one resolution and let that be scale 1.0. Then you divide the new screen width by the old width and that is your scale factor. For example. Developing on 2560x1440 with font size 16 and running on 1920x1080. Font size will be: 1920/2560 * 16 = 12 I do the same ...


1

I found a solution which works for my purposes since I don't use many bitmaps on the canvas. It's absolutely fluent when I invalidate() just once when all bitmaps (background and so on) have been loaded and then in onAnimationUpdate() I only partially invalidate the canvas by this method: invalidate(int l, int t, int r, int b); That means I only ...


1

When you want to draw something fast on the Android GUI don't use the View.onDraw() method. It is too slow. Generally everything is done one the main(gui)-Thread, including each onDraw() of each View. And the time of the calls to each .onDraw depend on everything else on the main thread. To be fast you want to draw onto a canvas on a separate thread (with ...



Only top voted, non community-wiki answers of a minimum length are eligible