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

1
vote
0answers
154 views

Beginner C# image loading woes - NullReferenceException [closed]

I keep getting a "NullReferenceExeption was unhandled" with "Object reference not set to an instance of an object." written under it. I have all of the images (png) correct with names and added to ...
2
votes
1answer
526 views

Rendering multiple squares fast?

so I'm doing my first steps with openGL development on android and I'm kinda stuck at some serious performance issues... What I'm trying to do is render a whole grid of single colored squares on to ...
1
vote
2answers
526 views

Rotating multiple points at once in 2D

I currently have an editor that creates shapes out of (X, Y) coordinates and then triangulate that to make up a shape of those points. What will I have to do to rotate all of those points ...
-1
votes
2answers
416 views

Best approach to 2D racing game AI? [closed]

I have no experience in AI at all, but I would like to know how I could do this? Even if the AI just followed a path how could I do this?
-1
votes
1answer
553 views

What is the cost of custom made 2D game sprites? [duplicate]

Possible Duplicate: How much to pay for artwork in an indie game? I am looking for sprites similar in style to those of Final fantasy Tactics, but with a much higher resolution that will ...
4
votes
2answers
764 views

2D lighting theory: day-and-night cycle, spot lights at night

I am writing a rogue-like 'zombie' management game. The game map will be similar to Prison Architect. A top-down 50 X 50 grid. I want to implemented a day night cycle and during the night I would ...
4
votes
1answer
254 views

Is there any heuristic to polygonize a closed 2D raster shape with n triangles?

Let's say we have a 2D image black on white that shows a closed geometric shape. Is there any (not naive brute force) algorithm that approximates that shape as closely as possible with n triangles? ...
5
votes
3answers
2k views

What's a good entity hierarchy for a 2D game?

I'm in the process of building a new 2D game out of some code I wrote a while ago. The object hierarchy for entities is like this: Scene (e.g. MainMenu): Contains multiple entities and delegates ...
1
vote
1answer
656 views

Sony PSM SDK's 2D game engine

I have started with the Sony PSM SDK this week, I'm interested in creating a little 2D game and have been reading through the web about a so called "2D game engine" integrated into the SDK. Some ...
0
votes
2answers
652 views

Collision detection on a 2D hexagonal grid

I'm making a casual grid-based 2D iPhone game using Cocos2D. The grid is a "staggered" hex-like grid consisting of uniformly sized and spaced discs. It looks something like this. I've stored the grid ...
-1
votes
1answer
469 views

2d Game using monotouch? [closed]

I'd like to make a 2d game and I like SDL but I don't think there is an SDL for monotouch. Whats the closest solution?
4
votes
1answer
3k views

How do I rotate a sprite so that it is 'pointing' in the direction it is moving?

I have a sprite, e.g a missile, heading in a certain direction (using a velocity vector). How do I figure out its how much to rotate it so that it gets drawn 'pointing' in the direction it is ...
2
votes
2answers
987 views

Create Adventure Game Scene/Room/Backdrop from Real Photo

Is there a suitable software or a good tutorial for creating 2D rooms/scenery for adventure games from real photos? Is it possible to achieve good results by using photos, or the hand-drawn style ...
5
votes
3answers
607 views

'Spring' physics

I'm trying to put together a struct or a method of some sort that will allow me to check the relative position between two objects, and if they're too far apart, apply a force that will draw them ...
8
votes
1answer
3k views

Fast, accurate 2d collision

I'm working on a 2d topdown shooter, and now need to go beyond my basic rectangle bounding box collision system. I have large levels with many different sprites, all of which are different shapes and ...
7
votes
2answers
758 views

Hills in a topdown game

I'm making a top down rpg game and was wondering if it was possible to show hills on a map instead of having everything completely flat. I've thought about changing to an isometric view, but if it can ...
6
votes
2answers
2k views

How can I generate a navigation mesh for a tile grid?

I haven't actually started programming for this one yet, but I wanted to see how I would go about doing this anyway. Say I have a grid of tiles, all of the same size, some traversable and some not. ...
3
votes
3answers
452 views

How to design 2D collision callback methods?

In a 2D game where you have a lot of possible combination of collision between objects, such as: object A vs object B => object B vs A; object A vs object C => object C vs A; object A vs object D ...
2
votes
1answer
401 views

How do I make a rope from point A to B in Box2D?

I need to make a rope (preferably not elastic) from one point to the next in Box2D. If it helps, I'm trying to develop one of those 2D Spiderman games, like this: ...
3
votes
3answers
798 views

Moving a body in a specific direction using XNA with Farseer Physics

I have a custom polygon attached to a body, which looks like this: What I am trying to accomplish is getting the body to move according to wherever the tip of the body is. So far this is what I've ...
-1
votes
3answers
472 views

Can these game be fully coded in html5/javascript? [closed]

I mean the mechanics of the game. Would it be possible? -Pokemon GBA series, rendering the world would be easy, but what about battle mechanics? -MapleStory, after seen dragonbound.net which is an ...
4
votes
1answer
351 views

How do I calculate the boundary of the game window after transforming the view?

My Camera class handles zoom, rotation, and of course panning. It's invoked through SpriteBatch.Begin, like so many other XNA 2D camera classes. It calculates the view Matrix like so: public Matrix ...
5
votes
3answers
2k views

Is it possible to map mouse coordinates to isometric tiles with this coordinate system?

I'm trying to implement mouse interaction in a 2D isometric game, but I'm not sure if it's possible given the coordinate system used for tile maps in the game. I've read some helpful things like ...
2
votes
1answer
703 views

Trouble with AABB collision response and physics

I have been racking my brain trying to figure out a problem I am having with physics and basic AABB collision response. I am fairly close as the physics are mostly right. Gravity feels good and ...
1
vote
1answer
924 views

Java 2D Tile Collision

I have been working on a way to do collision detection forever, and just can't figure it out. Here's my simple 2D array: for (int x = 0; x < 16; x++) { for (int y = 0; y < 16; y++) { ...
2
votes
1answer
189 views

2D SAT How to find collision center or point or area?

I've just implemented collision detection using SAT and this article as reference to my implementation. The detection is working as expected but I need to know where both rectangles are colliding. ...
16
votes
2answers
3k views

Best way to mask 2D sprites in XNA?

I currently am trying to mask some sprites. Rather than explaining it in words, I've made up some example pictures: The area to mask (in white) Now, the red sprite that needs to be cropped. The ...
2
votes
1answer
3k views

2D Grid based game - how should I draw grid lines?

I'm playing around with a 2D grid based game idea, and I am using sprites for the grid cells. Let's say there is a 10 x 10 grid and each cell is 48x48, which will have sprites drawn there. That is ...
6
votes
3answers
620 views

How do I make a moving object stop smoothly at the end of a path?

There are a dozen ways I could word this question, but to keep my thoughts in line, I'm phrasing it in line with my problem at hand. So I'm creating a floating platform that I would like to be able ...
4
votes
2answers
375 views

Detecting a ledge in Box2D [duplicate]

Possible Duplicate: Detect Open Space in Farseer How do I detect ledges? I'm making a 2D platformer with Box2D. The player needs to be able to grab onto a ledge and pull him/herself up. ...
2
votes
2answers
426 views

One-way platform collision

I hate asking questions that are specific to my own code like this, but I've run into a pesky roadblock and could use some help getting around it. I'm coding floating platforms into my game that will ...
4
votes
1answer
1k views

Friction in 2D game

I'm developing a 2D platformer, although this question could probably apply to just about any 2D type physics; What is the equation for friction? I have sort of a hacky type of friction set up in my ...
4
votes
4answers
1k views

Do 3d assets cost a lot more than 2d?

I'm planning to create a game on my own and will most likely hire an artist in the future. I just want to know if making a game in 2d will a lot cheaper than making it on 3d? Here's my plan: If it ...
5
votes
1answer
410 views

2D Magnet-like repelling behavior

If somebody wanted to develop a system between two intersecting rectangles so that the rectangles would, in a gradual process, push eachother away from one another until no longer intersecting, with ...
3
votes
2answers
1k views

Platformer Enemy AI

I'm currently developing a platformer shooter. The game is multiplayer and while my net code could use some real work I have put that off for the time, so currently I'm trying to implement the AI. ...
1
vote
1answer
326 views

Ideas for 2d fire simulation [closed]

I want to simulate a fire in a flat and non flat* surface (fire spread modelling). I've seen that cellular automata is one of the algorithms that can be used. Are there other algorithms that would be ...
1
vote
0answers
232 views

Outline Shader Effect for Orthogonal Geometry in XNA

I just recently started learning the art of shading, but I can't give an outline width to 2D, concave geometry when restrained to a single vertex/pixel shader technique (thanks to XNA). the shape I ...
-1
votes
1answer
526 views

Resource not found?

When I write in my terminal, java -jar myJar.jar, it gives me an error "Resource Not found res/playNow.png" When I run it in eclipse, it does not give me any errors about this image. My folder in my ...
2
votes
2answers
5k views

What 2D game engines are there available for C++? [closed]

I just realized there are not C++ 2D Game Engines that I know of. For example, something like Pygame in Python, or Slick2D in Java. We have the following: SDL -> Too low level, not a Game Engine ...
0
votes
2answers
165 views

Unable to access jar. Why?

I was making a game in java and exported it as jar file. Then after that, I opeed jar splice. I added the libaries and exported jar. I added the natives then i made a main class. I created a fat jar ...
0
votes
1answer
719 views

Proper way to use a RenderTarget2D to draw multiple textures?

In the process of trying to resolve a split screen issue, I've been trying to use a RenderTarget2D to draw a portion of my scene to a Texture2D, and then again to another Texture2D, but the end result ...
1
vote
1answer
131 views

Possible to draw a select portion of a render target? (in XNA)

I'm going to try to do this in reverse fashion and skip straight to the punch line, and then give the back story afterward: Is it possible to, after drawing a scene to a RenderTarget2D, only draw a ...
-1
votes
1answer
330 views

How to make an Image still when at position at Slick 2D?

I wanted to have a build functions. When I press for example 2, the image will appear with my character. The question is, how do I stop it from following my character //build //I created many ...
5
votes
3answers
1k views

Best system for creating a 2d racing track

I am working a 2D racing game and I'm trying to figure out what is the best way to define the track. At the very least, I need to be able to create a closed circuit with any amount of turns at any ...
2
votes
3answers
4k views

Sprite sheet generator

I need to generate a sprite sheet with squared sprite for a 2D game. How can I generate a sprite sheet where each frame has x = y? The only think I have to do is to "insert" some blank space between ...
1
vote
1answer
227 views

How would I be able to get a game over screen using the pause function?

I am having problems with my snake game, when the snake collides with itself it draws a "game over" image in the background, but only while it's colliding with itself. I want it to behave like the ...
0
votes
1answer
2k views

How to create a simple side scroller game [duplicate]

Possible Duplicate: How to create games with scrolling? I'm still pretty new to game programming and any tutorial that I have worked with stuck to only games with the initial screen. I want ...
1
vote
2answers
132 views

How to fetch only the sprites in the player's range of motion for collision testing? (2D, axis aligned sprites)

I am working on a 2D sprite game for educational purposes. (In case you want to know, it uses WebGl and Javascript) I've implemented movement using the Euler method (and delta time) to keep things ...
1
vote
1answer
405 views

2D SAT Collision Detection not working when using certain polygons (With example)

My SAT algorithm falsely reports that collision is occurring when using certain polygons. I believe this happens when using a polygon that does not contain a right angle. Here is a simple diagram of ...
11
votes
2answers
2k views

What should I worry about when changing OpenGL origin to upper left of screen?

For self education, I'm writing a 2D platformer engine in C++ using SDL / OpenGL. I initially began with pure SDL using the tutorials on sdltutorials.com and lazyfoo.net, but I'm now using SDL to ...