Questions tagged [2d]

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

0
votes
0answers
20 views

how to create a curve movement of slider in unity

I am trying to create a curved (not circular) movement of slider. Here is my demo images for reference: I have watched some tutorial but those are for circle images. I want to make this movement ...
0
votes
0answers
30 views

How similar can my game be to a AAA game? [duplicate]

(This is just an example so take it lightly) Say I want to make a 2D game heavilly inspired by a AAA game. For example GTA V. The names and story remains the same. except everything is in 2D but ...
1
vote
1answer
25 views

Unity Colliders - How do I detect nearby objects without my detection ranges detecting each other

How can I get both colliders' types in a trigger overlap message like OnTriggerExit2D(Collider2D other)? Example: ...
0
votes
0answers
13 views

How to move sprite on z-axis in 2D Unity

I am making a 2D game and I am having trouble in setting up a sprite movement. Here is a picture for reference what I want to achieve: Now car is moving forward (I have done that using road and car ...
0
votes
0answers
31 views

Rotating A two point around circle?

Currently I M Working On 2d Game in my game problem is when i m click leftarrow and right arrrow point are not rotated?? Code: ...
0
votes
0answers
30 views

How can I move the character to the center of the screen when the user clicks with the primary mouse button?

I am a newbie at this and I'm just trying to learn how to do different things. I am wanting to move a character sprite in a horizontal line, toward the center of the screen when the primary mouse ...
0
votes
1answer
67 views

PyBox2D car moves uncontrollably

I am trying to program TopDown Car using python and Box2D (similar to this tutorial: http://www.iforce2d.net/b2dtut/top-down-car ) The steering is so far limited to thres states of wheel rotation, ...
1
vote
0answers
11 views

Modify Unity's New 2D Renderer for the Lighweight Render Pipeline

I would like to use the new 2D renderer available with the LWRP to take advantage of the 2D lights. I would also like to replicate the things in this video - basically, I want my character to be ...
0
votes
0answers
28 views

2D Platformer into a First-Person 3D one? [on hold]

I am a beginner at game creation/programming/development and I want to know is it possible to switch from a 2D Platformer into a 3D Platformer in the SAME GAME? My idea is that you start at in a 2D (...
0
votes
0answers
23 views

Unity 2D Dynamic list of items with multiple buttons in items [closed]

I am developing a 2D game in unity. I have reached a point in my game that I need a list of items that can be scrolled. Each item has multiple buttons that can be clicked to do some task. The items ...
2
votes
1answer
42 views

Making my characters modular

I'm making a school-based sandbox adventure game in Unity. I need a lot of NPCs with different apperances. I dreaded this since I don't have fun doing art and it is usually the reason I end up ...
0
votes
1answer
23 views

Gameobject stops moving or gets stuck when colliding with another GameObject

I'm currently making a brick breaker style game. My issue comes when the ball is launched off the pad it gets stuck in between two blocks. I have all the blocks on a "Foreground" layer with an "Order ...
0
votes
1answer
41 views

OpenGL C++ Drawing particles instanced performance

In my 2D Game Engine I'd like to reduce the amount of draw calls. I used to do a draw call for every particle, which yields worst performance. I've tried instanced rendering in OpenGL but my ...
0
votes
0answers
14 views

What image size/resolution is best for a 2D Mobile Dress Up Game [duplicate]

I have begun the process of making a 2D dress up games (i.e. Pastel Girl and Cute Girl Avatar Maker). Majority of the tutorials I have seen always include things like game physics, but I don't need to ...
0
votes
0answers
13 views

Rotating an image in Slick2D in place in a tiled map?

I just finished writing a parser for TMX data (Tiled maps), and the way Tiled handles rotated tiles is by using three bit flags for flipping an image horizontally, vertically, and diagonally, to allow ...
0
votes
1answer
26 views

Unity - SpriteRenderer. Trying to make sprite from code using Texture2d.whitetexture

I have been trying to write a method that fills a rectangle with a color. I've tried it as a new 2D and 3D project just in case, but this gives the same results. Basically, i want the script to make ...
0
votes
0answers
50 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 ...
0
votes
0answers
49 views

How can I make the screen scroll only when the character is close to the edge?

On the internet, I saw videos and tutorials about screen scrolling. But those only show how to keep the player always in the center of the camera. I want my camera to scroll over the level, following ...
1
vote
1answer
52 views

Player doesn't move smoothly, when trying to follow position between cursor and player

When my player moves, moving the camera looks like the camera is teleporting to the player, and then after loading teleporting again. I want to make it move smoothly. When the camera is following the ...
0
votes
2answers
32 views

Destructible tiles in unity's tilemap

I'm creating a 2d game and I want to make it so that tiles are destructible whenever a projectile collides with a tile, the problem is I don't know how to get the tile that the projectile is colliding ...
0
votes
0answers
49 views

Update position using animation curves

Implementing the suggestions from this answered question, I am trying to move my player according to the animation. To do so, I am adding the transform.position property to the animation and then, ...
3
votes
2answers
138 views

Why is the equation \$S = ut + \frac 1 2 a t^2\$ not used directly to calculate final position of an object?

Most articles I've read on physics integration in games say to do it like this: first we calculate velocity after a certain elapsed time dt like this: ...
0
votes
2answers
43 views

Add force to objects while inside area

I'm currently trying to create an area that would somehow push objects to a specific direction. (and also apply angular drag if possible) I'm currently new to Unity and Godot. I have already seen ...
1
vote
1answer
34 views

Unity 2d Animation from spritesheet: How can I move the character according to the animation?

I am trying to implement an attack animation that should end up in moving the player by some distance. The animation would be something like this: As you can see the position of the player should ...
-1
votes
0answers
14 views

how can I make the gun (gun1.png) shoot towards the mouse's position (pygame 2D) [duplicate]

here´s the code: import pygame, sys import math clock = pygame.time.Clock() from pygame.locals import * pygame.init() # initiates pygame pygame.display.set_caption('Pygame Platformer') ...
0
votes
0answers
30 views

How to add a fluorescent effect on an image in Unity

I have recently been attempting to create a true on-screen representation of a fluorescent orange colour on an image. Whereby, I believe post-processing with unity will deliver the best results. Thus,...
0
votes
1answer
46 views

Detect left and right movement of sprite

I have a sprite of ball which moves when a player tap and holds the ball and move finger on the screen. I have a attached animations on it. straight, left, right and when the ball hits something. ...
0
votes
1answer
55 views

corridors between rooms not generating; dungeon generator

So i'm following this tutorial http://www.rombdn.com/blog/2018/01/12/random-dungeon-bsp-unity/ to make a randomly generated dungeon. everything works fine, until it reaches the bit where the corridors ...
0
votes
0answers
20 views

Unity : Casting shadows of anima2d characters

I want to cast shadows of animated 2d character on a level like this : The only thing here I want is dynamic shadows for anima2d character as animation progresses.Is there a way of achieving shadows ...
1
vote
2answers
47 views

Getting closest distance between a square's edge and a point 2D

How would I get the closest distance between a square's edge and a point in 2D, if I only have the points coordinates, and the coordinates of the square and it's size?
0
votes
0answers
29 views

Update movement actor with collisions in 2D game

I have the algorithm for moving an actor. The actor has: 4 states: Stay, Move, Jump, ...
0
votes
1answer
27 views

How do I determine the rotation of a Tile using Tilemap in Unity 2d?

I want to know the rotation of the tile in C# in order to do some logic on another object that is sitting on the tile. The rotation matters for the logic. I don't see anything except GetTileData in ...
1
vote
1answer
43 views

An algorithm to make one object follow another on a 2D grid

I am using Greenfoot, but this can apply to pretty much any 2D engine. So my question is a basic one that I somehow couldn't find an answer to already. Basically, if I have an enemy and the player, ...
1
vote
1answer
56 views

2D AABB Collision

Detecting a 2d collision is easy, but after that, I'm having trouble fixing the AABB position to where it should be. I think it would be something like ...
1
vote
1answer
62 views

How to make rhythm game long notes in Unity?

I'm making a rhythm game for a university course and I can't figure out a way to make the long/sustained notes. For reference, this is what I mean taken from Guitar Hero: I already have a system ...
0
votes
1answer
41 views

How do I wait until the player has reached the gameObject to perform the interaction?

If the player clicks an object to move the player sprite to the object and interact with it, how do I wait until the player has reached the gameObject to perform the interaction? I have the ...
0
votes
0answers
39 views

How do I do collision detection in a 2d game using a tile grid but which also has pixel by pixel camera and character movements?

So I've been at this for weeks now and every solution I programmed did not work. I am using Free Pascal and SDL2. So I programmed a 2d game which uses a two-dimensional array which contains the tile ...
0
votes
1answer
21 views

How does one get sprites to hide/unhide using OnMouseDown() in Unity?

I'm right now using Unity for a school project and I need to be able to hide and unhide sprites for "expansions". I've looked all over the internet for this and I can't seem to find an answer. Here ...
3
votes
1answer
126 views

Predicted trajectory becomes less accurate in a side-on collision

In my 2D billiards game, I have it so that when the user clicks and drags with their mouse, a Physics2D.CircleCast is projected from the cueball to wherever the mouse is. If the circle happens to hit ...
0
votes
0answers
11 views

How to switch between 2 game object while having it move at the same position?

I've been trying to make 2 input which change the state of a game object into another by setting one active and another inactive alternatively. But when you're in one state and you try to input the ...
0
votes
2answers
65 views

How do you make a object that always follow another object?

I'm trying to make a game object follow another game object and switch to another when a button is pressed. But right now it just seems to change the position when the button is pressed but it doesn't ...
-1
votes
1answer
43 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
0answers
20 views

Bone depth in Unity

I'm very new to game development and I'm trying my hand at rigging a 2D character in Unity 2019 via the 2D animation pack and IK manager. It's mostly working well so far, but unfortunately I can't ...
0
votes
1answer
17 views

Unity - Set/Manipulate Render-Buffer for “Render Overlay Effects”

Note This is more of a question on how/where to do furhter research into this topic becasue I do not know anything about it yet. If anyone has answers on how to accomplish this goal, I'd very much ...
0
votes
0answers
51 views

Handling multiple resolution

I have been trying to handle different mobile phones resolutions for my game. But the scene is not fitting accordingly in some screen its perfect but in some other screens it is shrinking. My question ...
0
votes
1answer
49 views

2D vehicle collision detection and rotation

I'm attempting to make a simple 2D car game from scratch, but I can't figure out the collision detection between a vehicle and a road. The vehicle should also rotate appropriately to its position on ...
0
votes
1answer
56 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; ...
3
votes
1answer
216 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 ...
2
votes
1answer
73 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
29 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 ...