2D refers to two dimensional space where coordinates are represented with X and Y values.

learn more… | top users | synonyms

0
votes
2answers
96 views

How can I prevent 2D teleportation from teleporting through solid objects?

In my 2D game, the player is able to teleport to any place on the screen with the click of the mouse button. What I am trying to prevent is the ability to teleport across solid objects. If the point ...
0
votes
2answers
38 views

Unity UI issue trying to make a button work while held down

Pretty simple, have a rotate up button and I ant it to rotate while held down. using UnityEngine; using System.Collections; using UnityEngine.UI; using UnityEngine.EventSystems; public class ...
1
vote
1answer
54 views

Unity sidescroller with 3D objects/environment. Should I create a 2D or 3D project?

I'm looking to make a side-scroller in which the camera and all objects can only move in the x and y directions. However, I'm going to have all objects and environments as actual 3D models. Is it ...
0
votes
0answers
41 views

My Movement Function is working good but called only once

I have a function, It's working but not getting called every frame if It's in canMoveDown function but !canMoveDown its not. if (!canMoveDown && UpdateTilePhysics(currentBoardPiece)) like ...
-1
votes
2answers
52 views

How can I implement Player Prefs to Save High scores in unity?

I am new to both unity and C# and facing trouble in saving and displaying the highscore.text in the game.Til now I only successfully managed to display the scoreUI and update them whenever player ...
-1
votes
2answers
122 views

Inconsistent AABB collision detection

I'm making an endless jumper as my first game and I'm running into some problems with the one-way collision detection. Collisions are detected correctly most of the time but occasionally the player ...
0
votes
2answers
96 views

How can I move an object around a canvas in a random direction at random times?

I am currently trying to move an object (circle ball) around the canvas in a random direction. I have already written the code for the wall collisions so the ball bounces back into canvas when the ...
0
votes
0answers
51 views

Filling polygons with texture/color using SDL2

I recently went on to making a 3D software renderer using SDL2 and Rust as a learning project. It has been going quite well, it can draw lines, polygons, and cubes. Now, it can only display ...
0
votes
2answers
100 views

How to fix my tile-based game's tile movement code ? (like a CandyCrush Style)

I'm currently creating a tile-based game like a CandyCrush style direction movement (no problem on only down movement) trying to smooth, not laggy tile movement with a board piece, and I'm writing a ...
1
vote
1answer
44 views

Java - Adjusting the speed of an object during movement

I am trying to get an object to move (on java canvas) in the same angle but at different speed within the X and Y axis. Below you can see how i have implemented the movement of the object. xPosition ...
2
votes
2answers
58 views

Rigidbody2D Circular Orbiting

I am trying to create a basic solar system in 2D. All space objects has CircleCollider2D on them (which are required for raycasting in another script). Currently planets are childs of stars, and ...
4
votes
1answer
128 views

How to resolve push block physics in a 2D side scroller puzzle

I've been working on a 2D tile-based side scroller puzzle game in Unity with obstacles such as doors, keys, fans, portals, etc., but one type of obstacle, push blocks, is giving me some issues. Here ...
0
votes
0answers
39 views

Adding a 2d collider causes incremented movement of a child, how to fix it?

I have 2d game, with a parent object with two sprite children, a man moving up and down with a flamethrower. Currently having only the movement script and rigidbody, I can move the parent easily with ...
0
votes
0answers
47 views

Responsive animation based on mouse position

I'm currently developing a topdown 2d rogue-lite game in Unity, where the combat will be mainly focused on archery and different adaptions based on archery. My problem is that I have a hard time ...
4
votes
0answers
71 views

Screen tearing in fragment shader on R9 380 GPUs

two players are encountering an issue with my game where the screen is tearing when it uses a fragment shader but it only seems to be doing this for players with a R9 380 GPU. Here is what it looks ...
0
votes
1answer
64 views

What is differential scrolling?

I have seen the term a few times (e.g. here). I tried looking it up but did not find much information. I thought it would be something like parallax-scrolling, but I have seen suggestions otherwise ...
0
votes
2answers
62 views

Picking a 2D Box Collider with the mouse in Unity

I have a scene with a bunch of 2D doors that have 2d Box Colliders (no trigger) on them and that live on a Canvas. I would like to be able to click on them with the mouse, but have had no luck. ...
35
votes
2answers
4k views

How can I procedurally render irregularly shaped health bars?

The issue of the traditional rectangular or heart-based health bar is something well-understood and easily solved. But what is the accepted solution for more "creatively-shaped" health bars, like the ...
0
votes
1answer
56 views

How to calculate acceleration and deceleration

I have a car with speed x, and can accelerate at a rate of 0.5 m/s^2, and can decelerate at a rate of -0.1 m/s^2. Maximum speed is 20 m/s. To accelerate the car speed, at each frame I need to do: ...
-1
votes
2answers
153 views

How can I render 2D ropes in Unity?

I'd like to be able to render flexible lines, or ropes, as below: I thought about using a Line Renderer but it doesn't have the flexibility to render arbitrary curves.
0
votes
1answer
79 views

Enemy shake/vibrate when following character

I am using the arongranberg A* path finding project to create way points for one enemy to follow the player. However, the enemy vibrates back and forward by about 0.1 - 0.2 unit distance when moving. ...
0
votes
0answers
20 views

Simplifying grid based intersection checking to not need 16 checks from each corner

I'm working on an "underground prisons and fire breathing lizards" inspired CRPG. So far I have implemented a "path drawing" method to, well, show the grid cells that would be involved if one were to ...
0
votes
0answers
52 views

MonoGame RenderTarget2D mipmapping fades textures when zooming out

I recently ported my XNA game to MonoGame. Unfortunately, some of the textures are being faded when: They are scaled-down from 32*32 to 16*16 When the camera zooms out, the texture fades from ...
0
votes
0answers
91 views

Unity2D Script to Throw Object to hit the TARGET everytime?

Hi I got a script that fires object at a target. In this instance, I have an enemy that fires an object towards the player! But I am stuck how can I get the required force to always hit the target no ...
5
votes
1answer
197 views

What is best method for 2D pathfinding in procedural world?

I have been researching path-finding for 2D games and would like to create a system that allows A* to perform as best as possible over a near infinite world. This system is intended to manage not only ...
2
votes
1answer
124 views

What is the advantage of pixel coordinates for a 2d game?

From the Godot feature list: Work in pixels as your units, but scale to any screen size and ratio. And reading the documentation they also use pixel coordinates to update the position of objects ...
1
vote
1answer
75 views

How to get a pixel color from a specific sprite on touch (unity)?

I have a 2 layers of a different sprites. How can i get a pixel color from lower sprite? I know how to get touch and world coordinates, but i have no idea what to do next. Touch touch0 = ...
3
votes
1answer
62 views

Dynamically generating triangles from points

I'm working on 2D lighting. I have a list of points that have been calculated and when I draw lines from the light origin to the point it works. The problem is connecting the points into triangles. ...
0
votes
1answer
42 views

Hybrid App - Game Encyclopedia Image Asset

An in-game encyclopedia usually consists of entries and images for things related to the game. For example, pokemon's pokedex. Image of Pokemon, text description and so on. I've happen to encounter a ...
2
votes
2answers
82 views

How to display multiple textures with OpenGL without a texture atlas

I tried to dig into OpenGL a bit to use in 2D games (mainly because of shaders). There are multiple tutorials out there showcasing how to display and blend textures, and that's fine. But i haven't ...
1
vote
2answers
73 views

Achieve a red lighning effect in unity for a 2d game

Effect that im refering to: http://youtu.be/jaBY83WvS3M#t=05m36s How could I achieve this kind of red lightning/flashing/shadowy effect in Unity3D for a 2D game? I'm trying to think of a way but I'm ...
0
votes
1answer
43 views

Tile collision detection

Right. So I was making this simple game. The player is two tiles wide, and four tiles high. My current code is really buggy (it was better before my rewrite) Here it is: float newx = position.x ...
0
votes
2answers
42 views

Libgdx box2d bodies go through other bodies

I'm developing a game using libGDX and box2d. I am facing a problem that bodies go through each other... I'm moving the body using a TouchPad by setTransform. I think the problem is that I use ...
0
votes
0answers
53 views

Grapling hook in 2D platform game (C programing)

I'm new in the programming world and I'm studying programming for video games, and I'm trying to create a game for a class project. I need my character to throw a grappling hook into a specific ...
0
votes
1answer
59 views

How can I instantiate in the current rotation in Unity 2d?

Backstory I'm currently working on a 2D sidescroller/platform game as a hobby, and I just started recently. Followed a few tutorials and such I managed to wrote my own code for basic command like ...
1
vote
1answer
77 views

2D sunrise in Unity

I see a lot of guides on how to create sunrise in 3D space, but I can't find much information on how to do it in 2D. In 3D, you rotate a lightsource around itself, but in 2D, I need to move the object ...
3
votes
1answer
111 views

2D grid based placement (limited to 1 tile in each direction) in Unity

I've been trying to get my head around this for hours now, I hope one of you is able to help. I'm trying to make a small game (2D using sprites) that allows you to place blocks (tiles). That is ...
5
votes
2answers
101 views

Unity 2D graphical glitch cuts sprite diagonally

While making a game in unity, we found a graphical glitch that only happens on one of our mobile devices (a htc) where the screen will be oddly sliced by a triangle as shown in this image; I've ...
3
votes
1answer
53 views

Most Efficient Way To Get Objects In A Rectagular Area - Unity2D

First of all, if you know a better way to do what i want to achieve please don't hesitate to suggest your own method. What i want to do is classic area selection in RTS games, which player drags his ...
0
votes
0answers
23 views

Libgdx moving a body sequence

How can I move a body (box2d) to different points in an order. Like first it moves to 100,200 then to 200, 450 and so on? I've tried actions(and actor) but I can't get the point where the body is ...
3
votes
1answer
62 views

Super formula on shader

I'm using Shader-toy to experiment and try to learn a bit the shader science. As exercise I wan to replicate some of the wikipedia math plots. I've started with a Super Formula. What I want to ...
1
vote
1answer
123 views

In Unity, how can I modify the shape of a sprite?

I am new to Unity and programming in general, however, I wanted to know how to change a sprite's shape. I want to do this while the game is running, so I was thinking about removing a set of pixels ...
0
votes
0answers
30 views

Do I restart the service?

I have a long running service in my game, that consists of two threads. //MY SERVICE: if(userEnabledProcessOne) //Shared preference value that I'm getting from the settings of my app based on a ...
1
vote
0answers
101 views

Why do characters only move in 4/8 directions in top games? [closed]

In many top down games, like Zelda (4 directions) There are only 4 or 8 possible directions. Why is this? Is it a design choice or a technology limitation? I can't think of any reason that even ...
0
votes
0answers
72 views

Modern OpenGL and SpriteBatching

I tried to find tutorials regarding SpriteBatch done in Modern OpenGL 3.0+, but failed to find any good resources so far. So can anybody please provide me a good resource/tutorial to achieve ...
1
vote
2answers
111 views

Technical names for camera styles in 2D games

In 2D gaming, the camera movement method has a lot do with the play style of the game. I'm not super familiar with the technical terms for camera styles, so I'm going to describe them in hopes ...
1
vote
1answer
68 views

How do I deal with AABB sweep ghost collisions?

I've been trying to wrap my head around this for some time now. I wrote an implementation of AABB sweep collision detection. I though I understood the idea but it didn't work as expected. I rewrote ...
0
votes
0answers
38 views

Sub pixel Sprite jitter on moving platform

I have written a simple 2D platform game in C++. Coordinates are stored as integers, not floats. To facilitate smooth acceleration, the positions and velocities of the game objects are stored in sub ...
0
votes
0answers
50 views

Problem with collision detection also affecting collision resolution

Hi I am making a 2d scrolling beat em up, I am working on the collision with obstacles like drums and platforms. So far I have the player jumping and falling from platforms but having problem ...
3
votes
0answers
131 views

How can I interpolate between two frames of a sprite-based 2D animation?

For example, I'm looking to animate at 60 frames per second, but clearly my artist isn't going to hand-author 60 frames of art for every second of an animation clip and even if he could, it would only ...