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
0answers
6 views

Handle Entities & Collision in large numbers

I am creating a simple 2D maze game and I am a little confused about entities & collision detection. At the moment, my entity class is an abstract class containing position, velocity, sprite and ...
0
votes
0answers
4 views

How can I optimize my XONIX game flood-fill algorithm? [on hold]

I am implementing a XONIX game, using FLOOD FILL algorithm, but I want to optimize it to improve performance. How can I do that? (I am willing to use a completely different algorithm, if possible) ...
0
votes
0answers
16 views

Pygame: Right Datastructure for 2D Games

Development-Community, i started to program with pygame and stuck at the question what's a right datastructure for 2D games like Diablo/Warcraft (of course with inferior graphics). My main Problem is ...
0
votes
0answers
21 views

Scaling character sprite based on angle of camera in 2d scene

I have a complex 2d scene that has been drawn roughly as if the camera is tilted at 60 degrees. I want to scale my character sprite in the scene as the character goes into the distance (i.e up the y ...
2
votes
3answers
73 views

Hero made of parts 2d rotation

I have a problem with rotation of my hero in 2D space. The hero is made of body parts such as: head, arms etc. Every part is a separate sprite. When I want to rotate the hero, I have to rotate all ...
0
votes
1answer
26 views

Rotating and scaling textures built up of pixel arrays in java?

I'm making my first real game, in Java, and I'm currently working on the base system, for rendering images (sprites) and I wonder how I can rotate sprites. My sprite class looks like this: ...
0
votes
1answer
29 views

Unity 2d Side Scrolling Mobile Prefab Problem

hi im trying to use the 2d side scrolling prefab that comes with the standard mobile assets. When i drag it onto my heiarchy its default position is set and i can see the touchpads. But when i play ...
4
votes
2answers
375 views

2D games and modern OpenGL

Preconcepts Ok, so what I've gathered so far is this: don't use fixed pipeline (deprecated or going to be deprecated) vbos store "object models" (n vertex data, mostly) vaos describe how data is ...
1
vote
1answer
70 views

Unity Grid Movement (Turn Based, 2D)

I trying to create a Turn Based Strategy behaviour where you move a gameObject from 1 tile of a grid to another tile near it I have created the Grid using sprites and gameObjects but can't sort out ...
0
votes
0answers
41 views

What is the technique for complete the background of ground (2D) [on hold]

What is the technique on programming for complete the ground with a background repeated. See that image for understand: (Image from Chariot, game for xbox one) In that image, you can see an example ...
2
votes
1answer
56 views

2D collision of thrown objects in Unity

I am currently working on a game inspired by traditional 2D Zelda games ("Link To The Past", etc.) in Unity using the 2D settings. I am looking for the best way to handle objects that the character ...
0
votes
0answers
24 views

rotate to movement direction [duplicate]

If I have a player character that can move 8-directionally, I can set the rotation of the player to face the direction of movement. But if I want to smoothly rotate to a direction, sometimes the ...
-1
votes
0answers
22 views

LibGDX/Java - IllegalArgumentException causes my game to crash whenever my main character touches a Coin [closed]

Trying to figure out why my Android game crashes whenever the player touches an animated coin. I have attached an image of the LogCat and my code is below (NOTE: all game objects in ![Renderer] are in ...
0
votes
2answers
51 views

How to draw a textured 2D square using OpenGL

I am attempting to get started using OpenGL, and have learned how to open a window and draw basic shapes. However, I do not know how to texture them and have been unable to find any tutorials on how ...
0
votes
2answers
57 views

XNA - Card Game - 3D vs 2D vs Primitives [on hold]

I'm starting a new project in XNA which will be a card game. What is the best way to implement my cards? Since I want to rotate these, they'd have to be somehow displayed 3D. The game itself will be ...
-1
votes
0answers
37 views

LibGDX - Is it worth making a World class for my game? [closed]

Right now I pretty much have a World class across 3 classes (Player, Game, Renderer) if that makes sense? Game is where game objects are initialised, and Renderer just draws the objects onto the ...
3
votes
1answer
68 views

Sending Client Input to Server (which way?)

I am trying to get networking working for my game, I've read several sources of information about this subject but one thing is still unclear for me. The way I process client input is by executing a ...
0
votes
1answer
86 views

How to show my XNA game in form C#

I have a game in XNA, I want to connect this game with WindowForm to show for example the distance and the position. I tried to apply many tutorials that talking about this. but here is my problem : ...
1
vote
2answers
49 views

Collision between Mesh Plane and 2D Sprite

I've just recently started programming using Unity and made a couple of games with it, I'm trying out more and more advanced stuff as I do more games, but right now... I'm trying to make a game ...
1
vote
1answer
50 views

Simplified aerodynamics for 2d (top-down) airplane

I am writing a top-down 2d game, in which the player can control an airplane via the WASD keys. The W key should move the plane upwards (north), the A key to the west, and so on. Now I need a ...
4
votes
2answers
140 views

Isometric graphics with fake perspective

Diablo 2 is a game with isometric graphics. However, unlike other isometric games, D2 has the option to activate perspective. Obviously, the D2 developers found a clever trick to convincingly fake ...
0
votes
1answer
23 views

Javascript 'camera' following object vertically without use of engine like Phaser or canvas [closed]

So I have to make a JS game for school (I'm an absolute novice when it comes to JS) in Adobe Edge without the use of a game engine. I've been attempting to make something like this game and so far ...
0
votes
1answer
43 views

Dealing with multiple 2d sprite animations for the same object

I am using libGDX for a 2d game. Some of my in-game objects have animations, for example a soldier in top-down view that has a walking animation. That is working fine. Now, while walking, this ...
-1
votes
1answer
55 views

Yeild waitForSeconds(5.0) is not working

I am trying to call another function continuously from my Update() function. So, I have used yield WaitForSeconds(5.0); but, the it stops for the first 5 seconds and it does not stop the next time it ...
-1
votes
0answers
63 views

Why does this code update my object's position so fast? [closed]

I was working on make my object appearing in the screen in random position. So I used Vector3.Lerp as it was mentioned in this question. I modified the code a bit as I was getting too much error and ...
0
votes
1answer
54 views

Why does this code not update my object's position?

I am trying to move the object in my frame in Time.deltaTime. I have not taken care the speed yet but the problem is, the object is almost at position (0,0) after I have multiplied the x & y axis ...
0
votes
2answers
62 views

What is the best practice for handling touch events on different GameObjects in Unity2D?

First of all I want to describe what I have in my scene. 1. Joystick. 2. Main character that has link to joystick and handles touch events from joystick. 2. Buttons. 3. Other GameObjects that must ...
0
votes
2answers
82 views

32 bit or 16 bit textures

I'm trying to build some 2d character with Photoshop and Spine. By now, I have created some of my characters using 16 bit color depth images in Photoshop. Now, I wonder whether I have to use 32 bit or ...
1
vote
0answers
34 views

Setting the main camera's size to be equivalent to the device's width and height

Making a 2D game with Unity. I need a way to set the main camera's width and height to be equal to the mobile device's resolution. So if you're using an iPad Mini 3, then the main camera will be 2048 ...
0
votes
2answers
97 views

How to reverse gravity in Unity

I'm trying to figure out how script gravity reversal on collision with an object. How can I reverse gravity?
1
vote
1answer
45 views

How do you save Path2D data?

I am making a java game using path geometry. Is there any way to save the data stored in a Path2D to a file?
0
votes
1answer
63 views

Best way to go about collision between rectangle and bool array containing pixel data?

Basically, if I have an array along the lines of bool[] collision; Filled with a value for each pixel in the sprite I am checking collision against (pixel 1 = true, pixel 2 = false etc), how do ...
1
vote
1answer
186 views

How to keep player in the center of the screen but let him move to the edge of the map without moving camera there? [duplicate]

In my rpg-styled (top-down perspective) 2d game, I want my player to be at the center of the screen, while the entire world moves, giving the effect of player movement. I can make that, but my problem ...
0
votes
1answer
24 views

Destroy a single list member

im trying to destroy a single game object using the following script but it destroys all of them , not the ones I want. I want to destroy the ones that the transform that holds this script collides ...
0
votes
1answer
38 views

How do I split a button graphic into a 9 patch?

I understand what a nine patch is but I don't understand how to create one with code. I've made an image with a 1-pixel black border, but how do I turn that into a nine patch? How do I make a nine ...
0
votes
1answer
64 views

Java 2d Gaming, best practice to update random falling objects

I'm new to game development. I do have basic knowledge in Java and also have moderately good experience in OOP from other languages. I started developing this simple 2D game as my first project. The ...
1
vote
1answer
34 views

Positioning of AABB / Rectangles

I am wondering what is the best way to position rectangles, the ways I have thought of are: Have an x and y at upper left, then have a width and height Have an x and y at upper left, and an x and y ...
0
votes
1answer
55 views

Bounding Box not rotating based on draw rotation (Java)

In the process of developing a 2D game and am having some issues with translating coordinates on rotation. The object being rotated is a sword that is attached to the player. The player currently ...
1
vote
1answer
65 views

Getting normal map of an image

I'm trying to achieve the results in this tutorial: Link So far, I was be able to do that; with these; public PixelMap GetNormalMap(double strength) { var newMap = new ...
3
votes
2answers
107 views

Bevel outline algorithm in 2D

I'm writing a program that creates animated blobs in 2D, to simulate cells. In order to beautify these objects, I'd like to give them a 3D look by adding a bevel-effect. How can this be achieved? ...
1
vote
2answers
105 views

How can I handle position in an entity system where position can be 2D or 3D?

I'm working on a game engine to learn how it's done (so I might better take advantage of the techniques involved and other, similar engines in the future), and I've run into a problem when handling ...
0
votes
1answer
38 views

Why is 2D light ray collision result getting inverted at specyfic angle

recently i've been working on 2D lighting for my game. I've created new little project, and I've encoutered a problem. The collision between light ray and the object is fine at angles 316-360 and ...
0
votes
2answers
149 views

Can the GUI be used to create game objects?

I want to be able to position 10 various game objects (sprites) within the area of the screen which will be dynamically sized accordingly to the screen size of the device. The area in which I want to ...
3
votes
1answer
67 views

Parallax effect for layers in Unity2D

I have a simple game scene where i have put a number of images. I combined these images into layers (SortinLayer, to be specific). So now I have 3 layers. I have read a few tutorials, but in them was ...
3
votes
1answer
177 views

Jelly ground collision

For fun I am trying to replicate the mechanics from The Floor is Jelly. So far I have successfully created "jelly islands/blocks" which are represented by an array of points and then drawn by using ...
0
votes
0answers
55 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
51 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
1answer
55 views

2D Hitboxing on an HTML image [duplicate]

I want to make a turn-based game where the player is given "opportunities for attack." An image of the in-game sprite character appears when it's the player's turn to attack. The player can mouseover ...
8
votes
2answers
323 views

How do I perform an xBR or hqx filter in XNA?

I'd like to render my game scaled up with one of the hqx filters (hq2x, hq3x or hq4x) or an xBR filter in a shader. How can I do this in XNA 4.0 and SM3? Side note: this question has been heavily ...
0
votes
0answers
30 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 ...