2D games are drawn in a two-dimensional space using two-dimensional objects. To represent its position, each game object will have an `x` and a `y` coordinate.

learn more… | top users | synonyms

0
votes
3answers
305 views

Line of sight on a 2d grid

I've been looking for similar questions here and on google, but none have worked for me yet. I have a game, where I have a 2d array of square tiles (they're objects with accessible x and y pixel ...
1
vote
1answer
44 views

How to make the images appear in a specific location? [closed]

How can I draw a sprite in a specific location of the screen using native Android 2D graphics API? The image should stay in the location specified.
0
votes
1answer
271 views

Background Sprite Setting

For my 2d game, I want to set background image. So that I am using multiple background images for that purpose. But it can't set correctly on screen that illustrated in following image. Also for ...
0
votes
0answers
149 views

How to implement 2D Ai Wandering with 8 - directional movement using Perspective Images in unity 4.3?

My requirement is to move a 2D characters with perspective view images has to wander in game area by choosing dynamic path and according to that the AI character has to switch the animations based on ...
0
votes
2answers
177 views

Smooth moving on tile-based map, how to fix simple collisions?

I've already had some experiences about the work of 2 dimensional square-based playfields and moving a player on them. Though, when a square has multiple pixel sizes, and player moves e.g. 1 pixel per ...
0
votes
1answer
65 views

Light direction not being calculated correctly

I'm trying to implement deferred lighting in my game, and have run into an issue with normals. The image above shows the lighting being applied to a tile map. The yellow shade represents the ...
22
votes
6answers
2k views

How can I Intercept object with a circular motion

I am creating a 2d space game and need to make the spaceship intercept a planet. I have working code for straight line intercepts but cannot figure out how to calculate the planets location in a ...
0
votes
2answers
279 views

Wall jumping collision detection anomaly

I'm creating a game where the player ascends a tower by wall jumping his way to the top. When the player has collided with the right wall they can only jump left and vice versa. Here is my current ...
1
vote
2answers
179 views

libgdx: How do you remove a cell from TiledMap?

I am making a Terraria-style sidescrolling game with an open world. I am using a TiledMap to render all of the tiles. If I want to remove a tile, like if it is broken, how would I stop it from being ...
9
votes
2answers
371 views

Dynamic thruster balancing of space ship

The space ships in my game a meant to be player-built with an arbitrary amount of thrusters attached anywhere with any rotation. I currently have some dirty code to rotate the ship to a given angle ...
0
votes
1answer
231 views

How to properly handle top down 2D collision?

I can never seem to get this right, well polished at least. I'm creating a top down game in XNA, and collision has always been an issue for me to do properly. Detecting collision is fine, but ...
-2
votes
1answer
108 views

in a 2D game that has an array as a map how to make graphics look nice?

I have a map that's stored in a 2D Array with 1s being walls, 0s being roads, and 2s being houses. There is a character that is not stored in the map but its position is always checked against the map ...
1
vote
1answer
360 views

Unity 2D camera drifts from player as speed increases

I have a dilemma that I did not have in XNA before porting my game to Unity. First-- my goal is to mimic Super Mario World 2's camera tracking in x. The camera tracks to 1 block ahead of the player, ...
12
votes
6answers
917 views

Seamless tilemap rendering (borderless adjacent images)

I have a 2D game engine that draws tilemaps by drawing tiles from a tileset image. Because by default OpenGL can only wrap the entire texture (GL_REPEAT), and not just part of it, each tile is split ...
2
votes
1answer
720 views

Dynamic 2d terrain loading / stitching in Unity [closed]

I'm currently working on a top down 2d game (in Unity 2d) where I'd like to build a huge terrain for the player to explore. My question is - do you have any good practices or ideas on how to chunk the ...
1
vote
5answers
361 views

What is this type of camera called?

I am trying to find a name like "perspective view" of how a camera like this is called: It is 2d and 3d at the same time. I'm having a hard time trying to find the name.
0
votes
0answers
228 views

Adding 2d hud/gui to a 3d game engine which has no 2d features

I have been following the 3d game engine tutorial series made by theBennyBox for a few months now, and have finally decided to create a game with it. My problem is that it is a 3d only engine which ...
1
vote
1answer
146 views

What's a clean way to find (up to) 3x3 squares within a 6x6 grid?

I have a 6x6 grid where every cell have a color property (simply integer value). Player can change one cell at a time to form rectangles of the same color inside of the grid. New rectangles can only ...
1
vote
1answer
146 views

How to correctly handle multiple movement key presses resulting in double the speed?

I am trying to implement acceleration and drag into my top-down 2D game. The player can move using the WASD keys. Acceleration works fine, but the way I handle the directional velocity causes the ...
2
votes
1answer
187 views

How do I make a sprite appear to sway with the wind?

I'm trying to find a method to simulate the effects of wind on various sprites in a side-view 2D scene. What relatively simple technique could I use for this? What I have in mind is to give these ...
1
vote
0answers
110 views

How to make 2D sprites from 3D models [closed]

Hi I'm making a top shooter game and I'd like to what programs are the easiest/fastest to make 3D models and sprite sheets ? Here is an example of I what I want to do ...
2
votes
1answer
344 views

Generating transformation matrix for 2D camera with pan/zoom/rotate

Question How do you implement a camera with pan/zoom/rotation for a 2d game? Is it acceptable to multiply together a series of transformation matrixes to generate a final transformation matrix that ...
-3
votes
2answers
133 views

what is the ducking ability? [closed]

In my game framework I have this property: canDuck : Boolean = true Determines whether or not the hero's ducking ability is enabled. What does it mean ? regards
7
votes
2answers
1k views

Constant 2D Bullet movement in a shmup

I've been following the pixelnest tutorial to make a 2D shmup (http://pixelnest.io/tutorials/2d-game-unity/player-and-enemies/). While working on this I've experimented with increasing the firing ...
0
votes
1answer
847 views

2d OnMouse(anything) Not working

So I want to be able to click on these targets and have them destroy themselves. Right now I have many OnMouse functions all just trying to print something for testing. For whatever reason it doesn't ...
2
votes
1answer
99 views

Issues with 2D Body/Limb system [closed]

In my game I have programmed Body and Limb classes. The Body is guaranteed to have an origin in the center of its sprite. The Body class has a List of children Limbs, each with their own offset. Every ...
1
vote
1answer
172 views

How to rotate vertices of 2D shape using a transform matrix?

I am making a top-down 2D game and am currently working on implementing improved collision using SAT. I programmed a Shape class with a Vector2 center that is its position in world space. On top of ...
3
votes
1answer
145 views

Should my GLSL Shader object/wrapper encapsulate loading/setting a VertexArrayObject?

I am working on a 2D game in C++, with a simple rendering layer over OpenGL. I have a wrapper for GLSL shaders and shader programs, these wrappers encapsulate shader objects into C++ classes and ...
7
votes
2answers
934 views

What kind of projection is demonstrated in this screenshot?

I want to know what projection is used in the following game: The game is Goodgame Empire.
4
votes
1answer
1k views

Is a game like Subway Surfers suited for 2D or 3D?

I imaginated a mobile game and now I'm getting doubts as to whether its possible for my idea to be developed in 2D. Here's a crude illustration of the game scene: It's pretty much like Subway ...
0
votes
1answer
137 views

Move a 2D point to a target (first accelerate towards the target, then decelerate)

I have a point entity that I would like to move to a target point (in 2D). I think I would like it to accelerate away from its current position (the point could already have a velocity), to some ...
0
votes
0answers
36 views

XNA 2D Stencil Buffer Rotation

I am currently working on a 2d game related to planets and am trying to get a stencil buffer working with rotation. I currently have a stencil buffer found from another related answer but it refuses ...
1
vote
1answer
208 views

How do you make a bullet ricochet off a vertical wall?

First things first. I am using C# with XNA. My game is top-down and the player can shoot bullets. I've managed to get the bullets to ricochet correctly off horizontal walls. Yet, despite using similar ...
0
votes
1answer
201 views

How to add a nice looking muzzle flash to the tip of my guns [closed]

I am making a top down shooter and would like to add a muzzle flash to the tips of my guns. So I have an idea of what I want to do which would be just a circle that would fade from yellow to white or ...
2
votes
2answers
111 views

How to use camera transformation without depending on (1,-1) scale during spriteBatch.draw()

I am creating a 2D platformer type game in XNA. I currently have a camera object, with a position/rotation/zoomlevel that I use to generate a transformation matrix to pass to SpriteBatch.Begin(). ...
0
votes
0answers
97 views

How to make good looking bullets with a trail for top-down shooter?

So I am making a TD shooter and was wondering how to make fancy bullets. Right now I have a giant sprite of a bullet trail that is the bullet as well but it doesn't look that good. I am using libgdx ...
3
votes
2answers
522 views

How can I tell what a rectangle intersects with?

I understand XNA's Rectangle class is rather limited, but surely there is a way to tell what a Rectangle is intersecting with? If I had Rectangle boundingBox = new Rectangle(stuff here); how would I ...
2
votes
1answer
230 views

Animating feet seperately from the body

I have a character and I would like to animate a walking animation for it. However i get the following result when I animate it: (ignore the green lines/ markers/ sound) As you can see the foot ...
22
votes
6answers
4k views

How to solve the big video memory requirements in 2d game

We are developing 2d game (Factorio) in allegro C/C++ and we are facing the problem with increasing video memory requirements as the game content increases. What we currently do is, that we gather ...
0
votes
2answers
118 views

Smooth input handling in Java [closed]

I am writing a Java game. My problem is to get a really smooth input. If I hit the key W the character has to go forwards, but if I hit A and release the W key, the character doesn't go left ways :( ...
2
votes
2answers
176 views

Print on the GUI in Unity

I'm trying to show the players name on the GUI with a label. GUI.Label(new Rect(10,10, 100, 30), playerName); Instead of use the default style I want to use a different font with larger character. ...
0
votes
2answers
123 views

irrlicht: drawing two textures with draw2dImage issue

Im just starting out with irrlicht (and c++) for 2d development and I followed the 2d tutorial, so I am able to draw a 2d texture on the screen (With draw2DImage) this seems to work fine. So I made a ...
2
votes
1answer
207 views

Best visual way to build a “near isometric” 2D view

I'm working hard in a 2D platform game, as far as I got is a standard 2D view (only x and y are visible) But I want to change the perspective so I can see the floor also. But the MapBuilder I ...
0
votes
0answers
154 views

Unity not updating sprite animations (possible bug)

I have a simple animation of a foot which i want to change sprites from one sprite to another, which is seen in the following two images: now as one can see in the animation timeline there is a ...
1
vote
1answer
85 views

How can I make an attached gameobject behave correctly on character flip?

I have a character that on start-up is equipped with another gameobject/prefab as a weapon, attaching it to a hand. void Start() { handFront = transform.Find ...
-3
votes
1answer
182 views

Games with simple graphics like Dots or 2048? [closed]

I want to try making an Android game, but I'm bad at making graphics. I want to make a game with very simple graphics and I'm looking for inspiration. What are some games like Dots or 2048?
0
votes
0answers
59 views

Rendering bug in java

I'm using a simple rendering method in java to render tiles. Everything looks fine, but I notice that some rows grow 1 pixel when I move, and dhen shrink back, but I have no idea why. Infos: I'm ...
0
votes
1answer
2k views

How do I randomly spawn objects in 2D game?

How do I randomly spawn few different sprites on screen so they're not overlapping or half visible on render. The sprites should immediately start shrinking until they disappear. I've tried to ...
4
votes
2answers
178 views

2D Enemy AI reacting to sound

I'm currently working on a 2D top-down survival game and I'm trying to figure out a good method for enemies to detect player sounds. For instance - if the player fires his gun it should play a sound ...
1
vote
1answer
133 views

Moving turret aiming at moving target

I've found this post Turret Aiming Formula on Reddit and a nice answer a while back. The solution in the answer works great for still sanding turrets but is almost unusable for moving turrets since ...