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

learn more… | top users | synonyms

0
votes
0answers
4 views

Whats a good configuration for a fighting game somersault jump animation with easing functions?

I want to create a nice SF2 style jump animation for my fighting game characters. Nothing complicated, just a typical somersault jump forward. As much as I like experimenting with different ...
0
votes
0answers
18 views

How to make expanding ring with constant thickness?

I need to generate this burst or (donut-shaped) pulse. I'm having a difficult time how to generate such shape. At first, I was thinking of scaling the image but that didnt work out because the line or ...
0
votes
4answers
73 views

How do I trigger just once and not multiple times if I the Player enters the Trigger? [duplicate]

I wanna trigger just one time and not multiple times. I have a Health System and I want that the Player takes damage from an GameObject if he enters the Trigger but it directly triggers like 65 times ...
0
votes
2answers
611 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 ...
0
votes
0answers
17 views

Making my game scalable? [duplicate]

I'm quite new to games development and just recently I've made my first Java platformer. I've been using Graphics2D to draw my spritesheets, but I've heard this method isn't very good in terms of ...
0
votes
1answer
30 views

Sprites blurred in Unity (filter mode set to point)

I'm new to Unity and I'm developing Android game. When I connect my phone with Unity Remote and launch game, all textured are blurred and they look awfull. Did some research and set Filter mode to ...
1
vote
1answer
8k views

Unity - Basic AI Enemy Follows Player - Prevent Flocking Of Enemies Together

I'm in the process of implementing a 2D top-down shooter game. I have a basic AI script that allows enemies to follow the player around. Currently it works fine for one enemy, but as soon as there are ...
1
vote
1answer
62 views

Tile base Farm Simulation in Unity

I am thinking of creating a sprite base 2d top down farm simulation game. The game uses tiles and I was wondering (conceptually) what is the best way to handle the farm tiles. Each tiles should have ...
1
vote
1answer
39 views

Procedural generation of evenly distributed random points (2d)

I am coming here because I've have a performance problem with my current implementation of an algorithm. I am the idea of Voronoi diagrams to distribute patches on an infinte 2d layer. For a Voronoi ...
2
votes
2answers
163 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 ...
0
votes
1answer
31 views

In 2d, how do I discern when a character is on top of an object, from when it is on the side?

I am building an auto-run platforming game. I have code so that if the character collides with a wall, they are pushed back until they are able to get past the wall. Unfortunately, this means that ...
0
votes
3answers
3k 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 ...
0
votes
2answers
47 views

How to achieve a sheet of paper unfolding from the center in XNA 2D?

I need to create an effect like a folded sheet of paper unfolding. I was thinking about transforming an image so it "scales" from the center to the borders by cutting the image in half and scaling ...
0
votes
0answers
30 views

Using blend trees for a simple 2d character

Let me start by saying that I'm not a animator and basically have no idea what I'm talking about. The character in the game has 3 states : indle(looks at camera) walk left and walk right. I've set up ...
2
votes
3answers
326 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
1answer
31 views

Perlin noise looks uncoherent on higher z

I was experiencing with my Perlin noise function and I tried to animate a 2D noise by changing the z value of a small amount every frame. However, as z increases, the result becomes stranger and ...
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 ...
1
vote
1answer
90 views

Using .svg in unity(2D)

Creating resolution independent sprites is tough and memory consuming. How can .svg assets be used in unity for any kind of 2d game? What are alternatives to .svg that can be used in unity? Can ...
1
vote
2answers
144 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 = ...
0
votes
3answers
55 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: ...
0
votes
0answers
9 views

libgdx - objects are drawn elongated when width and height are the same value

I don't use view ports but my camera is set to the screen width and height of the device. My objects are drawn longer(taller?) then they should be. I check my sprites and they are square not ...
2
votes
1answer
155 views

How should I store dynamic game entities for efficient area-based selection?

In my 2d block-based game I'm trying to implement a data structure that would store entities entities in a way that's capable of: Direct selection based on coordinate. Iteration Iteration limited ...
17
votes
3answers
10k views

What is a good book on physics for game development? [closed]

I'm looking for a good beginners' book on the subject of physics in game development. Something that focuses on 2D games would be preferable.
0
votes
0answers
8 views

Clicking an entity with transformation

I am trying to understand how best to implement a click detection function in a 2d JavaScript game. I can demonstrate using a simple example of two square 'entities' which can be selected when ...
1
vote
1answer
53 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 ...
0
votes
1answer
92 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
268 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 : ...
2
votes
2answers
562 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
3answers
382 views

How do I make sure the player model only moves 1 unit?

I am doing a school assignment based off of the Unity3D tutorial 2D RogueLike (all code available here) In my version though, the movement is not turnbased and I am having some trouble figuring it ...
2
votes
1answer
204 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) ...
1
vote
1answer
124 views

Unity 2D Diablo style movement

I've made a totally new scene for a 2D mobile game. I placed a sprite on the center of the screen and attached the following script onto it (this is basically a diablo-style click-to-move control ...
0
votes
1answer
75 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
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 ...
0
votes
1answer
174 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
35 views

Unity 2D Following player on the x-axis only, at a constant speed

This following code does work, but I have one issue with it. Once the gameobject starts getting close to the player that it is chasing it slows down and does not continue going at a constant speed to ...
1
vote
1answer
135 views

Most efficient way to calculate angle between two line-segments that do not necessarily touch each other

Although I found answers on calculating angles from vectors, I didn't find a specific way to calculate angles between line-segments that do not necessarily touch each other (I say "not necessarily ...
0
votes
2answers
136 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
2answers
34 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 ...
-1
votes
2answers
121 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 ...
2
votes
1answer
87 views

2D Change Velocity Based on Distance XY While Moving Parabolic Arc

What I'm trying to achieve is that the entity moves in a parabolic curve, and no this has nothing to do with gravity before you ask. I give the entity a target position which it should move to, but ...
1
vote
2answers
27 views

Rotating a Sprite and Moving It along That Angle in Unity

first time posting here. What I want to do seems extremely simple, but I'm not familiar enough with Unity to be able to implement it. Also, I wasn't able to find an answer that exactly solved my ...
0
votes
1answer
36 views

2.5D overlapping

I started making a game, wich has a 3d engine under it, but achieves a 2d look by using ortographic camera and billbiards. Similar to how Don't starve, Realm of the mad god and (I think) the new ...
2
votes
2answers
168 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 ...
3
votes
1answer
1k views

Phaser / PIXI: World size vs. Stage size

I am using Phaser to build a zoomable / pannable 2D map with the intended functionality being that the home camera position is always in the middle of the World coordinates. I have a problem where my ...
0
votes
3answers
1k views

How does one load TMX files into a SFML game?

How does one load .tmx files from Tiled into a SFML game?
1
vote
0answers
15 views

Unity Trail for Eyes 2D

i want to make some kind of an Eye Tail effect for this charakter: I found the Unity Trail Renderer effect but the start of the Trial is perpendicular to the dragged/moved direction: Can i make ...
-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
vote
1answer
195 views

Cocos2d Sprite 3D position

When I set a position3D for a Sprite in cocos2dx, it render two times the same sprite, i took a screenshot: I set the position3D because i want to use the Z position the give an effect of distance, ...
3
votes
1answer
130 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 ...
3
votes
1answer
42 views

place sprites in grid pattern within an area

I have been trying to do this for a few hours in unity now but cant get my head around it. basically i have 4 points(vector3) 1 each for the 4 corners topleft, topright, bottomleft, bottomright. now i ...