Questions tagged [2d]

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

Filter by
Sorted by
Tagged with
0
votes
2answers
62 views

Converting from global coordinates to local coordinates

I am trying to create a Radar/Minimap for the F1 2021 game in C#/WPF. Here is a image of what I am trying to replicate In the image, the white car (my car) will always face the direction it is going. ...
0
votes
0answers
9 views

Need help with locking the Y axis on camera

I am working on a small 2D platformer in Unity for my school project and I would like to lock my camera on Y axis (so it can move horizontally, but when the character jumps it doesn't follow the jump)....
1
vote
2answers
818 views

RaycastHit2D.normal sometimes giving an unexpected direction

I'm working on a little pong clone and trying to implement collisions using triggers. I have a ball which OnTriggerEnter sends out a raycast from the ball's position towards its velocity. I then take ...
0
votes
1answer
275 views

How can I set up a 3D camera for a top-down game like Enter the Gungeon?

DodgeRollGames, the developers of Enter the Gungeon, tweeted that the game was in fact made in 3D They tried to explain how they set their camera in this reddit post. Basically what they said was : ...
0
votes
0answers
17 views

Why is my blender 2D ring so pixelated when imported into Unity?

I created a simple ring in blender, yet when I import it into Unity it is horribly pixelated and choppy looking. I want the ring to look perfectly smooth. In blender, I selected the "shade ...
0
votes
2answers
730 views

How can i properly display 2D Pixel sprite's pixels without distortion while it's moving ? (in unity)

Introduction to what i'm trying to do Hi, I'm trying to make a 2D Pixel Platformer Game in Unity. Before that i used godot and for some reasons (not about the engine) i switched to unity. And in ...
0
votes
0answers
49 views

How can I force my Navmesh agent to only move four directions? (for 2D)

I'm making a 2D game in Unity. For 2D I am using the NavmeshSurface2D-plus master package available on github. My enemy object is chasing my main character nicely, it's ok. I set my main character to ...
0
votes
0answers
23 views

Is a platform an entity in 2D Platform in ECS pattern?

I've been coding a small 2D platformer applying ECS pattern. However, I'm struggling with a issue. When building each platform from tilemap and such platforms need to be collided by other entities, ...
0
votes
1answer
172 views

2D engine design/architecture: transformations

Hello! I'm working on this hobby little 2D engine in JavaScript because I want to learn how all this things are implemented and architectured in general. Internet is full of resources but most things ...
1
vote
1answer
188 views

How do you exactly implement a Semi-Implicit Euler type of movement in a 2D platformer?

So I've been following along Sebastian Lague's 2D platformer tutorial, and to understand exactly how the physics of how a jump is done, I dug into the subject and noticed a lot of people, from ...
1
vote
3answers
77 views

Unity2D Grid-based Sprite Movement and Tilemap Collision

I have just started working with Unity2D to simply learn how it works. I've been trying to get grid-based movement and collision with a tilemap working, and it's mostly there, but there's one bit that'...
0
votes
1answer
33 views

How can I update the Navmesh path in 2D games?

There are destructible and indestructible objects on the map I created with Tilemap, and I create a walkable area (bake) for my enemy object using the information I found on the internet and the ...
0
votes
1answer
70 views

High CPU usage with Godot tilemap

I am using Godot as my game engine and I am making a basic 2D game, I have a small map with 1 Player and 5 Enemies walking around in it. The game includes some basic code for walking and shooting at ...
3
votes
2answers
691 views

Efficient 2D grid overlay on tiles without each cell being its own GameObject

So for my game I need the ability to add a grid overlay over my tilemap. Now I don't think that making the grid with each cell being its own GameObject with some SpriteRenderer would be hard to do but ...
1
vote
1answer
203 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
1answer
258 views

How do I detect if my object is grounded?

I am trying to detect when an object is grounded. My script right now is: ...
1
vote
0answers
53 views

Odd behaviour from parallax

First of all I'm going to say that I'm not trying to blow my own trumpet or anything but usually I'm able to figure this stuff out on my own. But as for now I'm fully stumped. Maybe I'm having a mind ...
0
votes
1answer
39 views

Rotating player around planet causes drift in gun aiming at mouse

I have a bug with the rotation of a gun object that follows the mouse position. It has issues when the parent object player rotates. Example: The player has a gravity script to keep them aligned with ...
2
votes
1answer
130 views

Rendering colors from a texcoord output

I'm trying to implement a faster alternative to super-sampling for my isometric 2d monogame game (for when the view is zoomed out). The idea was that I would render the texture coordinates to the ...
0
votes
1answer
26 views

When pressing both the key then releasing any1 key then the anination is not played

i give the running animation to the character and created a flip script...when press A then player move and flip to leff and animation is played ....when press D then player move and flip to write and ...
0
votes
1answer
31 views

Moving object with preset timelapse

I am a newbie game developer. I have one problem. Consider the following case. I have a simple game with only one object - a ball. A ball can move only up and down from one side to another. A User ...
0
votes
0answers
13 views

ACharacter falls instead of landing back at its starting point when jumping at the edge of a ledge

I’m using ACharacter class for a 2D platformer game in Unreal 4.26. When the pawn (the main character) starts to jump from a the very edge of a ledge, it’s not able to land in the same position. ...
0
votes
2answers
2k views

How do I incorporate .tmx files into my game?

Ok, so I have made a .tmx file for my first level, but I am unsure how I would load it into my game. Currently I am iterating through an internal array to set the blocks, but I need to know how to ...
0
votes
0answers
16 views

More smaller scripts or less larger in Unity 2d Development? Better or worse performance? [duplicate]

In my unity 2d game I had large amount of scripts which were components of different enemies and obstacles. All of them were checking for collison, had FixedUpdate, Start and OnCollisionEnter2D and ...
0
votes
2answers
245 views

Unity - 2D Platformer Controller responsiveness issue

I've been designing some basic controls for a 2D platformer and managed to get the feeling that I've been looking for when moving and jumping, but something is not quite right, it's not very ...
51
votes
7answers
10k views

2D Platformer AABB collision problems

I have a problem with AABB collision resolution. I resolve AABB intersection by resolving the X axis first, then the Y axis. This is done to prevent this bug: http://i.stack.imgur.com/NLg4j.png The ...
0
votes
2answers
41 views

How to make windows that pick up what appears in the other

Basically there are 2 windows that you can drag and drop around the screen. Whatever appears in one window will also appear in the other. The two windows cannot go one over the other. This is a demo ...
2
votes
2answers
5k 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 ...
7
votes
2answers
562 views

Shrink a convex polygon

Shrinking a concave polygon is quite hard, to do well. But I expect shrinking a convex polygon would be easy. The naive approach of moving each vertex a certain distance to the centre gives me poor ...
0
votes
2answers
86 views

How to move one Game unit with every key press?

I have a tile board set up with 500 x 500 pixels = 1 unit. I have code that will move the object over time. ...
0
votes
1answer
135 views

In a top down game, once I have detected collision, how do I prevent it?

I'm making a top-down game in Java. I watched some videos, and this is the code I currently use when the player is colliding with an object: x += -velX y += -velY ...
0
votes
1answer
63 views

Experiencing strange behavior in Unity when rotating a 2D GameObject according to the slope it is standing on

I am trying to rotate a square GameObject, so it appears to be standing perpendicular to the slope underneath it. However, when above a slope, the square constantly "spins"; it seems like ...
3
votes
1answer
2k views

How can I move a vehicle using speed and steering angle?

I want to drive a vehicle in x and y coordinate area with range from (0,0) to (6000,5000). I am using Visual Components (using Python API). On input I have speed data and steering angle of wheels ...
1
vote
1answer
88 views

2D shadow from polar coordinates has hard cut-off at a certain radius

I'm trying to cast shadows from a 1D texture that goes from white to back according to the distance given by an occlusion map. That part I think I got it right. The problem lies on the algorithm to ...
1
vote
1answer
202 views

How to add lighting to a 2D Tile-based game in JavaFX?

I'm making a 2D roguelike tile-based game with Java and JavaFX. I'm currently working on adding lighting and darkness to the dungeon, but whenever I try running it, it takes a very long time to load, ...
0
votes
1answer
117 views

Unity Springjoint2d - how to put collider between anchors?

I want gameobjects to bounce off a line between 2 springjoint points. I placed boxcollider2d (with small Y scale) or edgecollider2d between two Joint points and every frame put it in right place, set ...
1
vote
2answers
581 views

Java - Collision detection (Glitch)

I am working on a platformer game for the final year project in HS. However... The collision detection system I use is basically about checking wether a specific part of the character intersects with ...
0
votes
1answer
385 views

I have a problem rotating a 2D game object after collision

I'm developing a simple flip game where a cube flips and the bar a it collides with should start rotating after collision. Most snips involve destroying an object, but that's not my case. Here is my ...
3
votes
1answer
961 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 ...
0
votes
1answer
68 views

What would be a fast way of detecting collision between 2 2d rotated rectangles?

Currently I am following this tutorial here for 2D collision detection: http://www.gamedev.net/page/resources/_/technical/game-programming/2d-rotated-rectangle-collision-r2604 I have found that the ...
0
votes
1answer
3k views

Collision Player and Tilemap Unity

i am a student in austria. I am working on a project for school, where we have to make our own first game with unity. Because it is the first time using unity, i constantly run against problems. Most ...
3
votes
2answers
1k views

Improving bouncing logic - Atari breakout clone

I'm creating an Arkanoid clone using Haxe and Openfl. I'm thinking the bouncing algorithms could be improved. But I'm not sure how to handle those. I was hoping you guys could help. ...
0
votes
1answer
129 views

Handling different aspect ratios on a 2D dodging game

I've been making a game where the player is on the ground and has to dodge objects falling to the ground. Since I'm using libGDX (But the question still applies to any other language/framework), The ...
0
votes
2answers
325 views

Game movement in 2D SFML game

I am making simple 2D game, imagine it as 2D Minecraft where you can dig blocks and build other things. Currently I am struggling with movement. I have none experience in game development, but I am ...
1
vote
1answer
172 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 ...
33
votes
4answers
5k views

Why does my object move faster at 45° than at 90°?

I have objects in my game that move faster at 45 degrees then at 90 degrees. Each object has: Point (x,y) position Vector2D (x,y) direction Int speed And what I do during an update, is that a new ...
1
vote
1answer
669 views

Shooting Projectiles

I am using cocos2D-x and am trying to achieve the effect of enemies going past and shooting projectiles at the player who is moving around the screen. I am using the code below, which is based on this ...
0
votes
0answers
37 views

Optimal data structure for managing AABBs to minimize collision check queries

Say I have thousands of 2D Axis-Aligned Bounding Boxes (AABBs), and a single point. I'm checking whether a point is inside a certain AABB before performing some expensive logic. ...
2
votes
2answers
1k views

Unity 2D ROPE connected to moving platform

Hey guys I have realy big problem with my rope. I use a hinge joints 2D to create my rope and distance joint to connect it with moving platform. On moving platform I have a distance joint that show ...

1
2 3 4 5
66