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

learn more… | top users | synonyms

0
votes
3answers
137 views

Show 3D elements on 2D background

I'll make a navigation menu in my game and had the good idee to this the enemies to start games or go to the gun store. The problem is when I look in game mode, the enemy named ZomBear in hierarchy ...
0
votes
2answers
92 views

Positioning 2D (non-UI system) game objects

As an old Flash dev I'm slightly confused about how you position game objects on the screen in Unity since game objects have no width or height (only a scale). Let's say I have a container gameobject ...
0
votes
0answers
61 views

2D Voxel Game Chunk Question

I'm currently working on a 2D Voxel game. I started with a big blocks array with all blocks inside it, but it is not very good for performance, so I'm currently switching over to chunks. My question ...
0
votes
0answers
16 views

Java keyListener animating bufferedImages

I am making a game similar to a photo scramble/unscramble game which requires the use of keyListeners. I set up the logic but when I code the animations, they just sit there and do nothing and ...
3
votes
3answers
97 views

MonoGame - Ordering Movement Key Presses

I'm looking for a way to retrieve the last key pressed even when other keys might be pressed for a top-down four-directional game. For example: W is pressed → Move up D is pressed → Move ...
0
votes
1answer
129 views

2d raycast collision problem

I am currently making a 2d top down game in unity and have stumbled upon a problem with my raycast collision. I want my green player to stop moving when colliding with a wall, therefore i made my ...
0
votes
1answer
142 views

Copy a gameObject's collider at runtime (Unity)

I'm working on a small Unity 2D project in which I need to modify the collider of the player at runtime. I'm using Physics2D.Raycast to find the collider and then what I'd like to be able to do is ...
1
vote
2answers
99 views

Does Direct3D 11 enable Z-clipping/discard by default?

I'm rendering simple 2D figures in DirectX 11.1 and I cannot get Z-values to be rendered; all pixels with Z != 0 get discarded. I'm doing proper world transform as far as I know. X/Y translations work....
2
votes
1answer
98 views

Java 2D Game Development - Best Performance With Rendering

I have seen two different rendering methods. One of them is rendering multiple bufferedImages like g.drawImage(image1 to imagexxx, x, y). Like in my game I have to render, on each tick, 880 buffered ...
0
votes
1answer
64 views

Mismatch between scene view and game view

In my scene view, it looks like the player is correctly lined up with the map. But when I see it in the game view, it's off. You can see the Game view in the top-middle, and the Scene view in the ...
4
votes
1answer
106 views

In a 2D multiplayer game should I send the position of user to the server all the time? [duplicate]

In a 2D game where the user moves with the keyboard arrows, should the user send all the time he moves his position (x, y)?. If the user has some speed, the user would send (x, y) like 50 times pixel ...
0
votes
1answer
46 views

Objects fall off screen, because stay one behind another[unity]

I m learning unity, I placed objects on a scene, camera is looking at them and displays them fine. but in 3d, I can see they are one behind another, so when i hit play button, they just fall! Pic: ...
0
votes
1answer
203 views

How can I make my tiles fall smoothly?

I'm working on a Tile-Based game and I can't figure out how to make my tiles fall down smoothly like in candy crush. All column tiles fall-down at the same time. And spawn new like how many tile place ...
0
votes
1answer
53 views

My game has messed up layouts!

Earlier, I asked this question: Landscape mode for game? Where I had a directory for each and every layout, but the layout in the layout-land directory wasn't showing up when positioning my layout in ...
3
votes
1answer
160 views

How do 2D volumetric lights work?

Context So in my current project (written in Java using LWJGL / OpenGL, so GLSL for shaders) I added lighting quite a few months ago, which was already an interesting challenge, having never done ...
0
votes
1answer
218 views

How to find connected groups in a 2D grid of tiles

Firstly, my English is very bad, sorry for this. That's why I showed my problem with a picture. Block[,] sameTiles = new Block[ WorldController.Instance.World.Width, WorldController.Instance....
0
votes
0answers
101 views

Landscape mode for game?

TL;DR: I have made 8 new layouts for each activity layout, but they are not showing up. For example, I have a layout-land directory with a layout, but that layout doesn't show up when I turn my phone ...
0
votes
3answers
72 views

Math.Clamp won't limit my position until movement is ceased

The program is in a top down view, with Y going up (or forward depending upon how you see it), and X going from left to right based on the camera view. I am attempting to set the minimum and maximum ...
0
votes
1answer
39 views

How to draw a sprite at a floating point xy coordinate with interlaced drawing?

I have a 2D game made in MonoGame (XNA 4.0 framework). Here's what I want to do: draw a 2d image at a floating point xy coordinate such as 125.5, 300.12 (and do NOT round them to an int). the image ...
0
votes
1answer
84 views

Basic Moving/Anim Script [Unity CSharp]

So, I got this to do the anims for my sprite in Unity 2d... using UnityEngine; using System.Collections; public class Move : MonoBehaviour { public float Speed = 2; Animator anim; // Use this for ...
-3
votes
1answer
49 views

How/where can i learn everything unity2d [closed]

I just learnt unity basics and would like to learn everything else related to 2d development beginner to advanced in less time. Because i dont want to stick to game business/development for a long ...
9
votes
1answer
145 views

2D Physics: storing previous position vs storing velocity

I saw a number of 2d game tutorials and books where previous position of an object was stored in state instead of velocity vector. Velocity is then calculated each frame as a difference between ...
0
votes
0answers
123 views

Marching Square Generated 2d Terrain: Dealing with more than 2 tile types

I need some help with my random map generator. First, I use a noise generator (something like Perlin noise) to create my tile array. For now i'm using three tiles: water (0), beach (1), and grass (2)...
0
votes
2answers
176 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 ...
2
votes
2answers
201 views

How to allow multiple bullets on screen at once

Using my universities API, I'm making a basic 2D game where pacman can shoot ghosts I have a bullet class but at the moment, I only have one instance of the bullet could anyone help edit this code/...
0
votes
1answer
68 views

Cast a circle around an object and detect other objects in range (with visual)

I have my "player" object moving around an arena type area, with miscellaneous objects scattered about. What I want to do is move the player near any of these objects, and on keypress I want to ...
0
votes
2answers
312 views

Gyroscope Parallax Effect In Unity

I want to make a parallax effect in Unity 3D with gyroscope like the one on this site: http://matthew.wagerfield.com/parallax/ I found an asset, but it is too expensive. So I need a script which I ...
0
votes
2answers
257 views

Unity 3D: How to stop/reset 2D sprite animation after releasing key?

Im following a tutorial to create animations with a 2D sprite character. But i put in my own. Which has 8 animation positions. For some reason when my guy walks around,then stop, the walkings ...
-5
votes
2answers
130 views

The Power of 2D Engines vs Modern 3D Games [closed]

I'm toying around a lot with Game Maker. I really like it. GML is very simple and with its nearly object oriented design you could create anything in 2D you can think of. However there is a limit. ...
1
vote
1answer
113 views

How to remove destroyed clones out of the Hierarchy in Unity2D

I made a 2D edge collider which on contact destroys the other gameobject. When I launch the game all the other gameobjects in fact get destroyed but the clones are still listed in the Hierarchy. How ...
1
vote
0answers
42 views

The new android studio? [closed]

I got the new android studio, and I noticed one thing when creating a new activity. The layout that corresponds with the java for the activity is made twice, once as a content: This new layout ...
2
votes
1answer
110 views

Two 2D objects in Unity aren't colliding together

In Unity 5, I have a player shooting a projectile in aim to hit a boss, and inflict damage upon contact with the projectile. Though for some reason, the projectile and boss aren't colliding with each ...
1
vote
0answers
77 views

Screenshot preview freezes a game for a few seconds

I have a screenshot preview at the end of the level, but when I show it my game freezes for a bit(low fps for a few seconds). This is code I use to load screenshot and crop it(for a little preview ...
1
vote
1answer
85 views

Different screen sizes? (landscape)

I want to make a separate landscape layout for each size of my original layout I have activity_main.xml. I have adapted it to be able to fit multiple screen sizes: Now, I want to create a ...
5
votes
2answers
189 views

Drawing circles at the background of a 3D scene and updating their size

So, here is what I am trying to do in Unity 5 (using C#). I want to draw a a 2D circle at the background of a 3D scene and apply a texture/image to fill it. Just like it would be if the circle was in ...
2
votes
1answer
99 views

Implementing attack animation in four direction movement

The way the program is supposed to run is basically, a character can be running/idle and if spacebar is pressed, all movement stops and movement controls are locked through the bool "canMove". The ...
2
votes
0answers
59 views

Sprite animation in Android view

I'm looking for a way to have different sprite animations in individual Android views. I try to use LibGDX and AndEngine but most I could find was how to get an Activity with the sprite animation. ...
2
votes
1answer
143 views

How would i go about implementing portals into my game?

I don't mean to ask a broad question, so let me explain. I'm creating a 2D top-down design game and I'd like to implement "portals" to be able to switch between worlds. Each world is a level class, ...
1
vote
1answer
100 views

Confused about this Timer function C++

I am confused about the argument "m" of this function. I also need to know how to make this work. I am working on a simple 2d game and I am really new to programming. I don't know how to make things ...
2
votes
1answer
62 views

Efficient Per-Tile Lighting Technique

Quite a few of the 2D games that I have seen use per-tile lighting, where each tile has a set brightness (continuous scale of 0 to 1, for example). One way of calculating the brightness of any one ...
0
votes
0answers
25 views

Layout is different?

I know that layouts can look different on different screen sizes, but I didn't take that into account when I made this layout. So, it is designed for normal screen size, by default, and my phone ...
2
votes
1answer
86 views

Comparing the images

I have a drawable, which I want to compare to. I created a drawable object with it, and when I log it with toString, I get: android.graphics.drawable.BitmapDrawable@41f95548 I am randomly selecting ...
1
vote
2answers
218 views

Enemy moving towards Player in a 2D setting?

i want to apologize if this seems so basic, but I'm having trouble having an Enemy move in my Player's Direction in a 2D Top-Down game. I already saw a lot of other answers but they all use the ....
1
vote
0answers
52 views

Finding the components of Proportional Navigation in 2D

So, I've been scouring this, the Physics Exchange, Wikipedia, and the general web for information about Proportional Navigation, and I can't seem to wrap my head around how to find the individual ...
1
vote
0answers
59 views

Game is responding very slowly?

I have a very simple app which removes buttons and re-adds buttons to certain layouts when a button is clicked. The problem is, this process is taking a very long time. My question is: How can I make ...
1
vote
2answers
129 views

Swap buttons in layout

Say I have 4 buttons. I want to have button 2 always swap out with another button, randomly. So, when the user taps button 2, it should swap with another button (randomly). Now, button 2 is at the ...
1
vote
0answers
41 views

How can I move my button?

I am new to animations in android. I was wondering, is there a way to keep a button moving around the screen, bouncing off the walls, until it gets clicked? I was thinking to do something like this: ...
1
vote
1answer
169 views

How to combine tiles in a procedurally generated level in 2D tile based maps?

I am developing a 2D tile-based top-down game. It is currently instantiating square objects with a sprite renderer to procedurally generate the map. Each floor and wall is a 1-unit wide object. I ...
1
vote
1answer
65 views

Unity animations not transitioning properly

I am currently trying to animate transitions between four different directions. I have four total animations for walking, and another four for the idle state. I cannot seem to figure out why when I ...
3
votes
2answers
243 views

How to organize level blocks in an Infinite runner

I'm working on an Infinite Runner game. I have created many level blocks(sections) with different obstacles and pick-ups for the player. They are positioned and placed manually, in such a way, to give ...