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
0answers
16 views

How to make player walk through layers of 2d fog smoothly?

I'm trying to recreate the fog effect that Graveyard Keeper has, with several layers, so taller objects will get less fog. I'm using the approach described here: the devs post on Gamasutra The problem ...
0
votes
1answer
14 views

Unity Unable to blend 2D Light renderers

I've followed the documentation on Unity regarding 2D lighting. It said to turn on Alpha blending in the options. But this is how it turns out: If Alpha blending is off: If Alpha blending is on: I'm ...
0
votes
0answers
14 views

Unity 2D Player Shoots at my joystick position

Hi I am new to unity and have only a little coding knowledge. Right now I have made my character shoot at my touch position on mobile but when ever I touch the joystick, whick I use to move my ...
0
votes
0answers
12 views

Android - Canvas.drawBitmap gives an awful performance

I am using SurfaceView for my game and I am loading all of the bitmaps that are the right size for the screen (pre-scaled in mipmap folder) into a class when the game starts. And I am drawing the ...
0
votes
1answer
30 views

Rotating towards a target in top-down 2D game

I use the following code to rotate a transform towards another. And it's working fine. However, I want to lerp it over time period. ...
0
votes
1answer
47 views

Getting angle from current position and next position

I am using pathfinding to move a train along rails, but I need the train to rotate. I have the next intended position and the current position at my disposal, how would I go about this? Pseudocode ...
0
votes
1answer
21 views

Moving object parallel to another on path on 2d space

How to Move object parallel to another on curved path on 2d space
0
votes
0answers
13 views

Check bounds in 2d platformer level transition

I have asked How camera works in 2d platformer in level transitions about camera transitions, in the process I am stuck somewhere else. I have a targetRoom that is 32 by 32 tiles: ...
0
votes
1answer
32 views

How camera works in 2d platformer in level transitions

I want to know how Camera works in game of Celeste. Currently what I have is, camera follows the player using interpolation: ...
1
vote
2answers
130 views

How to transfer the player into a new scene, loaded in the background?

I'm porting an old BuidBox 2 game to the Godot game engine. I already added all assets and scenes to the Godot project. The game is a 2.5D (isometric) endless runner. What I want now is to add a ...
0
votes
1answer
17 views

Collision with supposedly aligned box-colliders

I am quite new to game development, and I am trying to create a top-down game with 2D sprites, but with a 3D feel to it. I managed to do so with the 2D engine by setting ...
0
votes
0answers
24 views

How to make a moving camera in 2d with p5.js

I am trying to make a hill climb racing clone. My code: https://editor.p5js.org/saathvik/sketches/-XOFPcukt When I move the car, I want the camera to follow the player, so he can't go off screen.
0
votes
0answers
19 views

Efficient method for Sprite Stacking in LibGDX

What would be a very efficient method for creating a suede 3D effect by stacking sprites much like the game like NIUM in LibGDX I find it easy to create a rudimentary system that stacks textures in a ...
0
votes
0answers
12 views

Smooth movement in point-to-move 2d game based on velocity [duplicate]

I have a real-time point-to-move 2D game with one playable character to control. I want to create smooth player movement using physics and appropriate velocity. Basic setup: The player has a maximum ...
0
votes
0answers
63 views

LibGDX 2D Silhouette

recently I decided to implement in my game the drawing of a silhouette of the player when he is behind objects (the top layer of the map). Found a similar question here, but it doesn't matter to me to ...
0
votes
1answer
34 views

How to use an overlapping shader so that it uses layers sort from sprite renderer and its transparent

Im using the shader from question , but once I put it in the game, and my character gets close to it, it will be hidden by the shadow of the tree, which is transparent. Any way to make the shader ...
2
votes
1answer
214 views

Fully destructibility in 2D

I would like to create a small game about battles in the Middle Ages. Imagine a procedurally generated 2d map with rivers, fields, and a small castle. Two sides. One player will attack the castle, and ...
0
votes
0answers
19 views

Reuse and Interact With Multi-Layer Tile Maps

I'm new to game development and try to make a game where buildings are created in tile maps. My problem is that I need to interact with these buildings and I want to reuse the buildings I created. Now ...
0
votes
1answer
58 views

2D Side-scrolling Strategy Game Pathfinding Help

Hey Guys,I am trying to implement dungeons into my 2d RTS ish game.The dungeons is made out of rooms, you start at the top, and you can unlock rooms with scouts.The picture is the unlocked version of ...
0
votes
1answer
25 views

Android Game - Screen Flickers When an Entity Removed From The List

I am using Canvas in my android game. When I remove a no longer displayed entity in my entity list, all other entities are flickering for a brief time. When it's not removed, there is no such problem. ...
0
votes
0answers
80 views

Game world rendering

I have a question about game world rendering. What is the best way to render background graphics such as grass and trees in 2D for your game? Normally I would use array of tiles where every grass tile ...
0
votes
0answers
32 views

What are the parameters for a smooth wall jump

I want to make a platformer like Celeste and trying to implement wall jump. When the player is on the air and near a wall, and presses jump, the player gains x velocity opposite the wall direction, ...
0
votes
0answers
25 views

Changing Pixels Per Unit [duplicate]

First off, excuse my ignorance. I am just getting started in game dev. and ran into a little issue. So I had these weird rippling-lines going across my screen, and saw in a couple forums that this ...
0
votes
2answers
33 views

Spawning prefab on touch after previous spawn(s) had been destroyed

I wrote a script which pawns an object (instantiated prefab) each time the player touches the screen. The maximum number of these spawned objects active in the scene at once is 3, and when they are ...
0
votes
1answer
97 views

What's the Unity way of implementing data driven UI

I'm used to application development with frameworks like Qt, and I'm really fond of using MVC-like patterns. Now I'm diving into game dev and I have a bunch of data that I want to show the user and I'...
0
votes
0answers
23 views

Why can I only pick up some of my blocks from the sides instead of from anywhere on the block?

In my game I wanted to drag and drop blocks. For a while, I had another issue where my blocks wouldn't connect to their holders when dropped on them. On further play testing however, I noticed that ...
1
vote
0answers
30 views

LibGDX Lights and Shadows for my 2D TiledMap Game (like Terraria/Starbound)

Im currently working on my Terraria-Clone. After I have finished generating the world, I would like to add light and shadow to my game. For example, it would be light in the Upperworld during the day, ...
0
votes
1answer
78 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
116 views

Unity: how do I get a list of prefab tiles from the TileMap?

I'm building a 2D strategy game where I've decided to use TileMap for spaces which characters can traverse. My tiles need to be prefabs, because they will have a script attached to them to store ...
0
votes
1answer
32 views

Sprites don't become lit when installing Universal RP package

I want to implement 2D lights in Unity. So, I downloaded the Universal RP package from the Package Manager. I created renderers as shown here, then I created a light object (Point Light 2D) in a new ...
2
votes
3answers
1k views

What is the “Unity” way to approach tech design for a 2D game like this?

So I come from C++ land where I've always done every little thing myself. Now I'm getting into Unity and C# and I'm ironically overwhelmed with the domain. I'm starting off with this simple little 2D ...
0
votes
1answer
44 views

Canvas not scaling to screen size

So I have a very simple scene set up with just a camera, a game object called TestGrid with a grid script, and then a canvas. I have a TextMeshPro prefab that I instantiate to fill the 10 x 20 grid ...
0
votes
0answers
15 views

Platform disappears when in Play mode [duplicate]

I've used a platform( and also made a duplicate of it ) where the player will stand. When I hit the Play button, the original platform disappears, while the duplicate remains. Again, if I reduplicate( ...
0
votes
1answer
17 views

Changing ImageView position based on angle of rotation

I am trying to make an ImageView change its position based on the direction it is facing. ...
0
votes
2answers
43 views

Default Game Window Size To Take While Making Games

I am planning to make a game for mobiles and tablets, I wanted to know what would be the default resolution that I should set for my game so that it covers all or most of the devices out there. I read ...
1
vote
0answers
43 views

A system that figure out the fastest (not shortest) navigation method between points for 2D spaceship with 2 axes propulsion

I am working on a space themed game with space being a 2D pane. The player issue order by clicking on the coordinate for his/her ship to navigate to a certain point on the pane. The player ship can: ...
2
votes
2answers
34 views

Gradual strafe rotation with focus on mouse (circle-strafe)

I'm pretty new to Unity and C# programming, and am trying to get a player-controlled object to do a controlled rotation around the mouse pointer. The functional purpose is to be able to circle-strafe ...
0
votes
0answers
17 views

Is there a way to layer 2D assets in Unity while maintaining correct player clipping?

I'm working on a 2D top-down game, currently building a scene where I want to place one asset on top of another (lamp on top of table). Game objects are all on the same layer as the player so that the ...
0
votes
0answers
20 views

player goes off screen as the camera smooth follow interpolation

Sometimes player goes off screen as the camera lags behind it, especially when the player is falling. Also when the player is climbing walls by jumping left and right, the camera moves left and right, ...
1
vote
0answers
23 views

How to show part of the world scaled to screen size?

I have a world size of 100x100 I want to map this world size to screen size using this mapTo function ...
1
vote
1answer
47 views

How can I set up a 2D circular boundary in Unity?

I wanted to create a virtual analogue stick on Unity. I figured a very simple, 2 part method setting up a tether to the middle of a doughnut-container and a boundary would work. While the tether was ...
1
vote
0answers
30 views

C# OpenGL: How to translate a triangle

I am trying to translate/move a triangle 0.3 to the right. When I run the code below, it moves the triangle, but part of it is cut off, like it is in a set box (shown in images below). Code to move ...
0
votes
0answers
46 views

RGB sequence of day/night cycle

I'd like to simulate a day/night cycle, and am thinking to do this with two components: an underlay to simulate sky color, accompanying either an alternating cloud or star rotation animation ...
1
vote
1answer
56 views

Why is my player spinning after a collision?

I've made a very simple 2D top down prototype with Unity. This is the code I use for the player: ...
0
votes
0answers
43 views

How to create a 2D Polygon Sprite from prefab at runtime?

At start of my 2D unity game I want to create a new "building" (at random). So I created a prefab named "Building" from a polygon sprite. Then I created a "Empty Game Object&...
0
votes
0answers
94 views

Unity Animation (2D) - Cannot drag sprite into animation

I am trying to create animations for my sprite which are configured to the "Multiple" option. When I try to drag the sprite into the timeline for the animation it won't do anything. It will ...
2
votes
1answer
50 views

Making pickup objects with gravity that won't push the player on collision

I am trying to create pickups, that appear after an enemy dies, and that the player can pick up, but I am running into some issues. First of all, I want the pickups to be affected by gravity, so I ...
0
votes
1answer
31 views

Why does the script stop working after respawning?

I have a flying enemy that follows the player: ...
0
votes
1answer
23 views

How to change a sprite via script at runtime when using an animator?

I am making a simple 2D shooter. I have my character's body and head as different objects, as I want him to look up/down regardless of the movement. So, I basically use the following script: ...
0
votes
0answers
17 views

Rotating certain particles in a particle system in Unity

I'm working on a visual effect using particle systems. I'm trying to rotate newly created particles according to some object's velocity at that time. Currently, I'm rotating the entire particle system ...

1
2 3 4 5
62