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

learn more… | top users | synonyms

1
vote
0answers
48 views

convert 2d pt into non-affine coordinate system

Say I have a coordinate system that goes from (0,0) to (1,1). We'll call this screen_space. Within this coordinate system, I have 4 points that I would like to define another coordinate system. One ...
0
votes
1answer
45 views

Can't move character at all in unity basic platformer guide

so, I followed below tutorial. https://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/creating-a-basic-platformer-game Going well until 18:50 (video time in tutorial), when the ...
0
votes
1answer
38 views

How to correctly draw a 2D polygon in Unity

I'm trying to draw a 2D polygon using GL.Line; however I'm not getting a polygon but separated lines instead. In the example below, I would expect a rectangle formed by the spheres: My code is the ...
0
votes
0answers
14 views

How to make multiple characters with similar design [duplicate]

I am making a 2d platformer RPG game and I would like to create a character creation system that allows you to create your character as you please in the beginning. Since I want at least 10 different ...
0
votes
1answer
29 views

Is it possible in Unity to Flip a 2D Sprite Without Flipping the Object it is Assigned to?

I 'built' (followed a tutorial) on a collision detection system, and when I flip the object to go left and right the collision messes up. So I have three options; find a way to modify the collision ...
6
votes
2answers
548 views

A* pathfinding for dynamic obstacles and player made blockages?

Hi I'm creating a TD in Unity 5 and need some help with my Pathfinding. I'm going to use Arons A* pathfinding for my AI which enables me to use dynamic objects and update the path during run-time. ...
0
votes
1answer
30 views

Rotating A 2D Cannon Based On Mouse Position [duplicate]

I'm creating a game like bubble shooter, I have a cannon which is in the image bellow: I want to rotate the cannon based on mouse position. So far I tried various solutions I found over the web but ...
2
votes
2answers
28 views

How to instantiate a sprite from a sprite sheet using script in unity?

We are creating a 2D top down rpg, and we have multiple textures, and we need to be able to change which sprite sheet its reading from in order to change the look of the walls and floor in each room. ...
1
vote
1answer
51 views

2D grid based game merging boxes

Basically what i have at the moment is a tile based game with a grid containing a number of colored cells. this is what i've done so far The prinipal idea of the game is that the user has to ...
0
votes
1answer
24 views

Unity2D Sprite gone / not visible when flipped using Vector3.x

I have create game object with code using UnityEngine; using System.Collections; public class CharacterBehaviour : MonoBehaviour { private bool facingRight = true; private float moveDirection = 0; ...
0
votes
1answer
84 views

How does orbital math work?

I'm writing a 2d space game, and I want the players to be able to 'orbit' objects and other players (if they're fast enough, of course), but I'm having trouble coming up with the right way to think ...
0
votes
0answers
30 views

Faking Perspective/Depth using 3D images converted to 2D sprites - Can't work it out!

after a lot of searching/reading/viewing old school game videos I am still unable to work out how to achieve the effect I am after. I am currently working on a 2D "overhead view" sci-fi RPG, using a ...
0
votes
0answers
30 views

2D sprite making tool for huge project?

I recently bought spriter 2D but it was a disaster, it is not a finished product at all and i encountered so many bugs and crashes with it, so please don't suggest it. I am looking for a 2D sprite ...
0
votes
1answer
72 views

How to create 2D shadows and lightning?

How do I create shadows and lights in a 2D top down perspective game? I want to achieve an effect similar to this game (also made in unity) where some objects like a torch, different sprites and the ...
0
votes
2answers
90 views

2D Coordinate Based Game [duplicate]

I want to make a game for Android that has a 10x10 Grid Plane as UI.In this game users going to touch on a grid and tihs grid will be painted. My question is how do I understand which gird or tile ...
0
votes
1answer
32 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 = ...
5
votes
1answer
397 views

Why do my game objects jitter when moving the camera?

I'm moving from Qt Widgets' QGraphicsScene to Qt Quick's QQuickItem for rendering my game objects. One of the things this involves is setting up a scene and the view onto that scene, as this was ...
1
vote
1answer
69 views

Find alternate shortest paths in Unity

I'm developing a game in Unity. It's a simple game where the rocket has to reach the point where the player touches on the screen. The movement of the rocket is physics based. When the rocket goes off ...
0
votes
1answer
35 views

Unity tiles with wierd border flickering when moving horizontal 2D

I recently made some Tiles using a program called Pyxel Edit to create some placeholder graphics. The problem I'm having is that when I move the camera horizontal the edge of the tiles starts to ...
0
votes
1answer
18 views

How to check if an GameObject exists in Unity2D? (Javascript)

Im making an AI that checks if the player exists or not. How do I check if a certain object exists and put it in a boolean variable?
0
votes
1answer
82 views

Pathing for 2D, sprite-based game

I'm making a 2D, oblique-styled sprite based RPG. My game does not live in a 2D matrix (like Tetris), rather it's sprites animating over a tilemap. I am trying to set pathing rules for NPCs. I've ...
1
vote
2answers
34 views

Proper way to handle Movement/Animation/AI functions of an AI character in Unity3D

My team is currently building a 2D game in Unity and we've run into some workflow/script organization blockades for many of our game's characters. For example, we're not sure what the standard method ...
0
votes
1answer
20 views

Unity: “Find” can only be called from the main thread, but moving variables to the Start() function causes other errors

#pragma strict var collided = false; var thrust: float; var pizza = GameObject.Find("pizza-small").GetComponent.<Rigidbody2D>(); function Start() { } //hand + pizza ...
1
vote
2answers
30 views

On key press, spawn a collider where my player is facing?

I'm trying to create an attack mechanic to my player hero in my 2D Tower Defense game. When I press the Q button I want my hero to do an animation and spawn a temporary collider shaped as a cone at ...
0
votes
2answers
36 views

I need an object to move towards an moving object in Unity2D (javascript)

I am trying to make an AI that tries to move towards the player but I don't know how. I tried using Vector2.MoveTowards() but it just mimics my movements instead of moving towards the player. I tried ...
0
votes
1answer
35 views

How to get a Vector2 location of an object? (Unity2D javascript)

I need to make an "AI" that makes a ball try to touch the player. But Vector2.MoveTowards()needs a Vector2 variable but how do i get the location of an object?
0
votes
1answer
12 views

How to use rigitbody2d.AddTorque() in JavaScript? (unity2D)

I just want to know how to use rigitbody2d.AddTorque() and an example script would be great :D. I am trying to rotate a cube forever using it as a test.
0
votes
2answers
57 views

Generate static 2D Tilemap from array

How do I generate a 2D tile map from an array like in this tutorial for XNA ? I basicly want to generate a static map based on my tile prefabs.
0
votes
1answer
23 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 ...
0
votes
3answers
124 views

Pathfinding to find the route to nearest resource in 2D grid

The setting is a game in a 2D gridlike labyrinth/maze. I'm looking at pathfinding algorithms such as A* and Dijkstra. I can't figure out how to have my game characters find the nearest resources. All ...
1
vote
0answers
126 views

How should we begin to create our 2D Tower Defense? [closed]

Me and my friend are going to make a 2D Tower Defence game as our last assignment in highschool that has to be finished april/june next year. We both know a handy bit of Java and C# but our game is ...
1
vote
1answer
94 views

JS Canvas - Creating 2D Game lighting effect like Terraria

I just started working with canvas in HTML5 and with javascript. I'm pretty satisfied with my game so far: http://xenopal.dk/game-v1.1/. But I'd like to implement lighting as well in the style of ...
8
votes
0answers
128 views

How can I implement lights & shadows in a multi-layer 2d tilemap?

I am in the process of writing an isometric game from scratch, and I'd like to know how/if I can add lights and shadows. The code I have so far can be found here, but it should be enough to know that ...
2
votes
1answer
27 views

Libgdx how to add popup interaction

I am looking for someone to point me in the right direction. I am working in libgdx. I have a game where a player will approach an object on a map and then interact with it. On interaction a new ...
0
votes
0answers
13 views

How to change colors where two boxcollider2d objects intersect (Unity 5 2D)

I'm creating a 2D game in Unity that relies on combining colors. For instance, if the yellow sprite in in a position, and the player slides a magenta sprite partly over it, the area where the two ...
0
votes
1answer
8 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 ...
1
vote
1answer
81 views

How to implement angled surface?

I'am trying to implement 2D platformer game inspired by N game. But the problem is I have no idea how to implement something like this: I have two ideas of how this could be implemented but i ...
4
votes
1answer
217 views

How To Program a fully controllable spring (Damped) motion

i'm working on a project that needs realistic 2D Animation, none linear motion you might say, i have tried many things such as Hermite Curve and a few other motions and in the end Spring Motion. ...
0
votes
1answer
86 views

XNA 2D rotation Matrix offset/origin

I'm currently struggling with finding the offset for my original camera translation after I have applied a rotation for it. transform = Matrix.CreateScale(new Vector3(1, 0.75f, 1)) ...
0
votes
2answers
79 views

Amount of Data Calculated in a Game [closed]

So... I am theorizing the development of a 2d living persistent fullsized world with simulated ecossystem, etc..., and many, many objects, but how can I handle the giant amount of data that will be ...
2
votes
1answer
151 views

Creating Fog Of View in 2D game with lighting method

I'm creating 2D side scrolling game with Unity, and i want to add feature where the player come into a cave, then all going dark, the player turn on the flash light, so the player can see around ( ...
7
votes
2answers
195 views

Spaceship Shield Flare

I'm trying to implement a system whereby a "shield flare" will be shown whenever a projectile impacts the shield. The shield itself is one like in Star Wars, where it's more like a skin around the ...
1
vote
3answers
170 views

2D Rendering Based On Y Coordinates

I'm trying to build an RPG worldbuilder. I have seperate classes for images. Like this. Object1::Object1(int x, int y, CSDL_Setup *sdl_set, int *p_CamX, int *p_CamY) { X_pos = x; Y_pos = y; ...
1
vote
3answers
74 views

Collision Detection/Response Issues in Unity

Sprite A: Box Collider 2D and Rigidbody 2D. Sprite B: Box Collider 2D. Both sprites have a Sprites/Default material with Pixel Snap enabled. The textures being used are set to Truecolor Format and ...
3
votes
1answer
99 views

Calculation correct position of object after collision (2d)

I have a circle, that bounces of walls. The circle is traveling at the speed defined by px/s for x and y. I have collision detection implemented and I use vectors to calculate the new x/y speed (and ...
0
votes
3answers
65 views

2D Physics friction on a moving platform?

I have a few basic platforming mechanics going on in this scene. I have a prefab platform with an animation that loops back and forth between two different x positions, but does not begin looping ...
2
votes
1answer
39 views

Why are my Hello World Box2D project's collisions off by twice the size of my boxes?

I've been implementing Box2D into my engine but have run into a snag. I decided to rebuild the helloworld project inside of my own engine (it is almost identical), of which I will snip here in a ...
-1
votes
1answer
93 views

How to make smooth 2-d zooming in Processing

I am making a 2d game with camera zooming using Processing. Currently, my program reduces the size of each block by one. This works very well when there are only a few blocks on-screen, but not when ...
1
vote
2answers
33 views

DDS files with DirectX Tk, Some work, some don't

I am learning DirectX with the DirectX Tool Kit library and everything seems to be going smoothly but I have run in to a tiny little hiccup. I am currently trying to load DDS textures from file ...
1
vote
1answer
75 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 ...