Questions tagged [2d]
2D refers to two dimensional space where coordinates are represented with X and Y values.
3,484
questions
0
votes
0
answers
6
views
Pixel platformer character collides with blocks above while there's still a visible gap
I was trying to the set up a tile map for a 2D pixel art game in Godot 4.1 (following a tutorial) and realized that there seems to be an issue or something I am not aware of with the way collisions ...
0
votes
0
answers
14
views
Drag-select multiple units code Godot 3.5
The code from where I based my script.
The code I have has the these 2 problems:
The visual area for the player to see what unit are going to be selected doesn't work as intended, if I start dragging ...
0
votes
1
answer
36
views
Simulated light for a 2D tile-map with just SDL2?
I'm working on a 2D tile-map RPG with C++17 and SDL2 + SDL_Image.
There are daily cycles, weekly cycles and seasons. Even a kind of weather engine provides atmosphere. The moods and times of day are ...
0
votes
0
answers
62
views
Seperating axis theorem is bugged
I am attempting to make split axis theorem for 2d collision physics. It does works, but is inaccurate. It is based off of: https://www.gamedev.net/tutorials/programming/math-and-physics/a-verlet-based-...
0
votes
1
answer
50
views
Optimal Approach for Transmitting and Rendering Large Pixel Art Game Maps in Unity
I'm working on a pixel art game in Unity, and my backend (Which is actually written on Golang) has generated a massive dataset of tiles for a 1000 by 1000 world (it could be even more). I'm wondering ...
1
vote
1
answer
278
views
Area2D only detecting body_exited once
I am new to game development, I am practicing by creating a pong game.
I currently have an Area2D set up with a signal listening for ...
0
votes
1
answer
49
views
Sprite chasing a target using move_towards_ip does not move
I'm trying to get a turtle sprite to chase a falling algae sprite utilising Pygame's inbuilt functionality. I have spent many hours reviewing questions and answers and suspect I'm missing some ...
0
votes
2
answers
64
views
Bouncing balls miss collisions, bounce the wrong direction, of lose momentum on one axis when hitting a corner
I am making a 2D game where balls bounce from the edges of the screen, However, there seem to be two types of issues with this kind of bounce method, and every tutorial I checked uses the same method.
...
2
votes
1
answer
83
views
How to make redirected player movement respond to same key?
I have a 2d game (Godot 4) with different rooms with portals to go between them, and some portals redirect the direction of the player while still holding the same key. I have that working so far, but ...
1
vote
1
answer
50
views
Why won't my bullets shoot?
I am making a top-down shooter in Unity (following a Brackeys tutorial for the top-down shooting mechanic). When I press the left mouse button a bullet prefab spawns, as it should, however there is no ...
2
votes
2
answers
87
views
Fast way to calculate angular intervals and occlusion of circular objects in a 2D vision cone
Say I have an agent in 2D in a world filled with circular obstacles of different kind and across many scales (some may be very large, practically filling an agent's view, some may be very small).
The ...
0
votes
0
answers
29
views
Limiting shooting angle only works when facing right
I have a problem with the shooting being limited when the player is turned to the left side. When I set a range from -145 to 145, on the contrary, it does not shoot into this range, but shoots from ...
0
votes
0
answers
40
views
Set depth value in fragment shader
I'm making a simple 2D renderer and I want to avoid redrawing as much as possible.
My Vertex layout has the 2d position and a float depth value.
I want to assign a depth value to each of them after ...
0
votes
0
answers
31
views
Sorting layer of wall in top down game 2d
I made tilemap using tiled app.
I try to sort layer so the when the player is in front of wall he visible and when he is behind the wall then not viable, it's commonsense.
But problem only one line ...
1
vote
0
answers
57
views
2D grid game server - interaction system/dynamic blocks
I'm building a Server-side engine for 2D sandbox game similar to Terraria or Starbound.
The language I use is Dart (similar to JavaScript or C#).
Currently I'm trying to figure out how to make a good ...
15
votes
3
answers
5k
views
How to make the player feel like giving up?
I am planning a game that has a level that is a confusing and illogical maze, and I want to make the player feel like giving up, but not so intense that they want to quit the game. Also, I'm probably ...
0
votes
1
answer
59
views
Weapon flips upside down when aiming to the left
When the player turns to the left, the texture of the weapon turns upside down. How can I solve this?
Shooting Script
...
0
votes
0
answers
32
views
Connecting circles of the same color
I've been following couple tutorials on making blobs with connected colors, and it works fine, but I have issues modifying it.
I'm spawning circles with dot gradient of certain color. Then in a shader ...
11
votes
4
answers
6k
views
How can I help my unpaid 2D and 3D artists improve their portfolio?
I'm part of a 20 people team working on a game for free but we've got intentions of starting a company soon.
At the moment, not even the prototype is finished, but we've got 6 artists, half 2D and ...
0
votes
0
answers
46
views
How to animate a ball with fake physics from top down viewing angle
I am making a 2D American football game (similar to retro bowl) in Game Maker: Studio 2, and its main perspective is in 2D. I want to animate a ball that moves in a parabola and can interact with ...
0
votes
0
answers
28
views
Ideas for how to attach meta data to an arbitrary sprite sheet?
I am currently messing around with monogame and creating some silly sprite based games. One issue I have is when I get sprites for OpenGameArt or any equivalent they are often in spritesheets in a ...
1
vote
0
answers
57
views
Possible to draw isometric tiles with height and moving objects in one pass?
I am working on a isometric tile-based game where the tiles can sometimes have differing heights - representing elevation. I am trying to understand how to order the tiles for drawing when there are ...
0
votes
0
answers
74
views
how to use square sprite asset in isometric tilemap?
I recently need to build a isometric game world in Unity. I have 4 types of terrain.Both are 32x32 square sprite.(represent 1x1 area) Besides, i have a table sprite asset which is already isometric.
...
0
votes
0
answers
44
views
How to rotate body in server-side physics without imparting angular velocity?
I'm developing a 2D cloud-based MMO using WebSocket and have struggled a lot to get proper working physics on the server side. I'm using Next.js for the client and currently Node.js for the server.
I ...
3
votes
1
answer
90
views
Changing the scale of a character and speed to match the perspective of a 2D background while traveling along the Y axis
I am making a 2D point and click game, just for fun.
I want to create some sense of perspective, so I am trying to change the scale of the player as he travels along the Y axis. Obviously, the speed ...
1
vote
2
answers
118
views
Rotating 2D sprite around tilted Y axis
I am building a sprite that I want to spin along an axis. I am using SpriteKit on iOS for this, but I'm sure that the question is not really tool specific.
In my case, I have a sprite such as:
and I ...
0
votes
0
answers
39
views
Enemy not responding to chained attack
I am working on a 2D mobile platformer where there will be different characters with unique skill sets. I am working on a character that should be able to perform chained attacks.
I have a button in ...
0
votes
0
answers
91
views
How to achieve a blend of Top Down 2D and Isometric maps/art like in Sea of Stars?
I recently started playing Sea of Stars and what amazed me was the seamless blend of Isometric and Top Down 2D. Sometimes even in the same map. It's what I have in mind for the game I'm currently ...
1
vote
0
answers
39
views
Move UI element by a specific amount relative to current screen resolution
I want to achieve the following:
At some point in the game, the UI Image (dashed rectangle) should shift towards the right edge of the screen (black outline rectangle) up until the part of the image, ...
2
votes
0
answers
53
views
Generate coastal line from water tiles
I have a 2D tiles map. Some tiles are water (black tiles on image). I can compute which tiles are coastal when it's 4 neighbors are not water (black dots on image).
I would like to compute coastal ...
0
votes
0
answers
24
views
How do I change the motion reference in an animation state during runtime?
I tried this solution: https://discussions.unity.com/t/how-to-change-animation-clips-of-an-animator-state-at-runtime-is-there-a-way/183135/4
But this doesn't work if I try to use a different animation ...
0
votes
1
answer
41
views
Can I rotate the velocity of a rigid body?
In unity, I'm working on functionality for a shooting at the mouse position from the player's weapon in a top-down 2d game. I have a working gun that instantiates a bullet prefab, that moves towards ...
0
votes
0
answers
25
views
SpriteResolver's category and label values null when I try to access them at runtime. How do I fix this and make sure I get these string values?
I'm working on creating an animation system used for mouth movement that works like this:
BEFORE the animation clip starts playing, cache the SpriteResolver's state (category and label)
Once the ...
0
votes
0
answers
22
views
Casting out vision rays for 2D car in pyglet to return distance from objects?
I am working on a machine learning project that involves training a 2D car to drive around a top-down racing track. I'll be training neural networks using different algorithms and one essential form ...
1
vote
1
answer
42
views
KinematicBody2D stutters/moves back and forth
I'm working in Godot 3.5, and trying to set up a navigation polygon for my kinematic body to mode around inside, but when I try to send it to some point, the body 'stutters'/moves back and forth in ...
0
votes
2
answers
144
views
How to rotate NavMeshAgent toward its movement direction?
I'm working on a 2D game in XY plane. I've created enemies using NavMeshAgent and I've gave my agents way pints to move between them. The problem is that I don't know how to rotate them in the ...
0
votes
0
answers
71
views
Generating tris for concave polygon 2D
I have an arbitrary array of points that describe vertices of the polygon 2D, they ar in order. To generate plane mesh for that, I need to generate tris. For something like circle/hexagon/square it is ...
0
votes
2
answers
84
views
Is there a logical reason for SFML's Vector2 being templated?
The game development library SFML has a Vector2 class template (and a Vector3 for that matter), which can use any arithmetic ...
0
votes
0
answers
36
views
Character is stuck between grid cell gap [duplicate]
I started making a D&D-style turn based tactic game. I have a problem with my tilemap.
I made a script to find the location on the tilemap for my character and for the tile I clicked with the ...
0
votes
0
answers
150
views
Finding loss of angle and length due to rotation
I'm working on a targeting system for my 2d game. But I want to see the object in isometric perspective. My calculation is correct for 2d objects but it doesn't work for rotated in x axis objects.
I ...
1
vote
0
answers
76
views
How to get OnTriggerStay2D working?
I am trying to make a flamethrower weapon for my player character. I am using a system were I can change between weapons, and every other weapon works perfectly. The flamethrower is able to turn on ...
1
vote
1
answer
158
views
Would it be possible to make a Game Genie like program in Javascript?
Game Genie was a tool for the NES that allowed users to input codes that were able to drastically able to change the mechanics of a game by getting CPU reads and replacing the game's response with its ...
0
votes
0
answers
33
views
In Unity, how do I get a specific texture in runtime from .psd file rather than its whole entire texture?
I'm trying to recreate the current texture on a SpriteRenderer's sprite in order to make it bigger so that I can add a white outline to it. This is all done on runtime.
If we look at the .psd file ...
0
votes
0
answers
52
views
How can I make a bounding box better fit a sprite?
I'm working on a simple 2D platformer for learning purposes and I'm trying to add a bounding box to the player sprite.
I've managed to get it working; however, I'm having difficulty with sizing it to ...
0
votes
1
answer
83
views
Physics.OverlapBox not detecting 2D collider objects
I have a 2D game with several square objects (tiles) that each have a BoxCollider2D and a kinematic Rigidbody2D. I want to detect when one tile is located to the right of another tile, such as to ...
1
vote
1
answer
327
views
How Can I Make a Silhouette Shader When an Object is Behind Another Object in Godot 4
I've been trying to replicate the effect created in this guide (https://www.gdquest.com/tutorial/godot/shaders/silhouette-2d/) in Godot 4, but I haven't had any luck.
The problem seems to be that in ...
0
votes
1
answer
30
views
Player twitching in cinemachine 2d
Good afternoon, currently my player shakes when you move it to the left or right. I am using cinemachine 2d virtual cammera.
Here's my movement script:
...
0
votes
1
answer
121
views
Context-based Steering
I added context-based steering functionality to my 2d sideview free-roam shoot-'em-up game.
Essentially enemy units emit raycasts eventually towards every direction, I determine interest and danger ...
1
vote
2
answers
216
views
How can I solve this error and this warning when destroying instantiated prefabs?
I'm working on a level in a 2D game that includes two big triggers.
Each time the player enters them, I Instantiate an enemy prefab. Then, the player can shoot ...
0
votes
1
answer
101
views
How to check if a 2D GameObject is touching something without OnTriggerEnter
I want to avoid using OnTriggerEnter2D because I want to use it in a function like this:
...