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
2answers
291 views

How do I implement a 2D camera in JPanel?

I'm trying to create a mario-esque game in Java and am at the point of implementing a camera. Following normalocity's example, I understand the difference between the GameWorld and the Camera that ...
22
votes
6answers
2k views

Is OpenGL appropriate for 2D games?

I have been teaching myself the OpenGL library for a while now, and want to start making a game. However, for an easier introduction, I want to start with something 2D, such as a top down ...
3
votes
1answer
123 views

Smoothing the scrolling path in 2D

I have the following problem: In a 2D game the screen can scroll in any of the 4 directions. Basically, the center of the screen during scrolling moves from (x1,y1) to (x2, y2) whereby (x1,y1) is the ...
5
votes
1answer
595 views

Pathfinding with 2D, non-grid based movement over uniform terrain

I'm looking for the best solution to pathfinding in my game. The map is ultimately grid-based, but entities are positioned using floats, and can move in any direction to any point on the map. The ...
1
vote
1answer
85 views

Graphics.drawImage will only fill a small portion of my control

I'm trying to create a map class for a simple 2D game. The map has an array(100,100,5) of string, returning the kind of tiles to draw ( with 5 possible layers from 0 to 4) players will move on the 2nd ...
1
vote
1answer
230 views

World to Pixel Transformation

My objects have a location in world coordinates (basically 1.0f is a meter). If I simply draw my objects using their world coordinates, each meter will correspond to a pixel. Obviously that's not what ...
8
votes
2answers
202 views

When should I represent points and sizes as structures?

As part of my simple Ruby 2D game development framework, my game objects have position (x and y values) and size (width and height). class MyGameObject attr_accessor :x attr_accessor :y ...
2
votes
1answer
479 views

How to handle a Tile Map Scrolling [duplicate]

i'm making a video game, and i'm having, i think, a concept problem. The game will be a platformer which will use tile maps, so to start i will create a mask matrix indicating the tiles to be loaded, ...
3
votes
1answer
329 views

Effecient finding of long-range spotting targets

I'm creating a top-down 2d strategy game, with a square grid map. So far, I've used Bresenham's line drawing algorithm in a circle to determine what's in LOS of each unit, and then targedt one of the ...
1
vote
0answers
211 views

2D Camera transformation sidescroller

i am currently trying to dive into 2D programming with DirectX, especially bulding a tile based sidescroller. I have worked with some chapters from a book (Advanced 2D Game Development) but always ...
0
votes
2answers
184 views

Best 2D graphics API when the only functionality needed is writing individual pixels to the framebuffer [closed]

I have been dreaming for years about programming a relatively simple, but from the standpoint of the game engine, a very unusual 2D game engine for the PC platform. I am planning to use either C or ...
9
votes
1answer
309 views

How do I implement 2D shadows cast between layers?

How could I implement 2d shadows that are cast by objects in a different layer? NOT like the dynamic lighting in the well known tutorial from Catalin Zima : But like the shadows of the pipes in ...
7
votes
2answers
200 views

How do I handle game objects with two depths?

I want to be able to do what you see in the image, but with a single wall. The player should be able to walk on either side of the same object. That is, the same wall is below the hero when I go ...
0
votes
0answers
97 views

Mapping a 2d side-scroller onto a top-down overworld map without any transitions

Greetings fine people, I'm currently thinking of a way to map multiple 'areas' of a 2dSS on a top-down overworld map in a way that you wouldn't need to transition onto an overworld and then walk to a ...
-3
votes
1answer
111 views

Undefined fireball movement behavior

Demonstration video I try to do after the player shoot 10 times of fireball, then delete all the fireball objects and recreate a 10 new set of fireball objects. I did it but there is a weird bug ...
1
vote
1answer
602 views

How to set orthgraphic matrix for a 2d camera with zooming?

I'm using ID3DXSprite to draw my sprites and haven't set any kind of camera projection matrix. How to setup an orthographic projection matrix for camera in DirectX which it would be able to support ...
1
vote
1answer
189 views

Collision detection with entities/AI

I'm making my first game in Java, a top down 2D RPG. I've handled basic collision detection, rendering and have added an NPC, but I'm stuck on how to handle interaction between the player and the NPC. ...
0
votes
2answers
116 views

tool for visualizing simple 2d shapes

I'm drawing simple 2D line shapes using coordinate sets (for example, moveTo(x,y) drawTo(x,y)). I would like a tool that is like a sheet of graph paper. When I click on intersection points it records ...
2
votes
2answers
742 views

How do I create curved ground in a 2D runner game?

If I use tiled based map I can have only rectangular objects. What is a strategy for creating slanted or curved ground in that case? Should I use a tile-based map, or should I define corner points ...
0
votes
1answer
132 views

Rotate 2d sprite towards pointer

I'm using Crafty.js and am trying to point a sprite towards the mouse pointer. I have a function for getting the degree between two points and I'm pretty sure it works mathematically (I have it under ...
2
votes
1answer
133 views

Pathfinding results in false path costs that are too high

I'm trying to implement pathfinding in a game I'm programming using this method. I'm implementing it with recursion but some of the values after the immediate circle of tiles around the player are ...
2
votes
2answers
375 views

Level Representation in a 2D Game

I would like to create a 2D game, where a character should move on a stage/level. My stage would be static, constructed some little cubes, similar to the well-known Mario game: some of the elements ...
0
votes
1answer
496 views

Character movement on a 2D tile map

I'm working at making a HTML5 game. Top down, closest thing I can equate it to is the gameboy zeldas, but open world and no rooms. What I have so far is a procedurally generated map in a multi ...
3
votes
1answer
307 views

The most efficent ways for drawing lines all day long with OpenGL

I'd like to put a computer screen that is running an OpenGL programs in a room. It has to run all day long (not in the night). I'd like to draw lines that are slowly fading in the background. The ...
3
votes
2answers
277 views

What would be the most simple following target and neighbors avoidance algorithm in 2D space on plane?

I have ~20 or more enemies and they need to follow a target and avoid to go on top of themselves. I mean follow a target and avoid to collide with each other. Area, on which they are walking, is just ...
5
votes
3answers
327 views

How do you find games with a similar idea?

I'm thinking about making an indie game and want to know if there's maybe one with similar idea. I'm not asking about my idea specifically, I just want to know how to find out if a game has the same ...
-1
votes
1answer
142 views

How to speed up AStar? [closed]

I have this AStar class, and at the movement it is INCREDIBLY slow. It takes waaay longer than I expected it too, and I'm not quite sure why. I added the generation part at the very beginning to ...
-2
votes
1answer
259 views

Why does my sprite shake while moving?

Player movement causes its sprite to shake a bit. I don't what is causing it or how to fix it. I recorded a video of the problem. In the recording, it looks like the world is shuddering, but only ...
0
votes
1answer
331 views

How can I create a tile-based game map from a large source image?

I'm trying to make a huge tile-based map for my game. I've authored a large source image of the map and saved it, but now I'm unsure how to break this up into tiles and render it as a grid so I can ...
1
vote
1answer
328 views

How can efficiently I edit my 2D tile-based maps?

I've been developing a very basic 2D tile-based game for my own experience. I read what must be hundreds of tutorials on what I found on Google with "tile based maps". Almost every tutorial I see is ...
0
votes
1answer
227 views

Projecting world coordinates to screen coordinates issue - points disappear when origin not in view

I am trying to implement a 2d line drawing effect on a 3d mesh using Ogre. In order to do so, I perform silhouette detection on the lines of the object (this works) and then project these lines from ...
2
votes
1answer
285 views

2D Terra(ria)in generation - Accidental noise

I'm currently trying to implement terrain generation as described on the following page: http://accidentalnoise.sourceforge.net/minecraftworlds.html. But I have issues understanding how to interpret ...
0
votes
1answer
95 views

How to render polygons of arbitrary shape? [duplicate]

I am trying to render a plane with nodes. FYI : Nodes know what other nodes it is being attached to. I can think of a way to render them as long as they are aligned in a circular pattern; have a ...
1
vote
1answer
340 views

How to create a similar 2.5D art style character

EDIT: I am asking about the characters not the 2.5 scene I am the graphic designer of a game and I want to recreate the look and feel of these images: My questions are: Does this style have a ...
-2
votes
1answer
141 views

Collision detection-too fast [closed]

I've looked through a few other answers and it seems like I'm doing a dynamic timestep update and I'm checking about 10 pixels before the rectangle to see if it would intersect. However, the updating ...
2
votes
1answer
141 views

Dynamic graphical elements in a 2D game [closed]

I'm an mobile and web developer. I got interested in game development couple of weeks ago and I'm really looking forward to work on a mobile game. I will be doing everything including the game design ...
0
votes
1answer
127 views

Formula throwing a ball to destination [duplicate]

I am throwing a ball using this: double v, vx, vy, alpha, t2 = 0; if (Keyboard.GetState().IsKeyDown(Keys.Up)) { alpha = MathHelper.ToRadians(60f); v = ...
1
vote
1answer
423 views

Android Dynamic 2D Map

My problem is, I want to create a 2D tiled map. Yes, I know it's been asked a lot. I've seen answers that propose the use of tiled however it only allows (or so it seems to me) to generate static maps ...
0
votes
1answer
107 views

How to handle zooming? (Collision detection and speed are off)

I'm working on a bird's eye view 2D game. I want to zoom in/out based on the entity's speed (similar to GTA 1/2), but I'm struggling with the zooming. To zoom, I simply scale all the entities by the ...
6
votes
3answers
2k views

How do I implement occluded lighting in a block-based 2D game?

I want to have 2D lighting that can be blocked by in-game objects. My game has a top-down view and all game objects are described by rectangles. Let's say I have a 10x10 world and I place a light at ...
1
vote
0answers
113 views

2d terrain workflow [closed]

I am new to 2d art and I had a question about the ground part of a level. What does the workflow look like for a 2d game like Dust: An Elysian Tale or Shank 1-2? I want to do that kind of ground where ...
2
votes
1answer
216 views

How to handle scripted events in a 2d java game?

I'm in the planning phases of a 2D java game. The game is a tile-based platformer with some action-y parts to it, like a Metroidvania formula game. The static portion of each stage is expressed as an ...
1
vote
3answers
95 views

Move from point a, to point b, and determine the accuracy

Let's say I have a circle at point a (0,0), and I wish to move it to point b (23,58), whatever, how can I accurately do this with a speed variation if I wanted. (I'm doing this in javascript). Every ...
1
vote
1answer
180 views

Creating big scene and little size chasing camera

I would like to create a climb based game, so I need to have a big scene and a camera that cover only a little part of it and chase my player. This image explains easier what I want: How can I do ...
2
votes
0answers
231 views

Good Book or Resource for 2D Game Art [closed]

I have a very clear idea for my first Game . I have immense Experience in Coding Games in LibGDX but i am very poor at game art . So far I've been hating all the characters I've drawn . Are there any ...
0
votes
1answer
54 views

Need a Push in the right Direction [closed]

I know this been asked a millions of time. First off my Dabbled in a few languages,like Java,C#,Android,Python and unity even though that's not really a language.My Programming is Level as at far ...
0
votes
1answer
2k views

How do I make a game tick method?

I've seen in some other simple 2D games that a "tick" method is used to sync game logic and graphics rendering. My main reason for using this is due to my collision detection malfunctioning, since ...
6
votes
1answer
676 views

Generating a physics body for 2D Worms-like Terrain

I wrote a processing sketch that generates hills for a scorched earth clone, like this: I'm trying to figure out how to make this a physics object in libgdx, but I'm having problems figuring out ...
-4
votes
1answer
217 views

Recommended graphic software for creating great graphics in game? [closed]

I came across a game called Trine2. It has a great graphics here is one image i captured here. Forgive me but I need 10 reputation to upload image so i use external sites. How did they create that ...
0
votes
3answers
341 views

how can we define dynamic Path of ViewObject(Bitmap) On Canvas

I am Currently working on One 2D Android Game, In this game One ViewObject(Bitmap) is moving Across Screen On Parabola Path Like in this Image, But this Path is Static, the Static path is getting ...