Questions tagged [2d]

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

Filter by
Sorted by
Tagged with
4
votes
1answer
908 views

Invert the colour of pixels where 1 bit sprites are overlapping

I have a simple scene in Unity that makes use of some simple art that uses either white or transparent colours to create a 1-bit art design. The image below shows this. I want to have a that if two ...
1
vote
0answers
15 views

Libgdx tiles get overlapped on render

I'm trying to create a Tilemap with 64x64 textures which follows this configuration. ...
1
vote
1answer
140 views

Godot distance between 3d and 2d nodes

Godot has the distance_to methods for Vector3 and Vector2 but what would be the best way to ...
0
votes
0answers
23 views

how would i make a sprite go in front and behind a 2d wall? [duplicate]

I've tried a few solutions but none seem to work. first, I tried adding half of that same sprite onto the original and then making the layer higher, which would work, except my original sprite can ...
0
votes
0answers
31 views

How to make the enemy only start pathfinding when player is within certian distance [duplicate]

Im using A* pathfinding and unity 2d. Also im very new and dont really know how to code well so if you can tell me the code it would be much appreciated. I figured out how to use A* but i dont want ...
0
votes
0answers
24 views

Can inserting/removing one point in a quadtree or octree cause multiple splits/collapses?

I was reading Robert Nystrom's Game Programming Patterns website and, in the section about spatial partitioning, particularly in the section on quadtrees, he mentions: Objects can be added ...
0
votes
0answers
9 views

2D Polygon Line Clipping

So I need to clip polygons against polygons where one of it is behind the other. But just drawing it is for my desired hardware just too slow. My polygons only have four lines so what can I do?
0
votes
1answer
28 views

Make platformer character stay in the air at the top of a jump

I have a player who can jump. I want the character to stay in its position and not fall to the floor. This is the code I am using so far: ...
0
votes
1answer
464 views

Stop 2D platformer character from sliding down slope

I'm making a 2D platformer game with the default Unity 2D physics. I am implementing slopes, but my player slips down the slope because of the physics. Here is the code I use for the player movement: ...
0
votes
1answer
48 views

Scrolling the map in a 2D a tiled game

I am making a small game where I store information about the world around the player (like tiles) using a small 2d array of integers. In the game you can scroll the screen to the left or right. I also ...
0
votes
2answers
59 views

Placing a circle as close as possible to a specific coordinate without overlapping another circle

I am working on a 2D game in Java. My goal is to place a ball as close as possible to the center without overlapping the balls that are already there. How can this be done?
0
votes
2answers
76 views

Rigidbody not working properly

I have two objects: a player and a wall. The player is passing through the long side of the wall but it collided with the short side of the wall. I want the player to collide with whole wall. Here is ...
6
votes
2answers
228 views

Networking a fast-paced game (2D) - Forced Movement - Server / Client

I started a new project, a fast-paced online game (some sort of 2D MOBA). I encountered a problem with the part of netcode about client prediction & server reconciliation. Game Mechanics: 2D - ...
1
vote
1answer
158 views

Move 2D Rotating object in its facing direction

I have a 2D object that constantly moving forward (in the direction its facing). So initially its facing right, and moving right, but as the rotation z-axis changes, so should its direction. Most of ...
0
votes
0answers
74 views

Isometric tilemaps character sort problem

I've been trying to make a little isometric game where the character moves freely through tiles. I made the camera option custom axis and changed x=0, y=1, z=0 The problem I run into is that the ...
0
votes
0answers
35 views

Why does 'SpriteRenderer.drawMode' virtually change from Tiled to Simple when 'SpriteRenderer.size' exceeds some value?

Given: texture size = 225x225 2D sprite object; SpriteRenderer.drawMode = SpriteDrawMode.Tiled; Now if SpriteRenderer.size is changed to 286x286 the sprite is ...
0
votes
0answers
42 views

How would I implement a level transition when reaching a cave in Raylib?

I am the developer of an upcoming 2d/3dRPG. I have a simple scene setup where there is a bridge over some acid and a cave entrance-like thing that I want to change the level with. I have used C and C++...
0
votes
1answer
84 views

Identify when Unity Button Enters Pressed State

I am trying to create a UI Button Prefab with a text child element that I would like to use all over my application. Its intended behavior is very simple: Its size would be dependent on the text's ...
0
votes
1answer
66 views

How to rotate multi-tile structure on grid?

I need to be able to place structures in my game that span multiple tiles and can also be rotated. My idea on how to solve this would be to use 2D arrays that hold data about the structure. EXAMPLE: (...
0
votes
0answers
69 views

Unity Pixel Perfect Camera - Adjusting the Viewport Rect?

I am trying to make a pixel perfect Tetris style game. I have the pixel perfect component attached and have tried playing with settings such as Crop Frame and Stretch Fill. It seems to override any ...
1
vote
1answer
264 views

Help me Make Sense of Unity 2D Resolution Management

I am trying to set up an environment for a retro style pixel art game in Unity 2D. I aim for a vertical resolution of 240 pixels, and then, I would like the horizontal resolution to be dependent on ...
2
votes
2answers
3k views

Unity 2D animated tiles library: IsSelected variable not working or not present within RuleTileEditor.cs

I have just tried downloading a library which will allow me to add animated tiles to unity. I have been following this tutorial:http://shadowpeakstudios.com/2018/10/22/unity-tutorial-animated-tiles/ ...
0
votes
1answer
53 views

What is the difference between libraries like C++/PDCurses and SFML?

I have read that PDCurses is a library that can be used to create 2D games however SFML is also a library but they are not in the same category I presume according to what I have read: "The ...
2
votes
1answer
151 views

What does Polygon2D's polygons property do?

Godot Polygon2D class has a polygons property of type Array. The documentation -at the time ...
0
votes
0answers
52 views

How to stop a decelarating object?

I am programming a 2D game. When a ball is launched it should decelerate and eventually come to a stop. I have implemented the deceleration part but when the ball nearly stops it starts accelerating. ...
1
vote
1answer
221 views

How to display the counter in pygame.time.set_timer?

in pygame, we use pygame.time.set_timer() to repeatedly create an event. This function takes 2 arguments : the event type and the delay time after which the event ...
0
votes
1answer
118 views

How to get light level (brightness) of a particular location?

I'm making a 2D top-down survival game similar to Rimworld, I'm trying to emulate a day-night system. Many features depend on whether any tile is light (or dark) ...
2
votes
2answers
320 views

How to implement pixel art lighting as in the game Project Eastward?

Project Eastward Lighting Demo Can somebody point me to the right direction as to how this lighting is done to recreate this lighting effect? The game is 2D but uses a 3D lighting system.
0
votes
1answer
45 views

How to properly overflow 2D coordinates on an overflowing/circular map?

I made a simple Snake game designed for trying Snake bots. I thought the base map functions work, but now I found there is an error. What I need is to properly translate any coordinates outside the ...
0
votes
0answers
31 views

Unity 2d overlapCircle melee combat issue

I have an issue with my overlapCircle melee combat in the game. I'm not good at such things, so I just copied that code from some YouTube tutorial. But the thing is ...
1
vote
1answer
40 views

How to decide which Area2D is behind?

How to make an Area2D drawn after another one only in certain situations? The boat + Area2D |_ AnimatedSprite The stone ...
0
votes
0answers
53 views

2D Isometric Movement - Move to Mouse Position

I'm developing a 2d isometric game on a engine made by myself (as a way to practice Java), however i'm stuck on what it seems to be a math problem. I wish I could have some help on how to implement a ...
0
votes
1answer
118 views

How to create 2D platformer maps without a game engine's editor?

I've been developing a 2D shooting platform videogame for the Sony PSP console using only the ONELua interpreter for the Lua programing language (since there is not any game engine for it). Despite ...
0
votes
2answers
33 views

How to handle player slowness while moving up and down in a Top Down game with angled ortho camera and angled sprite due to stretching of ground?

So i'm making a 2D top down game setup in 3D using tilted Sprites and angled orthographic camera. My camera setup is as shown. In my game I have the floor flat on the X/Z plane with walls/characters ...
0
votes
1answer
60 views

How to either draw a group of tiles completely behind or completely in front of a player?

Say you're rendering a 2D top-down tile map and there are some objects in the tile map that the player should be "in front" of when below them, and "behind" when on top of them. ...
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
23 views

Weird "jiggly"/"warping" effect on my tiles

I need help with a problem I'm having in Unity regarding a "jiggly"/"warping" effect. It is a strange effect which occurs when I move my sprite character and makes the tiles have ...
1
vote
1answer
67 views

How to best simulate the space in a boxing game to account for footwork and angles?

When trying to prototype a (top-down, so far) boxing simulation I've run into a huge roadblock with trying to set the space in which the boxers will fight, because it's important for the fighters' ...
0
votes
0answers
33 views

How to choose between 2D sprites versus 3D models for a 2D game? [duplicate]

I wanted to know how to decide between using 2D vs 3D models for games. What are the advantages/disadvantages of using 3D models versus 2D sprites in 2D games?
1
vote
1answer
29 views

Dynamic Sort order For walking in front and behind stuff

I'm using tile maps, and I'm having a difficult time with the concept of walking both in front of things, and behind things and having the layers sort order show properly. Take the image below, I need ...
-1
votes
1answer
61 views

If player is not holding the ladder then it should not jump twice

I am using Unity2d and I am stuck with a problem. I made the new layer for ground and ladder and added OverlapCircle and make double jump script for the player, so ...
0
votes
0answers
14 views

Make a child sprite match the layer ordering of its parent

I have my project settings set up to order the sprites' visual layering based on their y position. If I add a sword as a child to my character, the sword won't have the same order as the parent so ...
3
votes
1answer
106 views

8-way aiming in run 'n' gun

I am developing a 2D run 'n' gun game in Unity and am having an issue getting the aiming to "feel right". Some background: The player can aim in 6 directions when running (left, right, and ...
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: ...
0
votes
0answers
35 views

(Unity Engine) Is it possible to make 2d animation bones perfectly straight within the sprite editor

I am experimenting with pixel perfect camera and 2d animation. I noticed in the skinning editor that there is no option to edit bone coordinates. When I make an ik it extended the arm making it ...
0
votes
3answers
495 views

Sticking the Rigidbody2D player to a moving platform without parenting & transform fiddling

I have a player entity with Rigidbody2D component and I have a moving platform which is a kinematic Rigidbody2D. Player movement is done by setting it's velocity (...
0
votes
1answer
103 views

Make enemy move diagonally in 2D

I'm making the enemy follow the player only straight or diagonally e.g.(1,1)(1,0)(0,1)(-1,1). I expected the problem that I have, but I don't really know how to fix it. When my enemy is placed ...
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
73 views

High-performance update of a bitmap grid

I need to visualize a fast paced process in .NET in 2D. I am planning to use writeable bitmap 800x40px. The idea is like this - there are objects which are represented by very basic colours and sizes ...
1
vote
1answer
74 views

How should I setup my sprites for 2D combat?

I was painting pixel sprites of a goblin (the enemies in the game). I first thought of making sprites of it for each different scenario: facing camera, moving toward camera 1, moving toward camera 2, ...

1 2
3
4 5
66