Tag Info

Hot answers tagged

3

I assume you will be using some modern rendering API to draw to the screen, such as OpenGL or D3D. You will certainly want to batch sprites as much as possible and use sprite sheets to reduce the number of textures. A sprite sheet is nothing more than a Texture Atlas (also read this). Once you have a Texture Atlas up and running, it will be up to you how you ...


3

Use floating point variables for entities' velocity and position. Use integers only when translating from world position to screen position. This way, your ship will move smoothly thorugh tiles. Also, add a Camera object to convert your world coordinates to screen coordinates as soon as possible.


3

Inverse kinematics. That is the word I think you are looking for (easily googlable). As for libraries, I do not think so. It is very rare technique - the only game I can think of using inverse kinematics is Kingdom Come: Deliverance.


1

I've been puzzling with this in the creation of my physics based game. I've decided to settle with creating my animations used a skeletal key-frame based animations system (Similar to flash if you've used it). I will then create physics bodies for each 'limb' of my character. Each of these limbs will have forces applied (depending on the distance from the ...


1

Mmmm, interesting question. The first approximation could be the following: simply divide your character into a set of physical bodies. I mean, you could calculate resultant force on legs, feet, arms and hands and operate with the results. Think in Rayman, for example. It can be a good model to start with. The character would be formed by head, body, hands ...


1

This formula updates value so a constant fraction of the difference from the value and the target is removed each frame. Let alpha = 1/(someFactor+1). Then we can rewrite updating to the new value' as: value' = (1-alpha) * value + alpha * target Then basic algebra says value' - target = (1-alpha) * value + alpha * target - target value' - target = ...


1

I figured out how to fix this, but I'm still not entirely positive what the actual problem was. My rotation was very simple and was only in the X axis. The Y and Z axis remained at 0 throughout the rotation. However, if I manually type 0 into these boxes (even though they are already 0) the weird rotation problem goes away. This is repeatable. If I ...


1

Well since you spaghetti so kindly, I personally use an enumeration for which animation state the character is in. The states I use for a 2D platformer are simply RUN, IDLE, JUMP_RISE, and JUMP_FALL. Each animation state corresponds with a set of 8 sprites, which are loaded to my camera function, which changes what the player looks like on screen. Are you ...


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