Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [2d]

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

0
votes
0answers
9 views

Spawning player at a certain point after a new scene was loaded

I have a Game Manager with a DontDestroyOnLoad function on it, before loading a scene I'm passing the variables needed to reset players position to a certain position. This is what my code looks like; ...
2
votes
1answer
155 views

Workflow for authoring hitbox data for a 2D fighting/platformer game

I understand that collisions in fighting games are detected using hitboxes and hurtboxes associated with specific frames of the animation I am looking for techniques to author the data for these ...
1
vote
1answer
48 views

Math needed to create a very simple 2D side view car game

I'm trying to create a 2D side view car game (something like Hill Climb Racing, but much more simpler), but I'm confused on the math and physics. Most of the tutorials I found were about making a top-...
0
votes
0answers
22 views

3d characters on 2d background game suggestions [on hold]

First off, I am wanting to get back into making games, I have made a few for personal use in gamemaker but never finished them as school always got in the way or they would get deleted when my ...
0
votes
0answers
21 views

What are pixel-based path finding algorithms? (path doesn't need to be shortest)

I have a canvas of size of approximately 1000x1000 pixels. I also have a matrix that represents that canvas and returns -1 if that 'pixel' is walk-able. I need to find a path between one of my objects ...
1
vote
1answer
37 views

How to stop my cube collider when it hits another collider using Transform.Translate?

As we know, Transform.Translate() ignores collisions. What functionality do I need to add to my code so that when my collider hits something, the physics system ...
0
votes
0answers
12 views

How to move cube touch position and when hit my collider then stop my cube using raycast? [duplicate]

cube will be move but when hit my collider not stop my cube,used in program raycasting Code: public class MoveCube : MonoBehaviour { float speed = 0.5f; public Animator anim; ...
0
votes
0answers
23 views

Unity2D TileMap Collider Update Optimization

I'm currently working on a 2D tile-based side-scroller (similar to Terraria). I am using Unity's TileMap feature to draw tiles onto the screen and have my player collide with them as if they were ...
1
vote
0answers
90 views

Modern OpenGL, 2D only, should I be using uniforms or VBOs for sprite transformation?

I'm new to OpenGL, I'm currently building a 2D game engine. Right now I'm only using one shader as I only draw textured quads (basically sprites). The thing is... I don't know if should I be using ...
0
votes
2answers
65 views

How to make a character that moves like a slinky?

I have a school assignment to make a 2D platformer game, with a character that moves like a slinky: (Animated example from the assignment linked above) At first, the character needs to grow in ...
1
vote
2answers
23 views

Unity 2D rigging parts order

Hello I have some 2d character in sprite I've rigged to use in Unity 2D.Something like this, with separate body parts. Although I've used weights and geometry, these body parts are supposed to move ...
0
votes
0answers
46 views

Algorithm for Circle with fixed radius to cover most points

I'm in need of an algorithm to find the best spot for a circle with a fixed radius r to cover as many points as possible on a 2D grid, preferably O(n). Currently I tried 2 different approaches: The ...
7
votes
3answers
3k views

How to move the player while also allowing forces to affect it

For now, that's how I move the player: rb.velocity = Vector2.right * input.x; And I affect him a force while he is damaged by an entity: ...
1
vote
1answer
10 views

How can I use pan gestures to zoom a camera in and out

I have the following scene tree for my player: They have a Camera2D as a child, which has a script attached to it. How can I make the camera zoom in and out as I ...
0
votes
0answers
18 views

On Unity how do I play an animation on drag direction?

I am trying to make an animation start when I Drag the mouse inside a picture and move it it left and down. while dragging the mouse pulling the nose down and left. I am not sure how to go about this ...
0
votes
2answers
53 views

Player fly's off of canvas when key pressed

I am fairly new to game development. I am programming a basic JavaScript canvas game. Whenever I press a key my player goes flying off of the canvas. Here is the controller code ...
1
vote
1answer
28 views

Is there a tried-and-true method for calculating or detecting the edges of platforms?

In terms of a simple 2D platformer, I was wondering if, over the years, a right way has emerged as far as determining whether or not a strolling character has reached the edge of the platform it is ...
0
votes
0answers
121 views

Why are pyglet.image and texture so heavy?

Envrionment: python: 3.6.6 pyglet: 1.3.2 Here is my code and results: ...
1
vote
1answer
49 views

Is Rigidbody needed and what move function to use in 2D games?

I don't really fully understand how to use rigidbody and which movement functions in a 2D game. There seems to be so many options and it's just a mess in my head right now. If I'm making a game like ...
1
vote
1answer
54 views

Loop around a 2D Tile Map

I have made an algorithm for procedurally generating a 2D tile map in Unity. The player can use the mouse to pan the view and look at the map. My intention was that when the player reaches one of ...
1
vote
0answers
40 views

Random lines drawn on screen while all vertexes are correct

I'm writing a 2D program in which a monocycle follows a Catmull-Rom spline. My problem is when I write the circle, the drawing goes crazy. There is one line on the screenshot (which seems to be 3 when ...
0
votes
1answer
52 views

Pixel Perfect 2D tiles

I'm trying to make an 64x64 tilemap using Super Tilemap Editor & Unity but my tiles looks terrible. I did my research about pixel perfect 2D and all of the solutions were for pixel art, they didn'...
0
votes
0answers
14 views

DragonBones mesh gets light by the wrong side

So, I use DragonBones to get skeletal-animation in my Unity 2d game. The problem is that object is affected by light only from the back, while other objects(sprites, while the first one is mesh) from ...
0
votes
1answer
37 views

How can I show tilemap coordinates in-game in Unity?

I have a game that uses a tile map, and I'd like to draw numbers representing positions on the tile map while playing the game. This would, for example, let me easily write down a note that I want to ...
0
votes
2answers
118 views

How to generate a random path on a 2d Grid

I want to create a random path in a 2d grid given a start point at the bottom row and an end point at the top of the row. I do not want the shortest path, or even the longest. Instead, I want a random ...
0
votes
2answers
44 views

Sending a shot left/right/up/down based on directional key press

I am trying to make a top-down shooter game with similar combat to the Binding of Isaac: when I press the up key the shot goes up when I press the right key the shot goes to the right I have all ...
0
votes
0answers
96 views

AI movement in a tile based game

I've been tryin to make My AI follow my A* path in grid. the problem is that is goes off course and doesn't move along the path very well. currently got it to move only left and up. how I intended ...
0
votes
1answer
53 views

Show Sprites on Overlap (Shader Graph) [2D]

I have a character sprite mesh and mesh renderer (The black wavy box). I am hoping to be able to overlay the black box onto the character covering the sprites but I am not sure how to do that. I ...
1
vote
1answer
33 views

2D Circular Distribution Overlap

I'm working with the C# wrapper for SDL and am stumped at how to handle this issue. Right now I have a simple Actor that spawns N number of bullets from himself and fires them circularly outward. The ...
0
votes
1answer
62 views

How can I rotate my character so that he is facing the mouse?

I just want to preface this by saying I am very new to pygame. At the moment I have calculated the angle that I need to apply to my character so he can rotate but I am unsure how to actually make ...
1
vote
0answers
53 views

2D isometric pixel art technique

I recently started to work on a project which consists in developing a game similar to the Urbz on Gameboy Advance (the Handheld version of the game developed by Griptonite Games). This is mainly a ...
1
vote
0answers
22 views

Incorrect draw order with LineRenderer

I have a Player game object with a sprite renderer and a line renderer. The sprite for its body and the line for a rope. The problem is that the rope isn't visible (I can see it's drawn in the scene ...
0
votes
0answers
31 views

2D AABB Swept Collision Algorithm Premature Collision

I've been following this pseudo code for my implementation of 2D AABB Swept Collision: ...
1
vote
1answer
39 views

Defining a projectiles speed and angle before Instantiating

I have a 360 degrees shooter object and a projectile to shoot. My projectile has a Rigidbody2D with zero gravity scale. I want it to bounce off of colliders when it gets hit, but when I instantiate it ...
0
votes
1answer
43 views

Isometric coords to cartesian coords

I'm new to the tilemap feature of Unity, and I'm having a hard time with all those coords. I created a new project, added an isometric tilemap and left all values to their default. In the Unity ...
1
vote
0answers
24 views

Scene for Computer Screen

We are developing a scene that will involve heavily interacting with a "touch screen monitor" in the scene.. Because the workflow of the touch screen will need to be dynamic we are creating a REST API ...
0
votes
2answers
43 views

How to limit speed while still adding external forces

I have a ship with a single thruster in space (no friction). My ship uses integration on every update, like this: (PSEUDO CODE) ...
0
votes
1answer
42 views

Handedness of 2D coordinate systems

I know that there's always a big debate on the handedness of 3D coordinate systems, but I can't seem to find any information about the handedness of 2D coordinate systems. Usually, the X axis points ...
1
vote
1answer
58 views

Rigidbody & Ray alternative or optimization

I am creating an AI that moves around to certain points, but should interact with ais or objects seen. The ai should find other ai to comunicate or look for objects on the ground. It works with all ...
0
votes
1answer
27 views

Procedurally create a polygonal shape filled with texture in unity 2d

I want to procedurally create a polygonal shape filled with texture in unity 2d (no 3d meshes). Something that looks like this: https://www.conceptdraw.com/How-To-Guide/picture/landscape-plan/Building-...
2
votes
1answer
72 views

Calculate a random position inside a 2D area excluding a subset

Given this area - - - - - X X - - X X - - - - - I have a GameObject size 4x4 and inside another GameObject size 2x2. I know how to calculate a random position ...
0
votes
1answer
55 views

Controlling a thrustered 2D space ship with angular rotation and max speed

In my game I have a computer controlled ship that is accelerated by a thruster: with a constant force and in the direction of the ship's current orientation/rotation angle. Thrusting My ship has a ...
0
votes
0answers
19 views

Why is my Tile Map is not uploading to the pallete?

The tile atlas I made sliced and separated into different sprites. I opened the tile pallete window and created a new pallete. I dragged in the sliced tile atlas into the place where it said (drag ...
1
vote
1answer
51 views

Unity tilemap collider not colliding with rigidbody

In the wireframe you can see the tilemap collider for this hill. The red circle falls right through however. The circle has a 2D rigidbody attached. Everything is on the Default sorting layer and on ...
0
votes
0answers
83 views

Phaser 3: How to assign sprite to proper position

I have been building a game in Phaser 3. When I create a sprite using the Matter physics engine at a specific position, the sprite does not appear at the specified position. Depending on the ...
0
votes
1answer
74 views

2d Rectangle Collision Resolution: Find rollback point

I have a 2-part question: 1: I have 2 rectangles, A and B. B is a wall and A is moving. My simple logic here is every time A moves, it moves based on some (x,y) offset and then checks if it collided ...
0
votes
0answers
54 views

Adding 2D versions of real cars in a game can be a legal issue? [duplicate]

I've been thinking in doing a car game, but i wanted to add "real" cars into the game. Are 2D renditions of the cars with sprites/vector 2d graphics fine?
1
vote
0answers
51 views

Is there an established way to create a 2D XY NavMesh in Unity?

Specifically, one in the empty space between colliders, rather than on an XZ plane (more or less) over the surface of a collider? Specifically this is because I have a drone, in a current project, ...