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

3
votes
0answers
176 views

How do I handle rope physics with fixed ends and a sliding weight?

I've been interested in rope physics recently—I've successfully implemented a simple Verlet rope with moveable ends. Now I am trying something a little different: I want to start by recreating the ...
3
votes
0answers
486 views

Optimal OpenGL 2D Sprite Batching (Best Practice)

I am working on simple 2D engine using OpenGL (3.3+) for rendering and was wondering what the optimal method of sprite batching would be. I plan to put all sprites into one (or fewer) texture atlases. ...
2
votes
0answers
1k views

Why is my deferred lighting implementation so expensive?

I've implemented deferred lighting and I tried to put about 20-26 lights on the viewable space of my map, and it brings down the FPS from 61 to 28-31. It also makes my VGA temperature to go from 68°C ...
1
vote
0answers
49 views

Why does my texture-based object picking detect the wrong object?

I am a LibGDX beginner implementing a RISK-like game. I want to let the player select territories by clicking on them, but for some reason, the wrong territory is sometimes detected. The clicked ...
1
vote
0answers
106 views

Phaser / PIXI: World size vs. Stage size

I am using Phaser to build a "zoomable / pannable" 2D galaxy with the intended functionality being that the player's home planet is always in the middle of the World coordinates. I have a problem ...
1
vote
0answers
63 views

Cubic bezier polygon clipping

I have a large cubic bezier defined 2D polygon area which I need to render in DX11 real-time to create as many 4096x4096 textures as needed. An average control point count would be around the 12k and ...
1
vote
0answers
48 views

How to make a text of several letters animate, only with an animation

I wonder if it is possible to create an animation in a text with a single "animation". The problem is that for me to reach the desired effect I need to create an animation for each letter, as each one ...
1
vote
0answers
73 views

unity4.3 rigidbody2d unexpected force behaviour

So guys ive edited the question and here is what my problem is i have a player which has a rigidbody2d attached to it.my player is able to doublejump in the air nicely and stick to walls when ...
1
vote
0answers
794 views

Unity 2D loading Spritesheet Atlas at runtime from web and using it dynamically

I am new to Unity (came from AS3/Starling) and just started for 2D games in Unity. I have a spritesheet / texture-atlas (many different sized images packed in a single png) which I want to download at ...
1
vote
0answers
170 views

How should matrix-based Parallax Scrolling work?

The question is at the end, as it requires a bit of context. I'm not sure if my understanding, my code, or LibGDX's ParallaxCamera is wrong. LibGDX's ParallaxCamera uses Matrix4s to achieve a ...
1
vote
0answers
268 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 ...
1
vote
0answers
153 views

scale rotating boundingbox

I want to use basic rectangular collision detection. I have a rotating sprite and a method that calculates the bounding box every time in the Update() method. I simply check for intersection between ...
1
vote
0answers
304 views

iOS cocos2d - sprite gets stuck in collision detection

I'm developing a top down game in cocos2d and I have collision code that checks collisions between enemies and the player so that they don't go through each other. The code seems to work but the ...
1
vote
0answers
59 views

Creating transparent image with localGraphicsConfig not always working

I'm trying to use GraphicsConfiguration.createCompatibleImage to create transparent images. This creates an empty image which I'm filling with a mosaic pattern later on in the code. This seems to ...
1
vote
0answers
430 views

Stacking Drawing Matrix for SpriteBatch in XNA

I'm trying to make a 2D engine for XNA with SpriteBatch. My object unit is Entity, which can include other Entities as its children. However, when drawing them, the rotation and scaling stacking do ...
1
vote
0answers
147 views

How can I use iteration to lead targets?

In my 2D game, I have stationary AI turrets firing constant speed bullets at moving targets. So far I have used a quadratic solver technique to calculate where the turret should aim in advance of the ...
1
vote
0answers
103 views

Audio Panning using RtAudio

I use Rtaudio library. I would like to implement an audio program where I can control the panning (e.g. shifting the sound from the left channel to the right channel). In my specific case, I use a ...
1
vote
0answers
237 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
vote
0answers
365 views

Dynamic 2D soft shadows with concave polygons?

I've implemented dynamic 2D soft shadows from this article on gamedev.net. It uses an image for the penubmra and is fast, physically accurate and looks good in most situations, so I really like the ...
1
vote
0answers
61 views

DirectWrite Producing Strange Artifacts?

I've written the basis to my UI system around Direct2D. I like it because it's fast and easy to use (even if I had to do some messy work to get it to work with DirectX11). However, I notice when using ...
1
vote
0answers
202 views

Sprite sorting issues

I apologize for the vague title, I'm not sure how else to phrase this problem. I am using tIDE to assist me in my game's world development. To give a dynamic effect to map layers within tIDE, it has ...
1
vote
0answers
295 views

Need help with objects moving toward the player

I am making a 2D game with simple "gravity": everything is just pulled toward 0,0. The speed at which they accelerate towards it is GravityAcceleration up to MaxGSpeed. I also want the player to be ...
1
vote
0answers
119 views

Fixed time step with Akihabara

How could I implement fixed time step with Akihabara framework? I would like my avatar to move by fixed distances of one block as in Supaplex.
0
votes
0answers
41 views

Dynamically destroy objects when player enters a boxcollider2D

What would be the best approach for destroying dynamically objects when player enters a boxcollider2D? Currently using parent objects with boxcollider2d to activate OnTriggerEnter2D, boxcollider2d is ...
0
votes
0answers
31 views

Change 2D Angle Into Isometric Angle

i Rendered My Sprite With 72 Angles In Isometric View. Rendered Frame Number 0 And Angle 0 Is When My Sprite Looking Right And And I Rendered My Sprite Every 5 Angle. In My 2D Game My Sprite Moving ...
0
votes
0answers
61 views

2D pixel art gets “jittery” as camera moves

I'm working on a game that makes use of low-res 2D pixel art. The textures are filtered with nearest neighbor filtering, and sprites are created with 1:1 size ratio of the textures (eg. 16x16 sprite ...
0
votes
0answers
25 views

Angel2D won't find GLFW

I'm doing my first steps with C++ and game development to build a simple prototype. I've chosen Angel2D as framework to get some help from the beginning but I have problems to get it working with a ...
0
votes
0answers
58 views

How to get drawing offsets for an isometric camera

I do have some semi-working code, but I'm really stuck on getting everything to align to the screen properly. Here's my current, broken solution in Javascript: //ts = tile size (i.e. 64), th = ts/2, ...
0
votes
0answers
47 views

How can I get the position of a cursor on world space on a 2D game

I am trying to make simple 2D top down shooter to train my skills on Graphics programming and I am having trouble getting the input. I am using glm as my math library, what I am trying to do on the ...
0
votes
0answers
75 views

How to get rid of half pixel artifacts?

I've been having a bit of trouble using OpenGL to make 2D games. I am using a traditional ortho perspective with just some sprites being rendered and moved around. It all works perfectly but there is ...
0
votes
0answers
76 views

Layers with parallax in a game with zoom out by a transformation matrix

I'm trying to implement a parallax rendering to my multi layered backgrounds. It's a classic 2d fighting game like The King of Fighters and Street Fighter. It may have a stage composed by 5 layers. ...
0
votes
0answers
47 views

How to move vertices of matrix in order to cast a 2d shadow?

I am trying to add shadows to my 2D xna game. Currently I have created a "shadow" using the texture of the caster with a transparent gray color, rotated, and stretched using a matrix. This, though, ...
0
votes
0answers
41 views

How to translate vertex buffer coordinates in 2D

I am trying to (using a 2D Directx9 engine library) rotate/translate a set of points in a vertex buffer. I understand how this would be done in a 3D system - i.e using the vertex shader stage of ...
0
votes
0answers
49 views

Data structure to store map layers in each Tile while keeping the order of terrain, items and monsters intact

My game represents its map as a 2D array of tiles, each of which stores a stack of layers. I'm looking for a data structure to efficiently represent this . I want to be able to add layers ...
0
votes
0answers
86 views

2D animated sprite jumping and gravity physics

I'm currently writing a Megaman clone for my school project. So far all I did was making the character run and stay put when needed. Know I want to be able to make him jump using the 'X' button. I ...
0
votes
0answers
58 views

Very strange trigger behavior in Unity2D (4.5)

I am developing 2d platformer and I've faced with a very strange triggers behaviour in Unity. I have made the enemy that can throw objects into main player. So I have made two empty GameObjects with ...
0
votes
0answers
77 views

Unity - 2D - Scaling to fit between two objects

The game is a top down 2d shooter and I'm facing trouble in doing this : - I got a player 2D ship - The player fires laser, which is a long thin image with box collider attached. - What I want is that ...
0
votes
0answers
78 views

2D Vector Graphics in XNA

I'm here today to ask about Vector graphics in XNA, my first question being whether it is possible or not. The only other question on here that I have seen in relation to this is simply asking which ...
0
votes
0answers
25 views

Implementing Normal Maps with Unreal 4 Flipbooks

I'm new to Unreal 4 and just started using 2D. I have normal maps for my sprite that I'd like to put in so that the sprite responds to light as if all the details were modeled in 3D. How should I do ...
0
votes
0answers
25 views

Unable to slice an image

I'm new to game development. I am trying to get two sprites from a single image. After selecting the image I change sprite mode to "multiple" and go to sprite editor. There in preview I draw ...
0
votes
0answers
77 views

Super Smash Brothers 64 AI

I have been playing the original SSB for close to 15 years now, and I am still amazed by the effectiveness of the AI (though by now I have to fight at least 2 level 9's for a challenge). Some of the ...
0
votes
0answers
43 views

Text within a gameObject boundries

I am working in a little project and I want to show text within a rectangle. for that I use a sprite(rectangle) and a child that contains a TextMesh as component. The text change during runtime, and ...
0
votes
0answers
32 views

Can Layer Masks Achieve This Effect

If you look at the image below you will see the player surrounded by a dotted yellow box. The dotted yellow box is also part of the player and represented a portion of the player being masked from ...
0
votes
0answers
31 views

OpenGL ES 1.0 Create a Trapezoidal perspective scaling on a texture while using Ortho

I am using an Ortho projection to do most of my stuff and i am happy with it since i basically do everything on the same plane, now however i need to create a simple "flip card" effect on an object ...
0
votes
0answers
138 views

Picking tiles in an isometric diamond map

I am rendering a isometric map with the following code: for(var x = 0; x < MAP_WIDTH; x++) { this.map[x] = []; for (var y = 0; y < MAP_HEIGHT; y++) { var screenX = ...
0
votes
0answers
60 views

2D Orthographic camera movement clamp in any orthographic size

I have a problem, which i currently can't figure out how to solve. I am trying to calculate a clamp value for world coordinates which have to respect any camera orthographic size.I bought an image ...
0
votes
0answers
52 views

Web-Based Traffic Simulation based on Discrete Event SImulation + AI

I'm working on the application of 2D web-based traffic simulation. I am looking for a library that is suitable for my application. I'm making an application based on discrete event simulation, each ...
0
votes
0answers
40 views

Using a Quad to cut out a Layer?

Looking for options on this, but I wanted to take a Quad (or other shape), apply a material to it, and have it cutout an entire layer, to reveal the layers below/behind it. Sort of like a portal ...
0
votes
0answers
447 views

How can I animate 2d sprite rotation without interpolation?

I would like to animate a weapon being swung in 2 frames - all I'm doing is changing the position and rotation of the weapon sprite. However, I don't want unity to interpolate the rotation (generate ...
0
votes
0answers
89 views

MonoGame - Fuzzy Pixels When Drawing (2D)

I apologize if this has been answered somewhere; I spent quite awhile searching but couldn't find an answer. I have any issue with my 2D sprites being drawn to the screen - either the non-moving or ...