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

Multiplayer movimentation and animations [on hold]

I'm planning my first multiplayer game that will be similar to this: http://www.youtube.com/watch?feature=player_embedded&v=N9ii54dYO6w I will make the client in C++/DarkGDK and the server in ...
0
votes
0answers
54 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
44 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 ...
0
votes
0answers
42 views

What is the best framework for 2d side scrolling game (with physics support like box2d) [closed]

I have previous knowledge in Libgdx since I developed a game in it. So the learning curve will be a bit less. Still, if there is a better platform for side scroller (preferably Java), then I would ...
0
votes
0answers
35 views

Advice for learning a cross-platform 2D game engine [closed]

First, I understand that this question might seem similar to many others from before, or not-constructive, but I have a very specific set of requirements for the answer. Since this is an important ...
5
votes
0answers
137 views
+50

How do I perform an hqx filter in XNA 4.0?

I'd like to render my game scaled up with one of the hqx filters (hq2x, hq3x or hq4x) in a shader. My output with SamplerState.PointClamp: My output with SamplerState.LinearClamp: What I want ...
0
votes
0answers
23 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
47 views

Which Algorithm can be used to implement AI in a 2D soccer/football game? [closed]

Could you suggest me an Artificial Intelligence Algorithm that I can implement in a 2D (Top View) football/soccer Video Game please. Video of Game Play & Game Mechanics of the 2D game : ...
0
votes
1answer
77 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
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
1answer
39 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
44 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
177 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
69 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 ...
1
vote
2answers
87 views

Getting around limitations posed by float in space game

I'm working on a procedurally generated game set in outer space. As in the real world, the game universe will be pretty much 99% empty, with planets/stars/solar systems etc... being very far apart. ...
4
votes
3answers
245 views

How to generate a “loop room” in a platformer game (by Unity)?

I want to build a level with a room whose left edge is linked to right edge in a 2D platformer game in Unity. My goal is let all objects disappear in one side will appear in other side of the room. ...
0
votes
0answers
74 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
47 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
47 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 ...
1
vote
2answers
73 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
70 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. ...
3
votes
2answers
165 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 ...
7
votes
1answer
823 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
81 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
46 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
82 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
92 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
81 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
568 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
86 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
58 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
166 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
39 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 ...
3
votes
2answers
218 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
118 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
48 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
347 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
264 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
70 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
249 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
82 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
76 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
115 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
48 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
76 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
54 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
235 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 ...