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

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

0
votes
0answers
39 views

How to make a GUI/HUD layout (WYSIWYG)

Is there any way to make the construction of GUI for a game as "WYSIWYGish" as it could be? Maybe there are some apps, which I can use to arrange and scale sprites and then export something like XML ...
0
votes
0answers
36 views

take these 2d sprites. how can I use them? [on hold]

I am a total noob when it comes to graphics and game development. What exactly is required to use some of these sprites ? https://craftpix.net/product/indian-mayan-and-inca-warrior-chibi-2d-game-...
0
votes
1answer
38 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 ...
0
votes
0answers
14 views

Unity2D - Tilemap Challenges

At the moment, I am working on wrapping my head around what the Unity tilemap is doing programmatically. I have looked through the online documentation as well as taken a look at their official source ...
-1
votes
1answer
43 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
39 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
49 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
40 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
80 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
14 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
77 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
25 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
43 views

2d top-down camera with rotation on a tile map [duplicate]

Update: My first post was considered a duplicate, so, I am rewriting this one because I have not found a solution, just partial solutions. I am working at a 2d top-down game with tanks, the map is ...
0
votes
0answers
19 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
19 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 ...
0
votes
2answers
106 views

How can I represent a 2d UI?

So, I wanted to start building a desktop application, which is of course with an interface, and I thought that OpenGL would be best. The problem is, once I started following TheChernoProject's ...
4
votes
4answers
3k views

What would be the best approach to creating a pressure plate in a 2D game?

I've just really gotten started in Unity and while documentation has been helpful I haven't figure out how to detect collisions with 2 or more objects. I was able to get a script working that plays a ...
0
votes
2answers
91 views

How to mitigate speed effects on moving platforms?

I am implementing horizontal moving platforms in my 2D platformer. The way it's implemented currently, when my player lands on a moving platform, he is reparented to it so that his position updates ...
1
vote
2answers
52 views

Calculate gravity between two intersecting bodies

I've been working on a 2D gravity simulator for some time and I'd like to add some surrealism to it by creating planets that can't collide with other planets (passing right through them). The problem ...
0
votes
0answers
49 views

2D Lighting Shader Multiple Lights

For a 2D platformer, I have a 2D lighting shader with two passes, the first one draws a shadow from the closest light to the sprite and the rest of the lights will reduce the visibility of the shadow ...
2
votes
1answer
106 views

How to implement a pixelated screen transition shader?

I am interested in creating a screen transition seen in a lot of retro games. The transition is just a kind of pixelated distortion that increases or decreases in granularity over time. The effect is ...
1
vote
1answer
116 views

How to allow to slide rectangle to not colliding with corners between two rectagles?

I am detecting each side of collision between two rectangles, and wen I collide them, lets say, with the left side, it also detects collision on the top side when I move to the top, and the downside ...
1
vote
2answers
114 views

Algorithm to produce a 2D 'flying through space' effect like the old Windows screen saver

I am old. My high school maths is a long way in my past and I am struggling to devise an algorithm that will produce a 2D 'flying through space' effect like the old Windows screen saver. It has— ...
3
votes
2answers
98 views

How to implement a clipped shadow in 2D?

I want to create a shadow effect similar to the one found in JoyMasher's Blazing Chrome. Notice that the shadow clips when you're on a ledge, and projects to the geometry below. Currently, my ...
1
vote
0answers
18 views

How to determine angle of incidence, resulting position, and resulting velocity for a point with position and velocity appearing within a rectangle?

I have a rectangle positioned on a 2D Cartesian coordinate system, and its minimum x and minimum y are represented as a coordinate pair (xrect, ...
0
votes
2answers
44 views

How manage multiple images in Unity?

I'm new in Unity and creating a game. So I have a class PicManager in which I have to load my images(sprites) from assets into a ...
1
vote
2answers
248 views

2D Blizzard/Snowstorm Effect

How can I implement a blizzard/snowstorm effect in a 2D platformer? I have a particle system for snow particles, but I need some kind of windblown texture similar to this as well: How do I create this ...
0
votes
0answers
33 views

How to center tiles in scene (grid) without using 0.5 positions

If I create a tilemap, its tile anchors default to 0.5. This means that I need to use sprite positions like 1.5, 2.5, 3.5, etc. I'd prefer to use sprite positions like 1, 2, 3 instead. But I don't ...
2
votes
0answers
31 views

Quest UI Display in Unity 2D

I have this quest manager script where I store all my quests for easy duplication. I'm adding a feature that gives the player the option to see his/her current to-do quest. The first thing I ...
0
votes
0answers
51 views

Moving 100 sprites on mobile

I'm trying to achieve a good 60 fps performance with 100 moving Sprites on mobile. Objects are moving from top of the screen to the bottom, similar to falling cookies in cookie clickers. Objects are ...
-1
votes
1answer
33 views

The game is running but it gives me Object reference not set to an instance of an object error on console [duplicate]

When I play the game it works perfectly fine but it shows an error in the console when pressing buttons but it is still working just causing a bit of lag. This is the error: NullReferenceException: ...
0
votes
0answers
21 views

Laying out UI objects in a grid on screen

I'm creating a word game in Unity and really having a hard time understanding the screen/camera concepts on 2D. Basically there will be something like a header where the score of the user and some ...
0
votes
2answers
107 views

Collision detection in 2D games

I am making a basic 2D platformer. I want to get the relative position of one rectangle to another. This is how I do it right now: ...
2
votes
0answers
37 views

Sprites being skipped over in simple sprite change script

Each instance of the prefab in question has a copy of this script on it, but they seem to be interfering with each other in some way. I would forego prefabs, except the final game I'm prototyping for ...
0
votes
0answers
8 views

Implementing movement patterns using mouse mocap

I am working on a 2D action platformer and want to design some complex movement patterns for a boss that flies around the screen. Rather than describe the movement patterns using parametric curves, ...
2
votes
1answer
66 views

How to constrain a ball and chain like object?

Following up on this question, I have created a snakelike enemy which consists of a head followed by segments. I get the segments to follow the head by constraining each segment's position relative ...
0
votes
1answer
50 views

C# Unity - Multiplying Colors in loop results in wrong results

Good day, I'm trying to generate a tilemap, my current setup is a base tileset, and a few overlays for the different biomes / terrain heights. In my code, I generate each biome's tileset, based off of ...
1
vote
0answers
28 views

What are the extents of an Axis-Aligned Bounding Box (AABB) in Unity 2D?

In Unity 2D, you can attain values for collider2D.bounds.extents and collider2D.bounds.size. What are the actual "extents" of ...
1
vote
0answers
17 views

Android Game Save and Load doesn't work

I tried a few different codes but none of them work on my android device...I retrieve the data with this command " GameManager.Instance.gemsToSave" The code: ...
6
votes
1answer
261 views

How can I implement a revealing light beam?

In SEARCHLIGHT, you control a ray of light that illuminates incoming enemies that are otherwise invisible in the night sky. Here is an illustration: How would I go about doing this, preferably in ...
1
vote
1answer
112 views

2d water animation is jagged and not smooth

As a solution for this question I implemented the shader with a test program: ...
0
votes
0answers
44 views

How to make a glowing circular progress bar like this in 2d?

Notice the glowing effect, gradient coloring, and that glowing spherical “head”. Note: I’m using CocosSharp, if that can help.
0
votes
0answers
41 views

2D movement sporadic

Folks, My 2D movement is very sporadic when I press the designated keys. I have set "Space" for jump, "A" for left movement and "D" for right movement. Now I have used Update and FixedUpdate in ...
0
votes
1answer
75 views

What is best for 2D movement: velocity or AddForce?

So I have tried both Velocity and addForce but I'm not getting the result I was expecting which makes me wonder if I fully understand what they do. Move script (test script 1) ...
1
vote
1answer
41 views

How to implement multicolored flashing sprite effect like in Contra and the Messenger?

I want to implement an effect similar to what you see in this clip of Contra. When the boss takes damage, he flashes wildly with different colors. A similar effect can be seen in this clip from the ...
1
vote
0answers
23 views

How can I make a transparent hole with shaperenderer using stencil masking in libgdx?

I'm making a 2d game, where I need a resizeable, moveable rectangle outline. I'm trying to use stencil masking to do it by cutting a hole in a solid rectangle, and I thought this would help: How can ...
0
votes
1answer
126 views

Is it possible to make realistic animations in 2D?

I plan to make a skateboarding game and I am wondering about one thing: is it possible to make 2D realistic animations to simulate skate's and skater's rotations or should I resort to 3D for realistic ...
0
votes
0answers
31 views

(Unity) Flipping Character Sprite Depending on X-axis Movement? [duplicate]

I'm making a top-down perspective click to move game but my character sprite stays the same. How can I make it so that the sprite flips along the Y-axis depending on whether my character is moving ...
0
votes
0answers
30 views

Monogame Screen Tearing Between Tiles

I've noticed some 'tearing' or gaps appearing between tiles when the camera moves over a tile map, and I have no idea why. I should mention, the game is being drawn to a render target (320x192), then ...
-1
votes
1answer
58 views

Depth sorting issue

I've been working on a custom tile-based map editor for a while now, and everything works as expected, or so I thought until I've tried rendering the actual map including the dynamic objects as well. ...