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

Questions tagged [2d]

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

0
votes
0answers
28 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 ...
1
vote
1answer
46 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
40 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
20 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
80 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
29 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
92 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
23 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
21 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
28 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
33 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
60 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
45 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
198 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
114 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
41 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
101 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
85 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
44 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
48 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
45 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. ...
0
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
115 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
73 views

Unity: Looking to achieve similar day/night cycle in 2D game

so I'm currently working on 2D game, and I was wondering if anyone around here has experience/tips in achieving this (see reference below) sort of day/night transition? I've done some reading, and ...
-1
votes
1answer
45 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
60 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
91 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 ...
0
votes
0answers
20 views

How to create wall to protect enemy spawn & destroy bullet entities?

I am creating a 2d shooter in which there will be enemies that spawn from given spawn points. In order to protect the spawn from players raining bullets into the spawn I created a wall to stop the ...
2
votes
1answer
87 views

How to implement swooping movement?

I am trying to code some swooping behavior for a flying enemy in my 2D platformer. The ideal behavior has the enemy starting from an arbitrary height above the ground, then accelerating downward and ...
1
vote
0answers
27 views

How to implement back and forth steering behavior?

I am trying to implement some behavior for a flying enemy in my 2D platformer. The desired behavior is for the enemy to fly back and forth across the player, harrowing him. If the player was ...
0
votes
0answers
30 views

Render a basic image to screen SharpDX?

I am working with SharpDX (DirectX11) and I'm refactoring some old code. I'm having a hard time finding tutorials on this and need to render a basic image to a ...
0
votes
0answers
20 views

have a Game object follow another within the view of a camera that's moving? 2D

In the gif, the camera follows that small circle with a line renderer which is the puck. the other circle the paddle follows the touch position and can't go past the center. when the paddle is ...