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
28 views

Making a player jump [on hold]

I am developing a game in eclipse for android and I wont to make the player jump like in flappy bird.I developed some code to make the player jump when the screen is touched but when I run the app and ...
0
votes
0answers
49 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. ...
-2
votes
0answers
18 views

Text Rendering free type2 with directx 11 [on hold]

Hi Im building a 2D game engine but im having problem understanding free type 2 and how it works with directx 11.
3
votes
2answers
127 views

How do I make a 2D race car turn smoothly?

I'm making a competitive 2-player 2D racing game for a school project. I'm struggling with the movements of my car: I made it a square for testing purposes and it can move left, right, up or down, but ...
0
votes
0answers
31 views

Choppy Character Movement Unity 2D [on hold]

I am new to game development and have been following a tutorial to get started, it is a flappy bird style game. My main issue at the moment is when tapping the screen to move my character it is ...
6
votes
1answer
719 views

Using L-Systems to procedurally generate cities

I'm currently making an app that focuses a lot on procedurally generated content. So far, I've successfully implemented the procedural generation of the terrain and shape of a map using simplex noise. ...
0
votes
1answer
66 views

Location of “units” in Code

So, I've been playing around with the concept of a game, mechanically think of the Civilization games(Tile, turn-based strategy) but I am quite uncertain about where I should store the units location ...
0
votes
0answers
37 views

What is the easiest way to develop a fixed perspective 2D game with an isometric tiled map using Javascipt? [closed]

The main stumbling block I've come across with the couple of libraries I've seen is that it's extremely difficult to add ramps or the idea of height. The basic idea I'm going for is Diablo 2. I've ...
0
votes
0answers
42 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
28 views

2D Bullets / particles in parallax [closed]

Parallax in 2d games is a method to create an illusion of depth. Sprites representing entities that are further away appear smaller and move more slowly. Sprites that are closer, appear bigger and ...
2
votes
1answer
75 views

Infinite loop of prerendered 3d graphic

I have a game where I want a never ending pathway for the character to walk along. So in my 3d modeling tool I created a path like this: now I want to loop that model over and over in my ...
2
votes
1answer
59 views

How can I access a script variable from another script in Unity?

I'm creating a space shooter (think Space Invaders or Galaga) where the GameManager persists between scenes but the player and enemies don't. I need to access a boolean value from the player and ...
1
vote
1answer
74 views

Rotate an arrow on a plane?

I'm creating a display for a GPS-based embedded system and would like to have an arrow indicating the current bearing. I'd love the arrow to have a 3d appearance by rotating it on a plane tilted up ...
5
votes
3answers
366 views
+200

Should I have multiple small textures or a single big one?

I'm using SDL 2 to create a small 2D game. Based on the docs, this is what I would do: SDL_Surface *surface = SDL_LoadBMP("image.bmp"); SDL_Texture *texture = SDL_CreateTextureFromSurface(renderer, ...
1
vote
0answers
65 views

Best view for 2D Android game in Xamarin [closed]

I am trying to create a 2D multiplayer turn-based cooperative game for Android in Xamarin with possible future implementations for Windows Phone and iOS. The main inspiration for my game is Pandemic. ...
0
votes
1answer
47 views

Xna 2d tile culling

I'm trying to make a simple 2d tile engine here, and I've got a problem with getting a proper cells from a tile grid map when I'm trying to cull off tiles which aren't needed to be drawn. I've got a ...
3
votes
0answers
115 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 ...
0
votes
0answers
29 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
34 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 ...
3
votes
2answers
177 views

How to calculate left/right oriented angle between two 2D vectors? [duplicate]

I would like to calculate angle between two 2D vectors. Here's a picture of what I'm trying to achieve: I have an obstacle line segment AB and incoming moving PC. If I'm coming from one side C¹D¹ ...
0
votes
1answer
97 views

How do I get the mouse coordinates relative to my whole scene with Monogame? [duplicate]

I am making a topdown isometric real time game using Monogame. I know how to get the mouse position for my camera view. How do I get the mouse coordinates relative to the entire scene? My game's ...
1
vote
0answers
39 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
1answer
337 views

Beginner: How do I calculate a vector?

I am trying to wrap my head around some concepts in a side project I'm working on. I'm struggling with how I can calculate a vector based on my character movement logic. Here are the relevant details ...
3
votes
5answers
220 views

Is it bad practise to have an object for every tile?

In the game I am working on, many of my tiles must have special attributes (such as triggers when the player steps on them). I was wondering if it would be bad practise to create an object for every ...
1
vote
1answer
62 views

Design question: best way to model and visualize a long grid of data [closed]

Perhaps some noob questions for a scientific application that you can assist with: I am trying to render a large, evenly spaced grid of data in 2D. The full data set dimensions could be anywhere from ...
0
votes
2answers
234 views

Why does my A* implementation overflow the stack?

I'm fairly new to game dev and working on my first ever attempt at 2D pathfinding. I'm using the A* algorithm as detailed here. For the most part, it seems to be working correctly and as intended. ...
1
vote
1answer
55 views

How to draw a diagonal fade-in and fade-out?

How to draw a diagonal fade-in/fade-out in 2D using MonoGame draw API? For a simple (non-directional) fade-in/out drawing the background with alpha variation do the tricks, but what is the standard ...
0
votes
0answers
55 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 ...
1
vote
1answer
107 views

Is it Possible to create one equipment piece, and handle the manipulation programatically

I have a 2D game made in XNA-4.0. I am brainstorming on how to implement a system of equipment where I can draw one Texture, and rotate/scale it to my character's current animation without haveing to ...
1
vote
1answer
35 views

How to deform 2D tileable texture in XNA/MonoGame

I'm looking for a way to deform tillable texture in a 2D game I'm building using MonoGame but I'm not sure how this effect is called and searching the internet for "deforming textures" gives me mostly ...
1
vote
3answers
55 views

Handle many objects to draw in XNA

in my 2D engine - using XNA 4.0 - I´ve an issue with handling many objects. The way my engine works is that I only draw visible sprites (base objects) and ignore those sprites out of the current ...
0
votes
1answer
50 views

Trigger an event when a game object touches a non-solid game object

For a 2d game, I are currently making an AI and I want it to jump when it touches a invisible cube, which isn't solid, how do I do this?
3
votes
2answers
174 views

How to design a drag and drop inventory system with transition from icons to game objects?

I’m trying to write a simple 2D game in Unity with an inventory where the user can drag and drop different objects on the screen. I need the inventory to contain icons which on drag will become ...
1
vote
1answer
65 views

Animation-based Collision Boxes

Background I'm currently working on a top-down 2D game, roughly similar to something like Zelda for the SNES. Certain game entities such as the player or a typical enemy will consist of multiple ...
0
votes
1answer
74 views

Unity 2D detect if swipe goes through an object

I am developing a game in unity with flying arrows that the user tries to deflect by swiping through them (changing their direction). I can get the arrows to move with the swipes, but they move no ...
0
votes
1answer
32 views

Slick2d - state change problem

In my slick-based game, I have 4 states - introState, gameState, pauseState and menuState. From the gameState, I want player to go to either menuState or pauseState. To do that, I did this in ...
-2
votes
1answer
85 views

GLSL- How to change a certain color of a sprite, to another color passed into the shader?

I have been googling for over an hour, trying to find out how to do something very simple, which I see in tons of games. I tried to understand GLSL, but it seems like a ton of learning for a single, ...
0
votes
1answer
43 views

View Rigidbody 2D Wire Frame

Simple question. When I prototype game ideas I like to create objects without having to attach sprites. Is it possible to create a Rigidbody 2D in unity, set its size and render its wire frame? I am ...
-1
votes
0answers
35 views

How is PokeMMO made (2D) or how they did it? [duplicate]

PokeMMO is a 2D Java Game, i wonder how they made it does some know how they did it?
3
votes
4answers
592 views

Algorithm to verify if a shape is inside another

I have a rectangular canvas and I need to verify whether a shape is totally inside that canvas or not. The shape can be lines, ellipses, arcs, rectangles and arbitrary polygons. Does anyone know a ...
0
votes
2answers
46 views

How to move an object uniformly from one point to another at a fixed angle? [duplicate]

In my 2d java game, I need to move Point objects (as projectiles) from Enemy object to Player object in a straight line. I did some research and found out that I can use atan2(x, y) method of Math ...
1
vote
2answers
79 views

Weird GLM perspective problems with my 2D Game

I am trying to create the graphics system of a 2D game using OpenGL 3.3. To help me in this task I am using the GLM math libraries. However I am having some trouble. When my objects (for now they ...
2
votes
2answers
201 views

Problem loading level layout from file in Breakout clone

I'm working on a Breakout clone and I decide to use files as method to load level layouts. The file is something like this: N,N,N,N,N N,N,N N,N,N Only indicates what type of brick I'll ...
0
votes
0answers
48 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 ...
1
vote
0answers
26 views

Direct X 11 2D Books/Resources [closed]

I would like to learn Direct X 11 (coming from XNA) but I cannot find any good resources. All the resources I found either focus exclusively on 3D, or use so many third-party solutions it does not ...
1
vote
0answers
58 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 ...
4
votes
2answers
267 views

How to properly do top-down aRPG melee attacks?

I'm reposting this from my own thread in reddit's gamedev community, since there were too few responses: I've been looking for some info on that, but I mostly find articles on the design of such ...
2
votes
4answers
279 views

Is moving entities between sectors of a grid spatial partitioning inefficient?

I'm using a grid system for spacial partitioning. If I have moving entities, will I have to reassign every entity to its correct section every frame? Surely this is inefficient. Have I got the wrong ...
3
votes
2answers
346 views

What is the pixels to units property in Unity sprites used for?

I'm starting to learn Unity for 2D development. So, I am importing several sprites into the game, and I couldn't help but notice that there is a "pixels to units" property, by default on 100. I ...
1
vote
1answer
77 views

Correct multiplication order for a 2D Matrix

I'm currently trying to create a camera and entity/model matrix for my 2D game similar to that of Unity3D. I've already tried to find answers to this question on stackoverflow/gamedev but i couldn't ...