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
17 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
38 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
50 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
18 views

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

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
50 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
51 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
34 views

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

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
67 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
81 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
47 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
47 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 ...
3
votes
1answer
102 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 [on hold]

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
41 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
53 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
61 views

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

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
52 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
60 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
0answers
35 views

How Do I Implement Modern Smooth Animation Methods and Shapes? [closed]

I have noticed new methods of animation and drawing arising, while I can explain some or come up with algorithms for others. For example, I was watching a video by pewdiepie and I noticed the ...
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
33 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
95 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
54 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
64 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
106 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
104 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
148 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
64 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
175 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
53 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
47 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
73 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
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
322 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 ...
0
votes
1answer
89 views

How can I create the illusion of a 3D object moving around in a static background?

I'm designing a Resident Evil clone using OpenGL. I'm curious how the older Resident Evil games used a static pre-rendered background with 3D models roaming around: Here, if the main player ...
0
votes
0answers
62 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
1answer
81 views

Camera Touch Zoom and Pan with world - 2D

I am doing my first unity2d game and im in need of a little optimization for my camera. I have a camera which could pan and zoom with the speed i have defined. The problem with that is the speed i ...
0
votes
0answers
48 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
1answer
217 views

2D sprite 360 degrees rotation according to the mouse

I am trying to make my top down character rotate according to degrees between its position and the mouse. I'm using this code: float xDiff = mouseState.X - (graphics.PreferredBackBufferWidth / 2); ...
0
votes
3answers
97 views

How to calculate corner marks of a rotated rectangle?

I've got two elements, a 2D point and a rectangular area. The point represents the middle of that area. I also know the width and height of that area. And the area is tilted by 40° relative to the ...