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
1answer
83 views

Better way to handle ordering and visibility of renderable objects?

I'm just wondering whether there is a more effective way to handle the ordering and visibility of renderable components that fits into the design of my already existing engine. How I do it now: In ...
0
votes
1answer
109 views

Load all bitmaps at once or only when needed?

I am starting to get a pretty hefty amount of bitmaps in my 2d game for android. I load them all in 3 colors to save some memory but the thing is, I load all of them when "Start game" is pressed, even ...
0
votes
1answer
137 views

Scaling background without scaling foreground in platformer?

I'm currently developing a platform game and I've run into a problem with scaling resolutions. I want a different resolution of the game to still display the foreground unscaled (characters, tiles, ...
1
vote
1answer
156 views

AABB vs Rectangle

I'm trying to wrap my head around 2D physics and stumbled upon Axis Aligned Bounding Boxes, and I have a couple of questions regarding them. In all AABB structs I could find out there, people prefer ...
1
vote
1answer
102 views

Is the Key Bindings delay unavoidable in Java when pressing different directional keys quickly?

I've read just about every tutorial I can on why to use Key Bindings instead of implementing the KeyListener interface, including all the examples that show using a field to track the key event ...
0
votes
1answer
107 views

Java 2d game cross-platform compatability

I need to make a few small, simple 2d educational games primarily to help kids improve their reading. Drag & drop/matching words with pictures, spelling out words as well as maybe a scrolling ...
0
votes
1answer
134 views

Questions about networking theory in a 2d shooter game [duplicate]

So currently I am starting to work on a 2d top down space shooter game, and I have just got to networking. So far the client can draw a ship at a desired x, y and rotational coordinate with any set of ...
0
votes
2answers
99 views

very simple math destination and speed calculation

My player goes to (destinationX, destinationY) His position is: (x,y) and the player has an update event function update() { this.x = this.x + dx; this.y = this.y + dy; } what is the formula ...
0
votes
0answers
153 views

2D Sidescroller camera

I'm using OpenGL. For my tiles, I'm using a display list and I'm just using immediate more for my player (for now). When I move the player, I want to center him in the center of the window, but allow ...
-1
votes
0answers
51 views

Draw object to screen without being affected by rotation / zooming [duplicate]

I have a 2D game, with a camera that follows the main player. In the game the camera may also rotate the view around the player / zoom in or out on the player. Let's say I want to add a mini-map to ...
1
vote
1answer
87 views

Does a 2D Vector or 2x2 Matrix play any role in 2D Transformations?

I'm having trouble trying to figure out if a vec2 or mat2 class are used at all in transformations for 2D rendering. Vec2, apart from representing UVs, AFAIK, is relatively pointless in regards to ...
-1
votes
1answer
34 views

Movieclip to spawn in in a set perimeter

I like to make a movieclip randomly spawn in a set area. But theres a little more to it, usually you'd have something like the X pos set to something like 250 (say the centre) and the Y pos set to be ...
0
votes
1answer
125 views

3D rotation and movement of ball on a 2D plane

Here is a video of Amiga arcade pool game: https://www.youtube.com/watch?v=zTQIPFBUFIg I am making a similar game with C and Gtk+3.0 but I don't know how to show balls 3D movement on 2D plane! I ...
2
votes
3answers
157 views

How to manage game objects, npcs, items? [closed]

i'm making a small 2D game, designed the maps with Tiled, and adding "basic" world object/items/npcs/mobs to test it a bit and have fun. Now i have encountered a relatively huge problem, with further ...
2
votes
1answer
248 views

How to split a 2D sprite tile set into individual sprites?

I see a lot of sprite catalogs for games provided as single PNG image, like the one below. I'm interested if I have to manually create tiles from that, or if there's some program that can split it ...
0
votes
1answer
103 views

What size textures do I need for a 2D grid based game if my tiles are larger than textures I have?

I'm building a grid-based game for iPad, and for usability purposes I've selected my game grid to be built of 75x75 squares. However, so far I've seen that the majority of (free)texture catalogs I can ...
0
votes
1answer
80 views

Why is interpolation passed into the rendering routine when the position and speed are related to the update routine?

I've read this in several well known articles, including this one: http://www.koonsolo.com/news/dewitters-gameloop/ Under the Interpolation and Prediction subheading is the description of the ...
0
votes
2answers
71 views

Angluar movement

I'm making a little game where you are a spaceship and you fly around in 2d using the A and D key to rotate and the W key to accelerate. Now my problem is if i turn my ship it doesn't go into the ...
0
votes
1answer
53 views

Farseer Circle Body Problems, Please help!

I have created a circle body class, but in game my player body just passes through it. the circle will not move, only rotate. however when i create the circle body just straight up, raw in the game1 ...
4
votes
2answers
601 views

How do I make a 2D game resolution independent?

I'm working on a simple 2D game. I've finished the mobile phone version. However, my boss wants the game to works on his RT. I'm doing the "conversion" but my buttons are in the wrong places, because ...
1
vote
1answer
202 views

Lighting Covering Up Sky ( XNA / C# )

I have a 2D tile-based lighting system which is drawn onto a Render Target. I am also drawing a background which involves mountains, sun/moon, and clouds. There is also the unlit game; blocks, ...
0
votes
1answer
188 views

Creating a knockback effect

I'm fairly new to creating a 2D game in java and I'd love some help. I'm trying to create a sort of knock back effect the enemies have on you. So when you are touched by a enemy you will: lose life ...
0
votes
1answer
132 views

Efficient approaches to updating adjacent grid tiles when one tile is disabled?

I'm trying to update the surrounding grid of tiles if one of them is disabled (not removed). For example, imagine we have a grid of tiles each with x representing one texture: x, x, x, x, x, x x, x, ...
0
votes
1answer
94 views

Map color collision problem

Hello i'm doing a game in WPF, 2D version (top view) I have the map and i'm trying to check for color collision in pixel each time the timer is activated Well...with 1 object it works fine but with ...
0
votes
0answers
15 views

How should I go about making a tile map in Allegro? [duplicate]

How do I make a tile map for Allegro?
1
vote
1answer
156 views

How can I implement jumping in a 2D game using bounding box collision?

Problem: I'm trying to implement basic jumping to my 2D game engine, but have failed several times. Basically what I've done so far is disabling gravity and using a separate function moving the player ...
2
votes
1answer
325 views

How can I create 2D shadows that let me detect when the player is inside them?

I'm working on a 2D platform game, and I want my platforms to cast shadows along with some way to detect if the player is inside the shadow area (that is, not hit by the sun). More specifically: I ...
0
votes
1answer
107 views

When to use class/objects for graphics [closed]

I am fairly new to game development, but I have a good programming background with object oriented programming. But with games, I do not know when I should use an object (or class) for an entity on ...
2
votes
0answers
180 views

Help with 2D sprite instancing [closed]

Alright, so I'm pretty new to OpenGL programming. I've been writing my own engine, initially using the fixed function pipeline. I then did a 1:1 replacement of the fixed-function methods with shaders ...
0
votes
1answer
323 views

Directx 11 , problem positioning a 2D quad , center starting at bottom left and not top left

I'm following some tutorials of directx 11,and i was able to draw a quad, but my problem began when i was applying transforms , for some reason, my quad at position 0,0, start at bottom left of my ...
2
votes
2answers
776 views

Algorithm for continuously generating a tile map for a topdown 2D game? [duplicate]

In essence, what I'm looking for is a procedural 2D tilemap continuously generated in a fashion like Minecraft - which is to say generated as the player approaches the edges of the already explored ...
1
vote
2answers
109 views

Moai: Clipping an image to a polygon

I'm using Moai SDK. I have an image and some random convex 2D polygons. I want to show only the parts of the image inside these polygons. Here's an example image: The same, shown only where the ...
0
votes
1answer
123 views

Programming and drawing to deal with different screen sizes and resolutions

I started making an XNA game years ago and picked it up recently. I'm looking later to convert it to use Monogame so that it can be deployed on various mobile devices and OS, though I have a sinking ...
4
votes
1answer
793 views

Faking 2d light using shader (Unity, Shaderlab)

Since the concept was difficult to explain in words for someone who's not quite familiar with shader, I described it in pictures. I'm currently using Unity and it seems Shaderlab is the best choice ...
0
votes
1answer
149 views

Circle-Rectangle collision velocity adjustment

I created my circle vs. rectangle method based on this algorithm: http://stackoverflow.com/questions/401847/circle-rectangle-collision-detection-intersection Currently, I have a dynamic ball with ...
0
votes
1answer
109 views

Why do I get an exception when accessing my sprite members in this fashion?

I'm getting a NullReferenceException error on the line where I do new Vector2(...). I think the problem is with the variables I'm using even though they're working to control the player sprite, so ...
0
votes
1answer
228 views

Circle vs. Rect Collision accuracy problem

The blue ball is dynamic and is supposed to bounce off the walls, as well as the rectangle. Currently, the green rectangle is adding an invisible line to the scene, which doesn't let my ball go where ...
9
votes
1answer
3k views

Can Unity 2D be used to make pixel-art games?

I'm looking at the new 2D features introduced in Unity 4.3, and I think I might be missing something. To me it looks like they are designed for high-res 2D games, where scaling the sprites is ok, but ...
0
votes
1answer
111 views

Collision method for multiple circles

This is a bouncing ball program. There is 1 dynamic circle and 3 static ones. The static ones are obstacles for the dynamic circle, and the dynamic circle is supposed to bounce off of the static ...
0
votes
2answers
317 views

How to make different layers in a 2d game map

My question is this: How do I make a gamemap from the drawings on my spritesheet? The tutorial I have followed for making a java 2D game uses this technique to make a gamemap: in photoshop I create ...
6
votes
1answer
138 views

How should I attenuate sound in a 2D game where you can zoom in and out?

In my 2D game, I have some ambient sounds like the noise of a waterfall or the humming of a generator. However, it is not practical to play these sound all the time at full volume as in a large level ...
2
votes
1answer
201 views

Circle to Circle collision - bad accuracy

Circle1 (blue) is moving and its X and Y bounds are the screen (meaning it bounces off the walls). Circle2 (black) is stationary. Circle1(blue) is supposed to bounce off of Circle2 without ...
0
votes
1answer
224 views

Bounce off of objects

How do I make my ball bounce off objects on the screen? I'm having trouble detecting the collision, as well as calculating the response. The picture below is a good example of how the program should ...
2
votes
2answers
130 views

Finding tileX and tileY based on x and y (and vice versa) in isometric 2D view

I'm working on 2d Isometric game in ruby and gosu, although my problem is probably universal. My map is saved in 2d array: @map_tiles[layer][y][x] = tile_id Each tile is displayed on coordinates: ...
2
votes
0answers
115 views

What would be a good way to implement Zelda like attack? [closed]

I'm looking for ways to implement "attack" like Gameboy Zelda used. A method I came up with is: Create a rectangle near a player based on the direction the player is facing when every time attack ...
1
vote
1answer
132 views

Clearing an SFML scene with a partially transparent color

Is there way to clear a scene with a transparency (alpha) value, in pure SFML? I'm trying to clear with rgba(0,0,0,128) so the previous frame still partially shows through, which would create a ...
1
vote
1answer
429 views

2D Rectangle/Circle Continuous Collision Detection

I'm looking for a fast 2D continuous collision detection algorithm for circles and rotated rects. It needs to determine the time of collision. Both shapes may be moving at high speed, so the ...
0
votes
0answers
208 views

Design virtual resolution for 2D development in Unity

I came to Unity with Cocos2D-X experience in mind. In Cocos2D-X, I can choose a "virtual" screen resolution size to rely on the entire game during development and the game will automatically adapt to ...
0
votes
1answer
199 views

Rope Colliding with a Rectangle

I have my rope, and I have my rectangles. The rope is similar to the implementation found here: http://nehe.gamedev.net/tutorial/rope_physics/17006/ Now, I want to make the rope properly collide ...
1
vote
0answers
59 views

Vector or Raster? [closed]

Me and my co-developer are developing an overhead shooter and we're on the fence about picking between raster and vector graphics. I'm for vector, he's for raster. He's pointed out a very good point, ...