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

6
votes
3answers
2k views

How are non-repetitive pixel backgrounds created in 2D games? (e.g., Superbrothers: Sword & Sworcery EP)

What methods are used to create complex, rich, non-repetitive 2D pixel backgrounds in games like Superbrothers: Sword & Sworcery EP? Examining screenshots from the game, I really can't detect ...
2
votes
2answers
135 views

A decent design for handling large creation/deletion of random objects?

So I was attempting a 'Hit the X' game (e.g Toss the turtle, spank the monkey) in which an uncontrollable object travels across the screen in hopes of hitting certain objects and avoiding others. My ...
2
votes
1answer
781 views

2D bullet movement speed problem [duplicate]

Possible Duplicate: Moving from A(x,y) to B(x1,y1) with constant speed? My problem is that I can't get my bullet movement right. The current update code I have for it is: speedX = deltaX; ...
0
votes
2answers
681 views

Creating pixel art / animation with flash

I have a friend that was the one creating graphics for my games. He left the town for some months (work, sigh) and I have tried to get in contact with him but it is impossible right now. Last talk I ...
1
vote
1answer
2k views

Rotation of images in Slick2D

I have have a rotation problem in the Slick2d library, the image is just not rotating (ie I set a rotation but no result is shown). Here is the rotation code: if (input.IsKeyDown(Input.KEY_LEFT)) { ...
2
votes
1answer
2k views

How do you implement 2D collision detection?

I would like to know the best or most efficient way to test for 2D collision. I am currently using AABBs. But the problem with this, is that your objects will be hitting things when they shouldn't. ...
3
votes
1answer
2k views

AndEngine Moving a Connected Texture and Physics Body

In AndEngine, many times we create a TextureRegion for our sprite. We can move this region around the scene but when I connect that region to a physics body I end up being able to use either one to ...
4
votes
1answer
586 views

Cinematic in 2D games

I am searching for a way to create and integrate cinematic in a simple 2D game with XNA for Windows Phone. I don't know if the best way is to create an animation with sprite and commonly process to ...
0
votes
1answer
2k views

Resource not found: testdata/alphamap.png

I started a tutorial for java's slick 2d library, called SlickBlocks which is essentally a tetris clone. The problem is I have followed and typed in the code examples to the dot, yet when I run it I ...
1
vote
1answer
605 views

Relating a point after an image is panned and zoomed

For Android, let's say you have a image of a map that you draw inside your view. On this map there are many, many "hot spot" locations where you want your user to be able to select. Given that there ...
0
votes
2answers
384 views

What features should a 2D graphics library have? [closed]

I am making a 2D graphics library in Python designed to make 2D easy and fast. Internally it uses OpenGL. The library does cover a bit more then a graphics library, it also includes windowing and ...
10
votes
1answer
1k views

How can I create gradiented Fog of War?

I'm creating a top down 2D RTS game for educational purposes. Currently, I'm really just copying Starcraft's design/ideas. I've decided I should probably implement Fog Of War too. My expectations: ...
3
votes
1answer
882 views

Scrolling the camera when the mouse cursor gets to the edge of the screen

I was wondering if you could help me: In XNA I have a hexagonal map, and the size of the map currently exceeds the size of the window. There is already code in place to move the 'camera' around the ...
0
votes
1answer
337 views

throw a 2D ball facing the target to simulate a 3D like effect

How would you update the state of a 2D object that is thrown forward(with an arc) facing a target to simulate a 3D(depth) like effect? var ball; //2D ball from a sprite sheet ball.x = 0; ball.y = 0; ...
2
votes
2answers
919 views

General 2D Collision Detection Question

Everytime I have coded "working" collision, I always went about it very haphazardly and unstructured. If I use Axis Aligned, or Verlet, Or Euler, any or all of these theories, my problems always lie ...
0
votes
2answers
281 views

Partial recalculation of visibility on a 2D uniform grid

Problem Imagine that we have a 2D uniform grid of dimensions N x N. For this grid we have also pre-computed a visibility look-up table, e.g. with DDA, which answers the boolean query is cell X visible ...
4
votes
2answers
414 views

Trace with 2D terrain

I currently have some 2D terrain in my game defined by 2D coordinates with lines drawn in between them (linear interpolation too keep it simple). Now I want to cast a ray from anywhere above the ...
2
votes
2answers
4k views

XNA a Simple 2D Point Light

I want to make a 2D Point Light in XNA, I was able to find some helpful information but it is too advance for me, since i know nothing about Shaders ...
4
votes
2answers
1k views

Grid/cell based light system

I am working on a top-down, 2d cell-based RPG game. I would like to implement a cell based lighting system, something like this and this. I basically have several light sources and light deteriorates ...
1
vote
1answer
538 views

Texture swapping and 2d Drawing in Xna

Usually in 3d drawing you want to ideally have fewer larger textures rather than lots of smaller ones, and make sure you render the same kinds of textures at the same time. So there is less texture ...
1
vote
2answers
924 views

Creating 2D billiard game with realistic movement

I'm new to XNA and game programming. I'm creating a 2D billiard game and I want to add balls with realistic movement (like 3D). Is it possible to achieve this without using 3D models? I only want to ...
-2
votes
1answer
904 views

C++ Valid for indie 2d games? [closed]

I am not currently developing any games, but am taking a C++ course. Will I actually be able to make any games with the knowledge I have from this course? I really just want to make a game with ...
1
vote
1answer
613 views

Can't seem to get predictive collision detection working correctly

I am trying to set up the collision detection on a basic 2d game, player clicks a button sprite moves one step int he corresponding direction. Currently all my sprites have the collision rectange ...
1
vote
1answer
258 views

How can I change the path a sprite is following in real time?

Is there a common way to implement a character following path that is issued and replaced in real time? For example: the character follows a path issued, and while it's on that path, if a new path is ...
3
votes
1answer
3k views

Creating sideways friction in a 2D top down racer

I've been playing around with trying to create some kind of top down racer but I'm having trouble getting the car to turn properly. At the moment this is the code I have to update the position of the ...
8
votes
7answers
1k views

Can I use copyrighted sprites for a demo?

I just had a quick question and wanted everyone's opinions. I'm making a 2D demo game for a resume which I want to post online. I'm applying as a programmer position so I don't really have my own ...
6
votes
3answers
2k views

Is there a simple way to group two or more sprites, so all of them will be dependent on each other?

I think that this question is very similar to this one, but I'm not sure if the answers are universal. So, my goal is: Place two sprites in fixed position, for example player and his eyes Make ...
1
vote
2answers
465 views

How to achieve graphics like those in Spy Mouse

I'm really interested in making a new application for iPhone, and I have some experience in objective-c. My main problem is the visual part. I want to have graphics like in Spy Mouse. Could this be ...
0
votes
2answers
539 views

How do I handle specific tile/object collisions?

What do I do after the bounding box test against a tile to determine whether there is a real collision against the contents of that tile? And if there is, how should I move the object in response to ...
2
votes
2answers
1k views

How do I draw 2D textures with Direct3D 11.1?

I'm running into trouble trying to figure out the best way to draw textures to the screen using Directx 11.1 (for Metro apps). In XNA, I used SpriteBatch. Is there something partially comperable? In ...
23
votes
4answers
2k views

Why does my object move faster at 45 degrees than at 90 degrees?

I have objects in my game that move faster at 45 degrees then at 90 degrees. Each object has Point (x,y) position Vector2D (x,y) direction Int speed And what I do during a update is that new ...
3
votes
4answers
797 views

Is it better to track rotation with a vector or a float?

In XNA, you can see that to draw a rotated sprite with SpriteBatch, you'll need a float describing the angle in radians. I'm used to making games in OpenGL. I just want a rapid prototyping ...
1
vote
1answer
1k views

OpenGL relative 2D camera

Some days ago, I've felt a need to add a camera to my game, it's a puzzle. That would let me move the board, zoom in and etc. This gave me control to do boards muuuch larger, soon, more complex ...
2
votes
2answers
2k views

Designing Collision Detection for 2D Rectangular Adventure/RPG

TLDR: I'm looking for an efficient way to detect collisions between irregular/small objects that are not a full tile size (like small cans) and a free-moving character in a 2D game. I'm planning to ...
1
vote
2answers
189 views

How do i calc what side the ball is of the rect?

I have this nice drawing: http://bildr.no/view/1085283 I know the ball's center and the rectangle's center, but how do I know (programming C#) what side of the rectangle the ball is? By my drawing, ...
7
votes
3answers
2k views

Should I move the world or move the player?

I'm about to start developing a sidescrolling game where the players goal is to travel as far as he can in the horizontal axis before touching down. Note that I do not need to ever travel back on the ...
4
votes
2answers
849 views

What is a good way to determine if a vector is between two other vectors?

I could operate with the angles, but I do not have the angles calculated yet (and would like to avoid having to do that). It would be possible to calculate and cache the local-coordinate-frame angles, ...
10
votes
1answer
3k views

How can I define a complex collision area on top of a tile map?

As many people recommended, I am using Tiled map editor to create a map for my game and it's great particularly because libgdx framework also provides with API for maps from Tiled. I understand I can ...
4
votes
1answer
1k views

2D Collision: Check before or check after?

I'm using velocity to move my character, I just add/subtract 0.4f and then update the players position in the update loop. I was wondering, when would be the best place to check for collision? Do I ...
3
votes
1answer
2k views

Optimizing HTML5 canvas transformed drawing in Javascript

I am trying to optimize my HTML5 game engine and have noticed that currently a majority of the time taken in the game loop can be taken when drawing transformed tiles. I think this is because each ...
8
votes
1answer
887 views

2D helicopter game, how to create corridor walls?

I'm looking into adapting the classic "helicopter" game (i.e. http://www.addictinggames.com/helicopter.html), but I haven't yet figured out how to create the walls-generation engine. Any pointers ...
3
votes
3answers
803 views

Non-GPU Noise for 2D side-view terrain generation?

I really couldn't find a correct answer while scowering all the forums for Noise Generation. My goal is simple, I really want to have two distinct layers for my terrain, a white layer representing ...
3
votes
2answers
821 views

How can I make a sprite move in the direction it's facing using radians?

I am using PGELua for the PlaystationPortable. I would just like to know how to make a 2D sprite move in the direction that the sprite is facing. When the sprite is blitted to the screen it should ...
10
votes
3answers
3k views

Can I achieve a torchlight effect (lighter area around a light source) in a 2D game?

I am thinking of writing myself a simple 2D game. It will not shine with perfect graphics or gameplay at first, but I'd consider it my first step in PC game development. So, imagine such simple ...
4
votes
1answer
863 views

Are there any good engines for isometric collision detection and platforming?

I've decided to resurrect an old game idea I had years ago. I currently have zero experience with programming, but I'm going to begin studying either C#, Python or both in the near future. The issue ...
1
vote
1answer
2k views

XNA 4.0 - Mixing 3D and 2D - SpriteBatch putting weird alpha texture over whole scene

I am working on a game in XNA 4.0 that has been entirely in 3D so far but now I want to incorporate a HUD. I have tried doing a simple test using spriteBatch as such: spriteBatch.Begin(); ...
3
votes
4answers
973 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, ...
5
votes
1answer
7k views

Tools for 2D skeletal animation [closed]

What good free and widely used tools are there for editing 2D skeletal animations? Preferably, one that allows me to write custom animation exporters. One pretty good indie tool that I know of ...
4
votes
1answer
3k views

How Plants vs Zombies animation is done?

I really like the plants vs zombies style of animation and it doesn't look complicated yet the result is really good. I doubt it's made of sprites seeing there's a large number of animations, ...
8
votes
2answers
669 views

Function for sun movement?

So, given a sun sprite set at the horizon (x = 0, y = worldheight/2) I'm trying to devise a function to make the sun rise, then fall. The best way to do this would be the sin function, but I have no ...