Tagged Questions

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
51 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 ...
1
vote
1answer
38 views

Custom 3D Noise function incorrectly generating in Lua

I have been working on a custom noise generator (not Perlin on Simplex or whatever), which works fine in two dimensional space, but upon converting it into three dimensional space, it turns into a ...
0
votes
1answer
60 views

Unity 2D Game Development [on hold]

How do I make a sprite swing an object, like a sword, without having to animate the sequence. I'm thinking I need to rotate an object around a point over time.
0
votes
1answer
18 views

Android Canvas 2D Game: Supporting multiple screen sizes/resolutions [duplicate]

I'm planning to develop a 2D game for android devices by using simple Canvas Surfaces (I know that OpenGL might be more efficient - but Canvas should definitely be enough for my type of game). I'm ...
0
votes
0answers
38 views

Pulling part a 3D game to make a rough map [on hold]

I've been 'employed' as a tester for a game I play (paid with in game premium currency). I've been rather good at finding glitches etc. and hence I've been asked to try and break the system. One of ...
1
vote
2answers
67 views

Required number of images for octagonal tiles

I'm planing to write a game based on octagon tiles. Currently I'm wondering how many images I really need. That is something about graph theory, I know that, but not only. I want to connect each side ...
0
votes
0answers
40 views

Making a player jump [closed]

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
54 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
20 views

Text Rendering free type2 with directx 11 [closed]

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

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

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

Choppy Character Movement Unity 2D [closed]

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 ...
7
votes
1answer
771 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
75 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
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, ...
2
votes
1answer
77 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
66 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
78 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 ...
9
votes
4answers
537 views

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

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
68 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
49 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
130 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
32 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
38 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
185 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
102 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
338 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
234 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
66 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
242 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
56 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
58 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
108 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
37 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
51 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
184 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
69 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
84 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
38 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
93 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
50 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
600 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
47 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
83 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
49 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
28 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
63 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 ...