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

learn more… | top users | synonyms

0
votes
1answer
26 views

show hide button in unity using c#

I have 15 buttons on my screen at onClick event am fetching the button and hiding that button using EventSystem.current.currentSelectedGameObject.SetActive(false); now at the end i have to show ...
0
votes
0answers
60 views

Shoot diagonally with Unity 2D

I'm working on a shoot script where the player can shoot right, left and to diagonal directions like right up and right down. All of this I can make, the player shooting to left, right and right up ...
0
votes
0answers
30 views

Getting my 2D follower to double jump :L

Ok so here is the current situation, I am essentially trying to get my player's follower to double jump after he jumped. I've successfully got my follower to jump at edges but not so much for double ...
0
votes
1answer
40 views

How to create a 2d character turning his head animation?

I'm learning to create a 2d character animation for games. I've seen some tutorial where we use skeletal animation to move images and create several frame to create an animation. But, for an ...
0
votes
0answers
40 views

How do i change something so i can code in SharpDevelop? [closed]

I just picked up a new game engine called Duality. I'm also very new to coding so bare with me. i was practicing inside sharpdevelop and made a small game with console. Now im wanting to make a small ...
0
votes
0answers
39 views

Unity Physics 2D Raycaster does not work

The version of unity I'm using is 5.5.0a6. I have a script that intercepts OnPointerClick, OnPointerDown and OnPointerUp events. My camera has the forementioned componend attached to it and my scene ...
0
votes
2answers
58 views

Calculating time until a ball fall

How exactly can I calculate time until a ball fall if I know initial and final x and y position of a ball, gravity, delta time, initial dx and dy of a ball and its speed calculated from the formula ...
0
votes
0answers
35 views

unity 2d animation masking

im searching or a way to combine animations or mask a part of animation of 2d character for aiming and looking. for 3d unity has some good tools to do that but couldn't find out how to do it on 2d. ...
1
vote
0answers
93 views

Lighting doesn't work properly in WebGL build only at one place

So I have a 2d game where a player walks around the level (top view) with a flashlight in front of him. Everything works fine in the editor, however whenever I build it for WebGL and test it in my ...
0
votes
0answers
15 views

Game Dev in Xcode, How do I make a bundle

So I'm making a 2d game as a school project using c++, openGL and GLFW. My team only has MacBooks, so we're using Xcode which none of us have used before. Later on down the road we'd like to be ...
0
votes
1answer
24 views

Unity UI Image Prevent Camera To Render All Object In Front Of It

i confused why is this happen , i know there's already available post that discuss this but i cannot find it at google. My problem is that my UI image with sprite hide rendering all object in front of ...
0
votes
0answers
23 views

How do I add images using Greenfoot?

How can I add an image to my Greenfoot game and contort it? I'm designing a game where I have ships at sea battle against each other. When the ships battle I would like to change the image of an ...
1
vote
1answer
50 views

Rotate a Crosshair around a sprite - 2d worms style game?? (LibGDX)

I'm currently learning to code 2d games in Libgdx. Right now I'm making a kind of worms clone. I am using Box2d and have just my main sprite and a flat ground object so far. What im stuck on is ...
0
votes
1answer
31 views

How to make object move in exact gametime in Monogame, XNA?

I have recently started learning monogame. The big question i faced is how to make object move, when gametime variable has an exact value. //Update method in Game.cs float delta = (float)...
0
votes
0answers
11 views

Unity 2D play animation with flipX then enabling and disabling GameObject “locks” flipX

I have a GameObject with an Animator that contains many different animations. In C# I switch between these animations with animator.Play("AnimName"). Some of the animations have the flipX property ...
0
votes
0answers
32 views

MonoGame - Improving 2D array Spritebatch performance

I'm looking to improve the performance of my Draw() method for my tilemap. I've poked around for a few hours and done things like: Removed any new calls from the for loops where I'm drawing the tiles....
1
vote
2answers
103 views

Calculating next speed of a ball

Is it possible to calculate the next speed of a ball knowing only dx and dy of the ball? For example if x = 120, y = 0, dx = -10, dx = 10, gravity = 0.05. So the next position of a ball (next update) ...
-1
votes
3answers
143 views

Explaining “dx” and “dy” as ball properties

A ball in a 2D volleyball game is described by 4 variables, x , y, dx and dy. What exactly does it mean by dx and dy?
0
votes
0answers
80 views

Help how to shoot a bullet?

I'm working on a 2D tower defense game and I'm having trouble making my towers shoot the enemies, the script's there, assigned to the gameobject needed in each case but it doesn't do anything, help ...
0
votes
1answer
28 views

Camera movement, Draw grid

If I have a 20x10 grid (640x320) where tiles are 32x32 The grid are rendered: for (var y = 0; y < 10; y++) { for (var x = 0; x < 20; x++) { var tileX = Math.round(Camera.x / 32); ...
0
votes
0answers
16 views

Unity Physics2D.BoxCast distance parameter doesn't work

I'm currently using Unity version 5.4.2f2 Personal for Mac and I'm having trouble getting Physics2D.BoxCast to work. I've setup a simple example Scene with the default camera, a single empty ...
0
votes
0answers
42 views

Is this 2D light implementation with shaders good enough?

After some days reading and programming shaders in GLSL (and Allegro 5) I came up with the stages I will be using to render the lights in my 2D test game. My first goal is to reach something like what ...
0
votes
1answer
120 views

How to get surrface position from 3D objects in 2D space

I am working on simple drag and drop game with Javascript and PIXI.JS! The game itself is 2D , but I have some pseudo-3d objects ( i guess isometric ) and I am trying to get the position of those ...
1
vote
1answer
28 views

Libgdx Animation class? not iterating through frames?

I am making a 'simple' top-down space shooter in 2d using Libgdx. I have loaded the texture regions into arrays and created Animations inside my sprite, but when I call the getKeyFrame it seems to ...
0
votes
1answer
25 views

Can't set Source image for UI image

I am new to Unity. few days back i have started learning to make games using Unity Engine & I started making a very basic car racing game. In order to add an On-screen SpeedOMeter for my car I ...
0
votes
1answer
39 views

Simultaneous line of sight for hundreds of individual agents on a grid?

I have a large grid with hundreds of individual agents, each of which is moving around based on its own visual inputs and a fast control algorithm. My question is: How can I efficiently provide each ...
0
votes
0answers
18 views

sprite sheets with atlas/pack resource website?

Im currently learning bout properly usage of spritesheets. I know how to use them etc but I find it cumbersome to manually write down all the cooords for each sprites start location into atlas etc. ...
0
votes
1answer
28 views

LibGDX Box2d - How to only setLinearVelocity on X axis - problem while jumping

public void update(float dt){ float currentYVelocity = body.getLinearVelocity().y; switch(currentMoveState){ case moveLEFT: body.setLinearVelocity(-walkSpeed * ppm, currentYVelocity); ...
0
votes
1answer
58 views

How do I make a sprite fire a bullet in a direction using SFML and C++?

I'm learning game programming for the first time using sfml and c++. I have sucessfully animated my sprite in all four directions watching some video tutorials. But now i want my sprite to fire in a ...
0
votes
1answer
35 views

How can I make the player “look” to the mouse direction? (Pygame / 2D)

Here's my code: import sys import pygame pygame.init() screen_width = 640 screen_height = 480 screen = pygame.display.set_mode((screen_width, screen_height)) running = True class Actor: def ...
0
votes
0answers
32 views

Bounding box (rectangle/polygon) for custom shapes and collision detection

I am a beginner in game development. I am using the libGDX with Box2D and struggling to come up with a solution for the following problem.: How can I have a bounding rectangle/polygon for custom ...
0
votes
0answers
22 views

Fitting tiles into square

I'm trying to make a game, where you have a 30x30 sized room, and there are 2x2 and 2x1 sized tiles. At first, randomly generated amount of tiles placed randomly into the room. The task is to decide ...
0
votes
1answer
98 views

Verify if a circle is completely inside a rectangle or not?

I am a beginner in game development. I am using the libGDX library. My question is two-fold. 1) First I'd like to know the best algorithm to verify if a circle is completely inside a rectangle. I ...
0
votes
0answers
23 views

Stretchable Mesh Generation Techniques in 2D and 3D (Unity)

I wanna to generate such mesh (or smth like) that can be "Stretchable". Yellow objects in the picture are nodes and red ones are edges of my graph. I want to generate "edges mesh" can be stretchable ...
1
vote
1answer
80 views

2d Tile Movement and Camera

Let's imagine we have a 60x60 grid (where a Tile is 64x64px). Within the viewport there should be 10 tiles. The player object is 32x32px. To have smooth movement, I have to take delta time in ...
0
votes
1answer
49 views

Spell and Terrain Interaction in Game

I am currently thinking about working on a small game where the player has to get rid of mob waves in an arena. The game is going to be 2D top-down. What I want from this game is the player to be ...
0
votes
3answers
73 views

Calculate damage values from bullet velocity and size

I'm trying to make a top-down game using javascript and Pixi which involves multiple different guns. Instead of giving each gun an individual damage value, I wanted to calculate the damage by the ...
0
votes
0answers
29 views

Abutting EdgeCollider2Ds creates occasional “bumps” at seams

I am trying to procedurally generate a smooth track surface. For this example I am using a prefab with an EdgeCollider2D of a fixed length (7.66) and simply laying them out end to end. A vehicle using ...
0
votes
0answers
33 views

Tiled2unity problem. Every tile is one color

I'm trying to get Tiled2Unity working on ubuntu. I followed the instructions for Tiled2Unity Lite and I got it running by using the following command: mono $CSSCRIPT_DIR/cscs.exe Tiled2UnityLite.cs ...
6
votes
1answer
137 views

render text inside countries

I have a map of the world and I want to place text on top of each country. The text can be anywhere from 0 to 1000 symbols long, and can often be changed. I'm looking for an algorithm to layout text ...
0
votes
3answers
32 views

Detecting mouse click for the uppermost layered 2d sprite in Unity

I have two sprites. One for the entire background and another small sprite, which is a foreground object. I have written code for both of these objects in their OnMouseDown() functions. When I click ...
1
vote
0answers
182 views

Enabling OpenGL lighting seems to disable blending

I have the following code to set up for some 2D drawing using OpenTK. I originally wrote it without any lighting considerations, but later added the lighting block. This version of the code uses GL....
0
votes
1answer
46 views

Disabling and re-enabling the clicked child objects

I am currently working on 2D platform game. The following script adding the child objects inside the array and identifies the child object I click on and checks the tag on it. Now I don't know how to ...
0
votes
0answers
49 views

How to slow down snake without making it collide with itself?

I just finished writing my first game ever, snake, in lua using Love2D. The entire source is here: https://github.com/AriaFallah/snake. Here is the problem: My snake is made of 10px by 10px segments, ...
3
votes
2answers
1k views

How to give player the ability to toggle visibility of the wall?

When keyboard 'H' is pressed i want the platformer (wall, roof, floor) become invisible when its visible and become visible when its invisible. Like giving the player ability to control visibility of ...
0
votes
1answer
49 views

Implementing acceleration in topdown 2d game

So I'm making this topdown game and I'm trying to implement player control movement so that it feels more natural. Right now I have an update method like this: void update(float delta) { velocity ...
-1
votes
2answers
62 views

Inconsistent speed when using Vector2.Lerp

I have tried to build a point and click mechanism in unity using Vector2.Lerp(current_position,new_position,Time.deltatime) But what I observed that the game object is moving at varying speeds ...
0
votes
0answers
38 views

Unable to perform any actions on non player object spawned in a network

Ok, so here's the problem. I am making a 2d two-player multiplayer game. A player can shoot the other player through his normal capabilities or using a special power. One such special power is like ...
0
votes
0answers
26 views

Free direction texture mapping implementation

I'm trying to wrap my head around free direction texture mapping algorithm as described in the article. It can be used to efficiently render floor or ceilings in raycasting game engines (like in Doom ...
0
votes
1answer
39 views

Creating a 2D sidescroller with different behavior in each level

I'm creating a game with levels built from tilemaps in LibGDX. I've created the logic for the game that adds entities based on object layers, however, many levels have different behaviors. Do I need ...