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.
9
votes
6answers
2k views
Which is the best approach to make a 2D character to be able to use tons of different equipments when in action?
I want to create a 2D game but I'd like to have the character to wear tons of different equipments on different combinations, like a RPG or something.
So let's say the user changes his/her shoulders ...
7
votes
4answers
14k views
Free to use resources for 2d platformer Sprites [closed]
I've looked at a couple other questions about Sprites but most seem to apply to Isometric or RPG related sprites. So I'm wondering if there is a decent place for 2D side scrolling plat-former type ...
6
votes
3answers
2k views
2D Top down view maps
I was wondering how this works.
Do you load the complete map when the game starts up, or do you load parts of the map at runtime?
And how would you save the maps? Would it be in XML or some binary ...
9
votes
1answer
1k views
Angle of Reflection
I have this "Breakeout style" game.
I have a cannon at the center, blocks around the cannon and pads around the blocks. This is how the game looks like:
I've managed to get the collision per ...
7
votes
5answers
3k views
2D rectangular object collision - Detect direction
Coming form this question, I'm needing some more help.
I need some ideas to find out from which side the collision came, and react accordingly.
Use this image as reference:
The blue lines are the ...
6
votes
4answers
6k views
2D Platform Game Jumping
I'm currently writing a game in XNA for fun which uses C#. I have got my sprites loaded and when the character moves right he looks like he is running right and when he moves left he looks like he is ...
4
votes
3answers
1k views
Collision Detection Structure
I'm well aware of how to detect if two or more 2D objects collide but I'm interested in how to decide whether to check for a collision. In previous projects, I just had every object check against ...
3
votes
2answers
412 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 ...
1
vote
2answers
2k views
How to Create a Grid for a 2D Game?
So I'm currently writing the engine for my videogame. I've almost integrated Tiled (I think) so I should have a map-creator here soon.
My question is, how do I actually make the grid? I'm really ...
7
votes
2answers
3k views
2D object-aligned bounding-box intersection test
I have two object-aligned bounding boxes (i.e. not axis aligned, they rotate with the object). I'd like to know if two object-aligned boxes overlap. (Edit: note - I'm using an axis-aligned bounding ...
4
votes
1answer
1k views
2D collision-detection middleware
(This question was split off from http://gamedev.stackexchange.com/questions/3345/)
Are there any recommendable middleware available for 2D collision detection?
I believe I've heard that Box2D could ...
5
votes
1answer
1k 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 ...
5
votes
2answers
783 views
How to handle a huge map?
Generically speaking, how would you handle a huge 2D Map of which only a part is displayed? Imagine the old top-down racing games like Micro Machines.
I would know how to do something with a ...
5
votes
4answers
2k views
2D Platformer Collision Handling
I am trying to create a 2D platformer (Mario-type) game and I am some having some issues with handling collisions properly. I am writing this game in C++, using SDL for input, image loading, font ...
4
votes
2answers
857 views
Matrix for 2D perspective
I'm trying to determine whether what I'm attempting to achieve is even possible mathematically. I'm obviously not a seasoned game developer so I'm having trouble even coming up with the terminology to ...
3
votes
4answers
755 views
Tools for editing 2D sprite-based game levels
What are good free and widely used tools for editing 2D sprite-based game levels? I'm looking for one that allows exporting data to a custom format. One that I know of is Blender — a 3D tool, ...
3
votes
1answer
170 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? ...
3
votes
2answers
530 views
canvas ball physics animation
I want to animate ball in html canvas like this.
ctx.beginPath();
ctx.arc(75, 75, 10, 0, Math.PI*2, true);
ctx.closePath();
ctx.fill();
start position is left top corner and ball's maximum ...
3
votes
1answer
739 views
How to create a 2D region where sprites are automatically wrapped?
Edit
Finally managed to get this to work, after two separate questions! Here's a video demonstration:
http://www.youtube.com/watch?v=nZ7e0jegvs0
Will write an article about it later when I have a ...
2
votes
1answer
841 views
Obtaining a world point from a screen point with an orthographic projection
I assumed this was a straightforward problem but it has been plaguing me for days.
I am creating a 2D game with an orthographic camera. I am using a 3D camera rather than just hacking it because I ...
1
vote
1answer
238 views
Architecture of “doodle jump” type gameplay infinite looping background
I am planning make a doodle jump type game, character jumping on platforms. A scrolling or doodle jump like background which ll appear to move when character moves upward and appear moving (just like ...
1
vote
2answers
557 views
Which axis-aligned line does an AABB collide with first?
I am making the collision resolution system for my 2d top-down game, and I managed to find a solution where I query which surfaces of other AABBs the current entity can collide with in the next frame.
...
0
votes
3answers
432 views
OpenGL 2D Depth Perception
I have a 2D RPG game written in Java using LWJGL. All works fine, but at the moment I'm having trouble deciding what the best way to do depth perception is. So , for example, if the player goes in ...
25
votes
3answers
3k views
2D water with dynamic waves
New Super Mario Bros has really cool 2D water that I'd like to learn how to create.
Here's a video showing it. When something hits the water, it creates a wave. There are also constant "background" ...
29
votes
4answers
3k views
How to render 2D particles as fluid?
Suppose you have a nice way to move your 2D particles in order to simulate a fluid (like water). Any ideas on how to render it?
This is for a 2D game, where the perspective is from the side, like ...
25
votes
4answers
3k views
Proper OO game engine design: how to parcel responsibilities
(note - I don't have the reputation to create new tags, so mod action may be needed to re-tag)
I'm in the midst of developing a 2D sprite-based game for Windows 7 Phone using XNA. The training and ...
18
votes
4answers
8k views
How can a programmer learn to draw 2D assets?
Are there any good tutorials for someone who wants to create 2D graphical game assets? Drawing classes for absolute beginners, preferably teaching skills that can be as relevant as possible to games - ...
18
votes
3answers
5k views
Is there a 2d physics engine that can model fluids and gases?
At this point the platform and programming language don't matter I would just like to know if something out there exists for this. Any help is appreciated.
13
votes
2answers
3k views
Creating an electricity/lighting/tesla coil effect in a 2D XNA game?
I'd like to create beams of electricity between two points very similar to this video: http://www.youtube.com/watch?v=eMJ8-56L3Lc. The effect is so dynamic, with varying lengths and pseudo-random ...
15
votes
3answers
1k views
How can I identify feature regions in a procedurally generated world?
I'm building an Island. I use the classical heightmap solution : with a hill-building function, avoiding the corners of the map, I make altitude. Then, perlin noise give me some climatic variables to ...
9
votes
4answers
3k views
Drawing large 2D sidescroller level terrain
I'm a relatively good programmer but now that it comes to add some basic levels to my 2D game I'm kinda stuck.
What I want to do: An acceptable, large (8000 * 1000 pixels) "green hills" test level ...
18
votes
7answers
5k views
Easiest, most fun way to program 2D games? Flash? XNA? Some other engine? [closed]
this is a post detailing my search for the most enjoyable way for a hobbyist game programmer to sweeten his free time with making a game.
My requirements:
I looked at Flash first, I made a couple of ...
21
votes
3answers
1k views
How does a 2D game like Zelda handle the character being behind buildings where only part of him is shown?
I'm trying to develop a simple Zelda-style game. I found this very useful topic
How was collision detection handled in The Legend of Zelda: A Link to the Past?
that I'm using as reference to develop ...
14
votes
1answer
2k views
Procedural Generation of Infinite Level
What are some good approaches to procedurally generating an infinite 2d level? The level could be constrained in either dimension but not necessarily.
The approach that makes most sense to me so far ...
9
votes
4answers
3k views
Vehicle physics with skid
How would I go about creating vehicle physics for a car that can loose traction? I want it to seem like the driver has a flat foot, so when you press the gas, they cars driving (rear) wheels loose ...
16
votes
3answers
1k views
How can I generate random lakes and rivers in my game?
I have a 2D block building game and am trying to make randomly generated lakes and rivers. I have looked into the Perlin noise algorithm, but, I couldn't get it to generate random and nice results.
I ...
12
votes
5answers
3k views
Examples of faking 3D
Does anyone know of any good examples of 3D being faked in 2D (not necessarily code, but games I could look up)? The player has the perspective that they are going 'into' the screen and things are ...
19
votes
2answers
1k views
Mega Man-style screen scrolling design
The NES classic Mega Man series uses a very specific scrolling technique that I'm having a hard time wrapping my head around implementing. Essentially, the level is divided into "screens" which are ...
12
votes
2answers
12k views
OpenGL ES 2.0: Setting up 2D Projection
This article describes in general, how to draw sharp OpenGL 2D graphics, using fixed function pipeline.
http://basic4gl.wikispaces.com/2D+Drawing+in+OpenGL
Because OpenGL ES 2.0 has some ES 1.x ...
11
votes
2answers
2k views
In a 2D platform game, how to ensure the player moves smoothly over sloping ground?
I'm developing a physics engine for a 2D platform game. I'm using the separating axis theorem for collision detection. The ground surface is constructed from oriented bounding boxes, with the player ...
11
votes
5answers
2k views
How can I implement parallax scrolling into my 2D game?
Let's say I have three layers: a foreground, an intermediate-ground and a background. What is involved in using these three layers to create parallax scrolling?
10
votes
5answers
1k views
Quick 2D sight area calculation algorithm?
I have a matrix of tiles, on some of that tiles there are objects. I want to calculate which tiles are visible to player, and which are not, and I need to do it quite efficiently (so it would compute ...
9
votes
2answers
1k views
Continuous Physics Engine's Collision Detection Techniques
I'm working on a purely continuous physics engine, and I need to choose algorithms for broad and narrow phase collision detection. "Purely continuous" means I never do intersection tests, but instead ...
5
votes
4answers
714 views
(Where) Can I learn to create art for my 2D games?
I'm currently bad at drawing. If I want to create something looking acceptable, it usually takes me hours and hours to fiddle around just to get the basic looks right.
I think that I'm not completely ...
17
votes
7answers
3k views
Efficient way of drawing outlines around sprites
I'm using XNA to program a game, and have been experimenting with various ways to achieve a 'selected' effect on my sprites. The trouble I am having is that each clickable that is drawn in the ...
13
votes
2answers
1k views
Wall Jump for 2D Platformer
I've been looking for a way to implement wall-jump in my xna game, but I can't find any information about it, can someone could someone please help me out ?
10
votes
1answer
757 views
Fog Of War - XNA
I'm creating my own top down 2D RTS game for personal educational purposes. Currently I really just copying Starcraft's design/ideas. I've decided I should probably implement Fog Of War too.
Let me ...
9
votes
2answers
371 views
Boat passing under a bridge in a 2D tile based RTS
I'm writing a 2D tile based RTS. And I want to add a 'pseudo 3D' feature to it - bridges over the rivers.
I havent't start any coding yet, just trying to think how it fits the collision detection ...
8
votes
2answers
1k views
How to create 2D game terrain?
Last month, I experimented a lot in game development using cocos2d for the iPhone, especially on moving and modifying sprites. However, vertices and polygons are still new stuff for me.
I developed ...
7
votes
4answers
647 views
Not sure how to handle “deceleration”
I say "deceleration" because I'm not using acceleration at the moment (it is being calculated, it's just set to 0 0); what I mean is moving the velocity back towards zero, eventually stopping.
I'm ...