Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Make your voice heard. Take the 2019 Developer Survey now

Questions tagged [2d]

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

0
votes
0answers
5 views

Any tips for aligning existing sprite sheets to a grid?

I've been dabbling with sprites, and I've found most sprite sheets that have been posted for existing games (for example, Sonic & Knuckles) are not aligned to a grid. I've found this frustrating ...
0
votes
2answers
33 views

Unity prefab from multiple sprites

I am making a prefab of a simple building by combining sprites. As you can see in the Hierarchy view, this simple building is composed of very many gameobjects which I created via dragging sprites ...
0
votes
0answers
19 views

How simulate day/night transition on 2d game? [duplicate]

I'm trying to create a 2d game and I want to have a day/night transition, but i'm actually new on Unity and I don't know how to do it, I'm using this code, but give me error and I really don't even ...
0
votes
0answers
8 views

Unity - Rotating image on button made button un-useable [duplicate]

I recently started trying to teach myself Unity2D development using some tutorials and something weird was happening last night while I was working on my project. Basically I have an image that ...
0
votes
1answer
31 views

Scale camera to fit screen size unity

My background and gameobjects are 2d sprites not UI images ,I want to know how to make my background scale with screen size and positions of 2d sprits on it don't change after building game (webGl) ...
0
votes
1answer
42 views

Object coming from far away effect in 2D

I have a path made using segments of sine wave interpolation put together that is drawn flat on the screen. And I would like to give the path the effect of coming towards the player. I tried to draw ...
2
votes
1answer
59 views

How do force fields scale?

Setting I am designing a 2d game in which a \$1/r^2\$ force acts between moving charged particles, and the number \$n\$ of particles is very large. To calculate the force between all pairs of ...
2
votes
0answers
51 views

Trying to get Vertexshader to work Monogame 2D

If I don't use the vertex shader, it gives me white textures which is what the default color is. Once I add the vertex shader, the screen is black. I figure it is something wrong with the Matrices I ...
0
votes
0answers
32 views

Ice transition particle effect

We are small indie team developing a casual mobile game. We are trying to implement an effect like the normal-to-ice block transition in Angry Birds 2: How can we implement an effect like this in ...
-1
votes
0answers
21 views

how to implement a trail in coco2dx -c++

I'd like to implement a trail of sprites following one another in a line, like the sprites circle in Zuma Deluxe: I already used CCMotionStreak. Editor's note: this is a great place to show us how ...
0
votes
0answers
56 views

Stop Animated Tile from looping Unity2D C#

I am using the animated Tile script and starting the animation when I need it, by replacing a static tile with an animated one. Currently on collision with the player, however, I need the animation to ...
1
vote
1answer
83 views

2D snake game ( how to rotate snake's head with movement ?)

I want to know: how to rotate snake's head with movement how to make tail prefabs (body) follows head direction. ...
0
votes
1answer
14 views

I can't find a way to make my projectile gameobject collide with my ofscreen collider

so my code on my collider is as followed public class Collide : MonoBehaviour { ...
0
votes
2answers
53 views

Modern Techniques of Drawing Pixels?

How do game engines efficiently handle and draw pixels within a given display? As a personal project / exercise, I had begun developing a simple game engine written in Java, but came across the issue ...
0
votes
0answers
34 views

Problem with Unity 2d(infinte Jump)

I'm doing a 2D videogamesin Unity, I´m a beginner so I don't know really well how to program in C#. The problem is that I want to have just one jump, but my player a infinite jump. Thanks :) ...
0
votes
1answer
30 views

2D Rotation of an object along a curve line

I would like to rotate an object along a curve. I managed to move the object along the curve using bezier curve algorithm. The hard part is to rotate the object constantly(no limit on maximum angle), ...
0
votes
1answer
38 views

Can't get AABB Collision to work properly

This is the code I'm using to resolve collisions on the players left side. It works when I'm on the ground, but if I'm falling, it does not work. ...
1
vote
1answer
66 views

How to make the player's weight deform a rope bridge?

I'm making a 2d game, and I want my character to deform my rope bridge with physics effects on the jointed structure when they walk over it. Right now, the player can stand on the bridge, but it ...
2
votes
2answers
95 views

How to program smooth player 2D movements

I am writing a simple 2D game in Rust, having access to the following dependencies: Piston: for the graphic engine nphysics: for the physics engine The genre is Metroidvania, the game features a ...
0
votes
1answer
31 views

Unity - how to check if object is fully covered by another objects (2d)

I am creating an educational game for kids , and in one of the levels player must to paint animals , like in color book, so I created scene where 2 object , already colorful lion and white lion (white ...
0
votes
1answer
23 views

360 degree Shooting using Pythagoras problem Unity 2D C#

I have used pythagoras to give the bullet a velocity in the bullet class. Velocity is applied when Instantiated(); ...
0
votes
0answers
22 views

How can I prevent movement from analog joystick “bounce”?

I'm working on a top-down game where the player can move up/down/left/right. The sprite changes to the corresponding direction, and I have an internal value that tracks the direction the player is ...
0
votes
1answer
33 views

Unity create Animated Tilemap?

Im trying to create an Animated Waterfall Tilemap from a tutorial video. In his video when the author right clicks he can see a Animated Tile > under CREATE option. But In my case its not there !! ...
0
votes
0answers
34 views

How to get one KinematicBody2D to push another?

I am working in Godot 3, where my player is a KinematicBody2D. When I collide with a block which is also a KinematicBody2D I'd ...
0
votes
1answer
21 views

Changing Hitbox from a single spritesheet

I have different animation in a single spritesheet. I wonder how do you guys assigning these hitboxes?
1
vote
0answers
61 views

“Proper” way to do 2d scrolling game

I am new to game development and I would like to make a 2D scrolling game with a tile based engine. If you want an idea, it should resemble the Legend of Zelda: A Link to the Past like in the image: ...
1
vote
1answer
34 views

Why only few parts of the 2D sprite change their colour when I apply sprite color in Unity?

I'm making a stickman 2D game where I have different sprites for the player. But when I try to change the Sprite Renderer Color, it only changes few pixels of the sprite and the rest stays black as ...
1
vote
1answer
36 views

Does it make sense to export and use skeletal animation as sprites?

As tools like Dragonbones, Spine lets you export animations as both sprite atlas and skeleton data (JSON/binary), I'm not sure which format to use when importing to Unity. I have few concerns: Will ...
0
votes
3answers
68 views

How to add collision to this script in Unity

I Want to be able to have collision were my player can't go through objects with colliders un Unity but I don't know how to make that happen, can you please help? ...
0
votes
2answers
46 views

Keep platformer jump height consistent with different frame rates

I want to achieve a platformer jump similar to that of Super Mario Bros. (keep pressed the jump button to jump higher) and I want it to be frame rate independent. At 30 FPS it works as I want. However,...
1
vote
1answer
73 views

2d side scroller slope physics and collisions

In old 2d games such as double dragon, streets of rage etc. where the player could move “up and down” on the y-axis to give an illusion of depth (as opposed to something like Mario) how were slopes ...
6
votes
1answer
200 views

How do I store destructible terrain that characters can walk on?

I'm trying to make a 2d game like Worms (in JS, if it's important). I found 2 possible ways of implementing destructible terrain: Bitmap. Store every pixel in a huge 2-dimensional array Represent the ...
0
votes
2answers
116 views

2D character movement

My character moves right and left correctly, I want to know if it is possible to move character forward and backward to collect hearts (I know that in 2d no z axis I want to know if it is possible ...
-1
votes
0answers
31 views

How can I get rid of in-game Aliasing?

I am creating a 2D game in Unity. The sprites in my game appear to have their pixels only allowed to be in set positions of the screen, making the textures sort of aliased to a low degree that causes ...
2
votes
4answers
59 views

How to smoothly move camera when the player is climbing a diagonal staircase in 2D tile-based side-scroller?

I am working on a game, which is tile-based, similar to the way Terraria works. My player is 2 x 3 and can move over one-high obstacles, but this creates a very jittery effect, since my camera ...
0
votes
2answers
42 views

How To Destroy/Deactivate one enemy without affecting other enemies of the same type?

In my game, you jump on zombies'heads to squash them. Currently I'm only able to have one zombie in my game. When I add another (duplicate or drag from prefab), then run the game, I can squash one ...
0
votes
2answers
103 views

Game assets are images or 3D models

I am new to game development and I have created simple games with javascript and SFML. Those games are 2D and there I used images as my gaming assets. I was trying to be familiar with OpenGL like 3D ...
1
vote
0answers
87 views

How can I make 2D fog like in Graveyard Keeper?

I really like Graveyard Keeper's fog effect but I can't work out how to make it. It's 2D, and made in Unity. The characters all seem to be 'under' the fog, but the tops of tall trees and buildings ...
0
votes
1answer
45 views

Preventing overlap in OnCollisionEnter2D

So I have successfully built a script that can determine the physics for a ball reflecting linearly off of walls, similar to pong, while the ball is using a kinematic rigidbody. The issue is when the ...
0
votes
1answer
55 views

My character jumps, stops and if I try to jump it jumps!

There is this thing. I have Coded to check if my character is grounded. And it works fine. But problem is that I have added a code to jump. When my character jumps while checking my character is ...
1
vote
1answer
49 views

OnCollisionEnter2D just flat out not running for certain objects

I am working with the Unity3D Engine in 2D mode. Currently I am trying to make a circle collider bounce off of a composite collider for the walls of my game. The only issue is that for some reason the ...
2
votes
0answers
46 views

Line Renderer 2d Follow the edge

I am using mouse position to draw a line using line renderer 2d. What i want is when the line hits a collider it should start to draw on the edge of the collider rather than over the collider. ...
-1
votes
0answers
39 views

2:1 Diametric Projection in 2D

I'm trying to implement a 2D isometric game, well diametric with a 2:1 pixel ratio. Trouble is the rotation matrix I made doesn't seem to work. It's off by a little bit and doesn't line up: I'm not ...
0
votes
1answer
118 views

simple 2d car AI unity

I have a top down Car Game. how can I implement AI for the Cars? how the car follow the way points? I want AI cars also rotate itself along the path. I tried this solution ...
0
votes
1answer
120 views

How can I achieve a similar day/night cycle of the sky, but in a 2D game?

I'm currently working on a 2D game, and I was wondering if anyone around here has experience/tips in achieving this sort of day/night transition of the sky? I've done some reading, and some people do ...
-1
votes
1answer
46 views

Is it possible to do 2d character movement with vectors instead of using tiles

we have a character moving through a house and so far we used tiles to simulate character movement. Is it possible to use a vector image of the character and move the points via vectors to simulate ...
0
votes
1answer
61 views

How to find the resulting angle of a ball hitting a wall in 2D

So there's a ball moving on a 2D plane with any vector. When it comes into contact with a collider, it should reflect in a linear fashion. What formula should be used in order to find the angle that ...
0
votes
0answers
53 views

How to create a shader for this hue change effect?

In this cut scene from Shovel Knight, the individual pixel art tableaux don't merely fade in and out. Rather, they fade in and out as well as undergo various hue changes. Here's an example: The ...
0
votes
1answer
44 views

How to change a background from a list of images on button click?

I'm trying to create a button within the settings menu that allows you to change the image of a GameObject per click. So, let's say there are only 2 different images available to choose from and it ...
1
vote
1answer
92 views

How can I create a 2D sprite shadow like in “Alto's Odyssey”?

I've seen that the game "Alto's Odyssey" has a very nice way of projecting shadows on the ground the player is sliding on: How could i replicate that? Would I use some shader magic, or by projecting ...