Flat two-dimensional space. Positions represented with `x`, `y` coordinates.

learn more… | top users | synonyms

1
vote
1answer
41 views

How to target moving object in 2D game

I am working on targeting system for 2D game. Two objects move in space. Each one have Position and Velocity vector. Ship object shoots moving objects in space. Ship can shoot in any direction, but ...
0
votes
1answer
49 views

Best way to manage weapons as GameObject on a script in Unity with C#

I have a player game-object with a script Player. In the Player script I have a public properties weapons. I want to have to just drag in this properties a script/prefabs. And the Player script must ...
1
vote
2answers
40 views

Need help with physics 2D Unity

I'm making a 2D game in Unity. Basically there's just a rocket that goes where ever the user touches. With the code that i have right now, the rocket instantly rotates towards the point and moves ...
1
vote
2answers
34 views

Vision Cone for Enemy AI in Unity 2d

I am trying to develop an Enemy AI with vision cone in unity 2d top down game, can you please suggest me some approach or sample script, so I can get an idea.
0
votes
1answer
15 views

Rotating 2D-Projectile towards mouse, hides the projectile (Maybe changes the layer)

I want to shoot towards my mouse, which is working fine now. After this was solved, I wanted to rotate the projectile, so that it's looking to the mouse. This is my code: projectile.transform.LookAt ...
1
vote
1answer
75 views

My bullet changes the velocity depending on where I click

I want to build a little 2D-Sidescrolling shooter and I'm now at the shooting script. I already figured out how to shoot a bullet towards my mouse pointer. I got something like this : Vector3 ...
0
votes
2answers
59 views

Orthographic Camera settings for a 2D game

I'm starting out a 2D wrestling game in Unity 5 and i need some help. The default resolution of game needs to be 320x240. The background sprite that i would be using is 640x480. The camera would move ...
0
votes
3answers
97 views

Procedural generation of stars in the background with given random seed

I want to generate stars (actually a 2d vector) in the background. The player is moving left and right endlessly. When the player moves the stars, which aren't in sight anymore, should be deleted from ...
0
votes
1answer
37 views

Game maker or unity for 2d games [closed]

I'm new to game dev but I know how to code. I would like to try my hand at making a 2d game. I am overwhelmed by the ear between unity and game maker. Which one would be better to use. I thought unity ...
0
votes
0answers
33 views

How to make a 2d game using java netbeans? [closed]

I'm an IT student, but my problem is my professor is just giving us codes but not explaining what is it for. Now, in our finals, our finals exam is we'll be making a 2d game using java. And I have no ...
0
votes
2answers
38 views

How to access Collider in c# script with its tag name

I want to access a Collider in c# script file with its tag name I Tried this if (Collider2D == Physics2D.OverlapPoint(touchPos)) { Some Code to be Performed } I want to access this Collider2D ...
1
vote
1answer
60 views

2D World - How to represent my Game Objects graphically?

I want to code my own topdown 2D game with SFML+C++ that later shall have multiplayer functionality. Therefor I want to seperate the graphical and logical Parts of my game. All of my ingame Objects ...
0
votes
1answer
47 views

Change sprite to animation in unity 5 2d (c#)

I want to do the same as this older post with one change: Change the sprite of a Object in Unity I want to use a .anim animation (created with unity) after the space key is pressed instead of ...
1
vote
1answer
71 views

Isometric Terrain Editor

I am trying to make an isometric terrain editor. My problem is not to do with making isometric graphics or rendering them, rather it is to do with indexing of tiles. Let's say I'm making a hill at ...
0
votes
0answers
11 views

OpenGL HUD is flickering when rotating the camera

I draw game HUD after drawing 3D scene. When I move the camera quickly, HUD starts flickering. I noticed that it happens only if the distance between the camera and an object its looking at changes ...
-1
votes
1answer
36 views

How do i move a 2D object with angle and speed variables in unity?

I want to move an object with a certain angle and speed, is there a was to set this as an initial velocity so that it is still possible for the object to collide and bounce of other objects using its ...
2
votes
2answers
57 views

2D multiple circle collision response

I'm trying to implement simple 2D circle collision system. There are circles with different radiuses and velocities (the larger the circle the slower it is). Contrary to all the questions on the ...
0
votes
1answer
44 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 ...
1
vote
1answer
44 views

DX11 Mixing 2D and 3D

So I am somewhat new to working with DirectX rendering, and I have done some 2d and 3d work. I am planning on working on a new application where I will be rendering a bunch of 3d scenery, and then ...
0
votes
0answers
32 views

Hide back button bar of android mobile while playing game

I just want to hide back button bar of android mobile while playing the game. I tried to make it close by pressing back button,it getting close but its always visible. please help..
3
votes
1answer
102 views

Retro Racing Renderer

While I have a lot of experience with coding SW&HW 3D rasterizers across multiple platforms and eras, I never got to coding a 2D renderer for a non-polygonal racing game with multiple rolling ...
0
votes
1answer
40 views

current value of x for vector2 game object

I just need to push my game object in y direction not in of its x position,I need to assign it a new position but unable to access its current x position value so that can make it fix on its x ...
1
vote
1answer
65 views

How to calculate faces involved in collision (Separating Axis Theorem)

I have a game engine created in javascript (https://jsfiddle.net/4gqsq8wf/) which uses collision detection via the Separating Axis Theorem. Currently, it does not have any means of resolving velocity ...
0
votes
2answers
80 views

What are the steps to instantiate a button in Unity?

Given a Canvas test_canvas containing a Button test_button and an empty GameObject that manages instantiation and scripts and the like called test_manager, what are the steps to instantiate this ...
1
vote
0answers
31 views

Weapon index sets index values to the same

i've got a question about my unreal blueprints. I've been trying to get this right for almost a month now, but i don't know how to fix this. These are my are down below and a small video to explain my ...
1
vote
1answer
70 views

How do you make a Pong slider using touch events for mobiles?

I am stuck with an issue of moving the slider on android mobiles with finger touch event while developing pong game in unity 3D, though its working fine for pc. This game is developed in 2D ...
0
votes
1answer
19 views

Rotate coordinates back after rotating game context (geometry)

To achieve something similar to the image below using HTML5 canvas one can simply write the following: var TO_RADIANS = 0.0174532925; context.translate(30, 20); context.rotate(30 * TO_RADIANS); ...
2
votes
0answers
63 views

How can I simulate these two droplet? [duplicate]

Below is a two droplet merging together,in 2d. I want to simulate the behavior when I exert combination force(through mouse or fling force on touch screen) on one of them to make them to be a larger ...
-1
votes
0answers
48 views

Unity 2D topdown car physics - backward movement

Im trying to implement some movement physics to my car in unity 2D. Im trying to achieve this behavior : if press up - car move forward. if i press down and car is moving - brake deceleration. if ...
-1
votes
1answer
105 views

Using Physics.Raycast inside OnCollisionEnter2D function

void OnCollisionEnter2D(Collision2D collision) { foreach(ContactPoint2D contact in collision.contacts) { RaycastHit raycastInfo; ...
0
votes
1answer
113 views

2d Isometric sorting for multi-tile objects

The sorting that i have now works only for 1 tile of space, but the problem started when i created a object that is multi tile for example bed in this picture occupies 1x2 tiles, and the sorting ...
1
vote
2answers
114 views

Unreal Engine for 2d in c++ [closed]

I was about to start my journey on unreal engine but currently all of the tutorials we're all about blueprints in 2D games. I really want to make 2d games since I am not good at 3d (not yet). My ...
1
vote
1answer
42 views

How to detect collision position and that position's texture color in Unity?

I have a prefab and I use Circlecollider2D for physics operations. I want to detect the color of the contact position of the collided objects ? Is is possible by using Unity's collider classes ?
-1
votes
1answer
56 views

How can I set up a pixel-perfect camera using OpenGL and orthographic projection?

I am creating a 2D game using OpenGL and orthographic projection. For sprites, I use textured quads (actually two triangles). I want the pixel art textures for the sprites to be displayed in a ...
0
votes
1answer
47 views

How to display three dimensional Objects in a 2D Game using OpenGL and orthographic Projection?

I am creating a 2D (2.5D) game using OpenGL and orthographic projection. It is simple to have relatively flat objects, e.g. characters. I simply use a quad with a texture of the character and move ...
0
votes
1answer
54 views

Monogame / XNA - Multple 2D Cameras (Rectangle) on screen

I recently started building a simple 2D roguelike game using Monogame 3.4. I was keen on building the game "engine" myself as I saw it as a fun learning curve. Monogame was pretty much the best option ...
3
votes
1answer
69 views

Why does Unity increase the size of image when I use the image in Unity?

I try to make a game in Unity 2d. But when I drop the image in Unity the image size increases 3 or 4 times. Can I fix that or is this normal?
2
votes
1answer
63 views

Using world coordinates instead of pixels

I've been told that having a set pixels-per-world unit number is bad practice because it will not look the same at different resolutions. Because of this, I am trying to learn about using abstract ...
1
vote
1answer
39 views

Double Jump causing problems?

Here is my code. I have an empty Gameobject directly underneath the child with a small radius checking the ground every thing seems to be correctly covered, but for some reason the jumping mechanic is ...
1
vote
0answers
43 views

LibGDX - ShapeRenderer as principal game entity renderer

I am trying to make a 2D game that is just a bunch of default figures like circles, arcs and quadrilaterals with no textures (similar to Super Hexagon), and for that I was using C# and XNA long time ...
0
votes
0answers
59 views

Transition Idle to Running not smooth

http://gyazo.com/441ba7f4962cf1470692b437b8ae47a4 Hello, I'm following the unity tutorial for 3D character movement and, I'm trying to make the transition to idle and running but for some reason the ...
0
votes
0answers
42 views

Bad / clipped pixel rendering of a 2d sprite

I'm testing things in unity but I've run into this problem and i can't solve it... I have the following configuration: Images of the problem: As we can see in the problem images the pixels ...
1
vote
1answer
109 views

Unity 2D Graphics Optimization For Mobile Devices

I want some advices on how to create graphical assets for mobile devices so that the game will have a good performance and not lag on mobile devices. I had 3 issues with my games and that is they ...
0
votes
1answer
51 views

Touchscript: multiple overlapping colliders

Im building a tower defense game on unity and would like to allow the player to pan the camera on a large map. I am using touchscript to handle the touches. I made a testing project with the ...
-2
votes
1answer
59 views

Optimal trajectory of area exploration

I've got next problem. There is three objects: first one, with next characteristics: circular area of view, speed, drag coefficient; wind (or water current, doesn't matter; some sort of resistance) ...
1
vote
1answer
54 views

Why is Unity 2D Alpha-Blurring my pixel sprite?

So I have just brought in a place holder block for the ground in unity 2D, and it's 16 by 16 pixel image, and for some reason unity is automatically blurring the image. So I was wondering if there was ...
0
votes
1answer
58 views

Unity Quality Reduction only reduces my player sprite quality

I created a small map in tiled then imported it into Unity. A small sprite character is controlled by the player to roam about the map. I am experimenting with this for University and wanted to see ...
1
vote
2answers
433 views

Testing Unity 2D Physics

I am looking to push the 2D physics in Unity to the extent where when so much is going on that there becomes noticeable lag in a game. This is for testing purposes, so that when so much is going on ...
0
votes
1answer
42 views

Random Y Axis Movement Within Set Limits (C#)

I've searched everywhere for this answer but everything I find is in Javascript and a lot of it doesn't help/work in my situation since most of it is Vector3's and using each axis, and my game is 2D. ...
0
votes
0answers
42 views

how to move an object to the mouse in Java

I have just recently started using Java, literally 2 days ago, and I have run into an issue. While I have been easily able to figure out most of the syntax and methods, because I have used multiple ...