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

learn more… | top users | synonyms

-1
votes
0answers
15 views

Make a 2D shape “orbit” a circle which has already been drawn in JAVA

I Have a circle, I want to make a shape (for now just a rect();) orbit around that circle. The x position of the circles center is represented by XPos and the y by YPos, the radius is represented by ...
1
vote
1answer
36 views

Java Graphics flickering

I'm currently working on a 2D Java Game using Java Graphics. I know this question has been asked several times but i've tried nearly all solutions I've found. The Problem: The Window is randomly ...
0
votes
2answers
652 views

Basic 2d platform collision detection algorithm has a slight bug (Java)

I'm trying to implement collision detection between Player (the main character) and a Platform. They are both modelled as rectangles; when player hits the side of a platform he should bounce off it ...
3
votes
3answers
202 views

2D Collision at corners using C# - without xna or unity

I'm trying to make collision for a 2D game, the player (car) has to collide with the walls of the track when it hits them. I looked into pixel color detection, and X,Y -based collision (But since its ...
1
vote
1answer
31 views

How to set the position of objects in pixels on the scene editor

I created a camera of the size of 480x854 as the project is meant for Android but whenever I try to position objects on the scene editor, their positions dont seem to be in pixels. It is like -10 y on ...
1
vote
0answers
27 views

How to make a Sprite have multiple armors/weapons/Accesories [duplicate]

I am currently developing a game that involves a multitude of weapons, armors, etc. I am using UE4 currently as an engine because I found that easy to use. Currently in development I have found myself ...
1
vote
1answer
46 views

Finding a point between 2 moving points colinearly , given 2 moving points and distance

P/S: The engine I work on doesn't have grouping integration. That's why I need a formula to change the position. A------B---------------C A and C are moving points that can move anywhere A = (xa, ...
0
votes
2answers
119 views

Trying to make 3D game look like 2D

I'm making a 2D dungeon crawler. The problem I found, it is that trying to animate the movement through the dungeon it is hard as hell. Then I thought that maybe a 3D dungeon will be better for this, ...
1
vote
1answer
42 views

One large tileset or multiple tilesets

I'm currently writing a 2d tile scroller for a hobby project and I can't find any resources to give me a clear answer to which is more efficient to do. Each block contains tiles 44 by 24, 32px x ...
1
vote
2answers
164 views

Determine facing direction mecanim 2d movement

I'm using this script to move my character in my 2d world: public float speed; //Movementspeed public Rigidbody2D rbody; Animator anim; void Start () { rbody = GetComponentInChildren<...
0
votes
1answer
36 views

Combining lots of small polygons to one (some) big poly(s)

I am looking for algorithm to merge lots of relatively small 2d polygons to one or some big polygons. In case two small polygons are touching or overlapping, they should be merged to one polygon. My ...
2
votes
3answers
361 views

Adding a small slide when player releases left/right key

The aim is for the player object to slow down and stop instead of just stopping dead. The following codes works ok when the player is not jumping, but gets stuck in an object if the player is in the ...
0
votes
0answers
37 views

Simulating a rope in 3D

I want to simulate a rope in 3D. My aim is to code everything myself using Unity 5. I think it will be easier to implement a 2D rope first and then move on to the 3D version. I have read many ...
1
vote
1answer
62 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 ...
0
votes
3answers
67 views

How do I flip Player in 2D Touch Movement?

How do i flip my Player in 2D when i got touch movement? I got Buttons to move but how do I flip the player now if i walk to the right cause my player faces to the left..? here is my Player Script: ...
1
vote
2answers
57 views

LibGDX - Collision detection between all bullets and all enemies

I'm trying to make a collision detection system between the player's bullets and all the enemies on screen. So far I had something like this: for (Bullet bullet : hero.getPistols().getAllShotBullets(...
0
votes
1answer
59 views

Should i make 2 or 3 dimensional game? [closed]

I want to start making a game, but i have no idea if i should make a game in 2D or 3D .. Both of them are okay (Making 3d graphics are a nightmare, but doesn't matter). I am at middle school, but i ...
0
votes
1answer
54 views

How to fill a canvas with triangles that are seemingly random?

Given a canvas say, 1000 X 1000 unit. I would like to fill the canvas with triangles. The triangles can be of any type right angle, equilateral...etc. To avoid big chunks of triangles lets say all ...
1
vote
0answers
15 views

In PhaserJS, how do I get a clicked Physics.P2 body's data?

I have a sprite with Phaser.Physics.P2 enabled, using a custom shape loaded with loadPolygon() from a .json file. I have also activated its debug and debugBody properties, so I can see the custom ...
1
vote
2answers
61 views

Collider not working

I have a 2D object (without a parent) with a 2d box collider (dimensions are not small) added to it and set as trigger when I place it in the scene it works just fine however when I instantiate its ...
2
votes
2answers
71 views

object smooth orbital limit around another object depending on mouse drag

I am working in Unity. I have special objects that can each be dragged freely around in 2d. The objects cannot get too close to other objects (minimal Vector3.distance allowed is 1.5f). I also have ...
1
vote
1answer
24 views

Why is my zooming-in + changing scenes not woking in Unity?

I'm zooming on a map using Math.Lerp and then I use the scene manager to change the scene. Here is my attempt but it doesn't work on the map. I have attached it to the main camera, in the worldView: ...
0
votes
2answers
49 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 ...
0
votes
1answer
103 views

handle mousedrag() for two different game objects individually in 2D environment

I am developing a pong game for android mobiles having 2 slider and want to assign movement of individual slider corresponding to its current position I tried some code for the movement of these ...
0
votes
1answer
59 views

Zoom in and switch scenes in unity

I'm trying to zoom in as my game is like a map and I have to click on a certain country to zoom in and change the scene to this country. So I want to zoom the camera slowly and then change the scene ...
1
vote
2answers
67 views

Tank bullet shooting

Ok, I'm having a lot of trouble understanding using Matrices for Movement in a 2D game. I currently have a Tank object that has a Matrix3 globalTransform managing the direction Scale and Rotation. ...
0
votes
2answers
80 views

2D top down RPG animation architecture problem

I have a problem with my sprite animations right now. I have different animations and sequences for each character so an specific archer might do a ranged attack in which he just plays one animation ...
0
votes
0answers
40 views

Create a collision detection system

Public Class Game 'NORTH = 1, EAST = 2, SOUTH = 3, WEST = 4 Dim myFont As Font = New Font(New FontFamily("Microsoft Sans Serif"), 16) 'CONSTANT VARIABLES Const RESOLUTION_WIDTH As Integer = 800 '...
0
votes
1answer
17 views

XNA HLSL Shader Color Swapping based on lightness

I'm trying to achieve a similar effect to the image below in HLSL. [Ignore the inbetween state, currently I'm only trying to achieve the final phase, which is black and red] What I tried so far is ...
1
vote
1answer
49 views

How to switch between sprites in Unity

So I made an empty game object in inspector, called it "squareTest", and I clicked and dragged 3 sprites in. One is the square being black, one is the square being red, and one is the square being ...
0
votes
0answers
19 views

Zoom in and change scenes in unity [duplicate]

I'm trying to zoom in as my game is like a map and I have to click on a certain country to zoom in and change the scene to this country. So I want to zoom the camera slowly and then change the scene ...
0
votes
0answers
29 views

How to make the player glide after a jump in Unity?

I need a script that can make my player do an horizontal movement when he is in air (jumping) Take my older script! using UnityEngine; using System.Collections; public class Player : MonoBehaviour {...
2
votes
1answer
214 views

2D lighting causes black rings to appear

A year ago I implemented 2d lighting in XNA using sprites. The sprites I used were created by placing a soft white photoshop brush on a transparant background. The result was this: (lights only) ...
2
votes
2answers
749 views

Unity 2D Alpha cutout layer for Sprites

I'm trying to make a simple Fog of War effect for my 2d game, similar to these: . I want to have a sprite layer of black and then have a sprite to cut out itself from the black layer, leaving a ...
0
votes
1answer
83 views

Vertexquads are not being drawn in 2D space

I started teaching myself DirectX a short time ago and have come across a problem which I can't figure out by myself unfortunately. I'm trying to build my own font system, so I can draw strings in 2D ...
0
votes
1answer
71 views

C# OpenTK Text rendering

I've been looking everywhere for a solution on how to render/draw text for my 2D OpenTK-based game. Been trying quite a few QuickFont ones without success (either a AccessViolation exception or text ...
1
vote
1answer
64 views

Unity3D (2D) - Make sure Item Dragged Is Top Item Visually

I am using Unity 5 and making a 2D game in which many sprites will be stacked on top of each other and can then be moved by dragging. Sometimes when the users goes to drag from a pile, ones that aren'...
2
votes
2answers
19k views

How to add a UI Text for keeping Score in Unity 5

My Problem is simple I want to show scores on my game. The examples on internet are good but in Unity 5 there are no GUI elements but instead these are now UI elements. I was following this example: ...
0
votes
0answers
24 views

Java - Issue colliding with more than one object

Ok, I am working on a simple 2D sidescroller game and having issues with the player (or any moving entity) colliding with another entity. My current method, (a box on north, south, east, and west to ...
0
votes
1answer
330 views

Player position on second player connection

I'm having some trouble trying to run my game for the multiplayer part. I'm creating a 2D game. I have followed this tutorial : http://www.paladinstudios.com/2013/07/10/how-to-create-an-online-...
0
votes
1answer
74 views

QT SFML Integration Trouble

I have been having trouble linking sfml to qt creator I have downloaded the pre-compiled libraries and headers for MINGW on the sfml website here : http://www.sfml-dev.org/download/sfml/2.3.2/ This ...
0
votes
1answer
28 views

Unity 2d square position not lining up with its size

I want to have one square that rests at the Unity 2d coordinates (5,5). Using transform.localScale I make the square be 3 units by 3 units large. So I thought that if I made another square that is the ...
0
votes
0answers
20 views

2D Camera in LWJGL 3

I am trying to implement a simple 2D camera in LWJGL3. The camera has an orthographic projection and can move in 2D space. This is run once at game start-up: GL11.glMatrixMode(GL11.GL_PROJECTION)...
1
vote
1answer
113 views

How to create 2D cameras in swing?

What is the best way to create a camera for a 2D platformer using swing, and I want to create a camera that moves instead of moving the background. This is because I'm going to have objects rotated by ...
1
vote
1answer
49 views

Basic Animation Concept - Stuttering Sprites (Java)

The Problem I have some sprites animating across my screen (some spaceships). I alter their X coordinates (like -5, for animation) in my game loop. I want the animation to happen faster, however ...
0
votes
2answers
894 views

How to move an image back and forth with javascript

I currently am trying to make a baseball game and have this code here: http://jsfiddle.net/769BK/ I have the baseballX set to a decrement, and then I try increasing the value using baseballX++; but it ...
0
votes
1answer
43 views

How to correct this issue with a top-down aiming angle in Unity - 2D?

I'm trying to build my first project and I'd like some input for a math correction. The game is a top down 2D shooter, a bit like the iconic "chaos engine" from SNES. The issue is that either the ...
0
votes
1answer
198 views

Draw GUI.Button on certain position on a scrollable background

Problem is in a 2D game I have a large background around 2 screens wide. And on there I got 4 buttons placed on top of background all over complete width. Now when I swipe of move my mouse around I ...
0
votes
2answers
186 views

Joystick like controls in unity for mobiles

How can i achieve joystick like controls on mobile? For example i have a 2D platform game where character should keep on moving right when swiped right and held and vice versa, just like a real ...
0
votes
1answer
39 views

Unity 2D C# Enemy Attackng Ai issue

Ok to be specific, both of my enemies will continuously play their attack animation even when it is false. I don't understand what I am doing wrong here :( void OnTriggerEnter2D(Collider2D other){ ...