Questions tagged [2d]
2D refers to two dimensional space where coordinates are represented with X and Y values.
424
questions with no upvoted or accepted answers
7
votes
2
answers
625
views
Shrink a convex polygon
Shrinking a concave polygon is quite hard, to do well. But I expect shrinking a convex polygon would be easy.
The naive approach of moving each vertex a certain distance to the centre gives me poor ...
5
votes
0
answers
2k
views
Unity 2D: How to make player grab a ledge, swing and jump to another
Since I'm not a native speaker, it's hard to explain in english what I want to achieve, so I'm gonna use a couple of images... basically I want to make an interaction of this type:
in a 2D game, so ...
5
votes
0
answers
232
views
Implementing rubber rope
I'm using LibGDX to implement rubber rope in which player can fly and launch. I know I could use Box2D as physics engine and I'm going to one day, but I'd like to learn it myself for now.
I've ...
5
votes
0
answers
376
views
How to target moving object in 2D game
I am working on targeting system for 2D game. Two objects move in space.
Each one have Position and Velocity vector. Ship object shoots moving objects in space. Ship can shoot in any direction, but ...
5
votes
1
answer
327
views
Draw GUI.Button on certain position on a scrollable background
Problem is in a 2D game I have a large background around 2 screens wide. And on there I got 4 buttons placed on top of background all over complete width. Now when I swipe of move my mouse around I ...
5
votes
1
answer
193
views
Fixing the size?
My app isn't compatible with all screen sizes. When testing on a small size, my textview overlaps with my button. So, as suggested on the Android Documentation, and many stack overflow pages, I ...
4
votes
1
answer
1k
views
How to correct this issue with a top-down aiming angle in Unity - 2D?
I'm trying to build my first project and I'd like some input for a math correction. The game is a top down 2D shooter, a bit like the iconic "chaos engine" from SNES.
The issue is that either the ...
4
votes
0
answers
148
views
How can I connect multiple explorable regions into one large map?
I am planning a 2-D science fiction game involving spaceships. A major thing that I am having trouble figuring out is how to create a 2-d array of smaller maps that the player can explore.
My ...
4
votes
0
answers
4k
views
How to create water with ripples in custom places for top down game in Unity?
I want to make topdown row boat game with Unity. I want graphics to be simple (sprited), but the water must be "very nice" and realistic and it should reflect movement in it (paddles and boat movement ...
4
votes
1
answer
534
views
How can I apply a "genie animation" to a CCSprite?
I am new to Cocos2D and following this tutorial.
I want to animate a CCSprite with the genie effect that OS X uses for hiding windows to the dock and showing them ...
4
votes
1
answer
134
views
How to make expanding ring with constant thickness?
I need to generate this burst or (donut-shaped) pulse.
I'm having a difficult time how to generate such shape.
At first, I was thinking of scaling the image but that didnt work out because the line or ...
3
votes
0
answers
105
views
Faster convergence in a physics engine
I've got my hands on the first edition of the book Game Physics Engine Development: How to Build a Robust Commercial-Grade Physics Engine for your Game by Ian Millington. Because I didn't really know ...
3
votes
0
answers
367
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 ...
3
votes
0
answers
129
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. ...
3
votes
0
answers
275
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 ...
3
votes
0
answers
48
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 ...
3
votes
1
answer
2k
views
How can I move a vehicle using speed and steering angle?
I want to drive a vehicle in x and y coordinate area with range from (0,0) to (6000,5000). I am using Visual Components (using Python API).
On input I have speed data and steering angle of wheels ...
3
votes
2
answers
772
views
Efficient 2D grid overlay on tiles without each cell being its own GameObject
So for my game I need the ability to add a grid overlay over my tilemap. Now I don't think that making the grid with each cell being its own GameObject with some SpriteRenderer would be hard to do but ...
3
votes
0
answers
96
views
Unity: Messages in Compound Colliders
Lets say I have a 2D character with two colliders: a circle collider that represents the feet, and a box collider that represents the body. Lets say that the character is currently standing on the ...
3
votes
0
answers
419
views
Why is my 2D mouse aim not working properly?
I'm trying to program 2D mouse aim, where the arms and the gun in the arms rotates to point at the mouse. But for some reason, the arms and gun rotate and do not follow the mouse position.
The each ...
3
votes
0
answers
551
views
Enabling OpenGL lighting seems to disable blending
I have the following code to set up for some 2D drawing using OpenTK. I originally wrote it without any lighting considerations, but later added the lighting block. This version of the code uses ...
3
votes
0
answers
91
views
Problem with rendering in my game when using a following camera
I've got an issue while rendering 2d images with my own simple 2D camera object.
First my setup:
a star initial position 0,0
a planet circles the star initial position 300, 300, moves at a radius of ...
3
votes
0
answers
899
views
Pixel Art size for different resolutions
What size I should make the UI elements (mostly buttons). How do pixel graphics look good on all resolutions? How would I get to know what size I need the buttons or other pixel graphics overall?
3
votes
2
answers
2k
views
Improving bouncing logic - Atari breakout clone
I'm creating an Arkanoid clone using Haxe and Openfl. I'm thinking the bouncing algorithms could be improved. But I'm not sure how to handle those. I was hoping you guys could help.
...
3
votes
0
answers
790
views
Proper Line of Sight in tile based game
My rendering engine currently takes "xMin, yMin, xMax, yMax" to render a rectangular region of tiles, and will automatically scale based on the size of the panel it is rendering to.
However, I am ...
2
votes
0
answers
44
views
Unity 2D Sprite Cutout with border
I'm working on a 2D simulation game and have one object floating on top of another one. I have a Sprite Mask on the object on top to achieve cutout like effect so the background is visible where the ...
2
votes
1
answer
75
views
How do I get the consistent time it would take for two points to reach each other in circular motion?
I'm making a 2D game. It involves the player swinging around a grapple hook in perfect circular motion, however, I want to make the cooldown for this ability based on predicted end position for the ...
2
votes
0
answers
63
views
2D game make precise collisions
I am currently creating a personal 2D tile map game in Java. This is the first time I have attempted to make any sort of game, so I don't have a lot of techniques known by experienced developers.
...
2
votes
0
answers
573
views
How to load parts of a large tilemap like chunks in Unity 2d?
I use more pictures so you can understand my opinion better.
Here is the video link I recorded.
My code has a problem that I use for to render it and cause it to "lag" for 1-5 seconds, so I ...
2
votes
0
answers
129
views
Automatic 2d tileset textures
I am currently trying around with automatically generating a dungeon.
I'd like to use this tileset https://opengameart.org/content/a-blocky-dungeon
TLDR: how do I automatically apply a texture to a ...
2
votes
1
answer
948
views
When setting Rigidbody.isKinematic true collider won't work anymore
I have a rigged 2D character and used Collider2D/Rigidbody2D/HingeJoint2D to body parts to implement ragdoll.
It works fine, but I needed to run ragdoll physics only when character is dead. So I made ...
2
votes
0
answers
40
views
Lighting not working in a 2D JavaFX game when using subtracting shapes?
So im trying to add lighting into my game. I'm using shape subtracting and unions to subtract circles (the lights) from a dark rectangle that covers the whole world. I think that its a problem with ...
2
votes
0
answers
1k
views
Unity2D TileMap Collider Update Optimization
I'm currently working on a 2D tile-based side-scroller (similar to Terraria). I am using Unity's TileMap feature to draw tiles onto the screen and have my player collide with them as if they were ...
2
votes
0
answers
207
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 ...
2
votes
0
answers
100
views
Handling a smooth movement over slopes in a worms like game
I currently have a worms like game with the worms style pixel perfect terrain destruction. Its working well for pushing things around and watching them fall, but for the players movement it feels like ...
2
votes
0
answers
437
views
Optimal solution to render sprites with transparent edges in Unity
Since I'm currently developing a 2D game for mobiles, overdraw and drawcall count is my first priority in the design of the application
I've thought initially to split each sprite in two parts: one ...
2
votes
0
answers
126
views
Bullets moving with the camera, not the world, Java 2D
I'm building a simple 2D Top-Down shooter game in Java.
I simply cannot get this to work:
I'm moving the camera and world differently. The world is moving when needed (when not in one edge, so it ...
2
votes
0
answers
271
views
How to go about implementing pathfinding in Unity with Tiled2Unity map prefabs?
I have created a map using Tiled application and have added collision boxes and used Tiled2Unity to import the map to Unity. The collisions are working with key ...
2
votes
0
answers
2k
views
OpenGL Render Queue Design
I am currently designing the rendering system for a 2D game built in C++ and OpenGL, and am unsure about how to go about implementing a sorting procedure to maximise efficiency and minimize OpenGL ...
2
votes
0
answers
206
views
Sprite animation in Android view
I'm looking for a way to have different sprite animations in individual Android views.
I try to use LibGDX and AndEngine but most I could find was how to get an Activity with the sprite animation.
...
2
votes
0
answers
575
views
2D Skeletal animations exported to SVG
I would like to create skeletal animations, and Synfig looks quite promising.
This is a video walk through
of its "bones" feature, used to do skeletal animation.
Ticks all the boxes thus far, ...
2
votes
0
answers
179
views
2D Polygon Collision push direction with large polygons
I have a collision detection/resolution implementation that uses the Separating Axis Theorem. Detection and such works perfectly fine, as well as resolution for most objects/shapes in my game.
...
2
votes
0
answers
585
views
How to get rid of half pixel artifacts?
I've been having a bit of trouble using OpenGL to make 2D games. I am using a traditional ortho perspective with just some sprites being rendered and moved around.
It all works perfectly but there is ...
2
votes
0
answers
297
views
scale rotating boundingbox
I want to use basic rectangular collision detection. I have a rotating sprite and a method that calculates the bounding box every time in the Update() method. I simply check for intersection between ...
2
votes
0
answers
225
views
How can I use iteration to lead targets?
In my 2D game, I have stationary AI turrets firing constant speed bullets at moving targets.
So far I have used a quadratic solver technique to calculate where the turret should aim in advance of the ...
2
votes
2
answers
1k
views
Unity 2D ROPE connected to moving platform
Hey guys I have realy big problem with my rope. I use a hinge joints 2D to create my rope and distance joint to connect it with moving platform.
On moving platform I have a distance joint that show ...
2
votes
1
answer
272
views
Is there a method to add partial scorch marks or decals on top of existing sprites?
Let's say what I have is a planet like so:
What I want to do is to add a scorch mark like this:
Now, if this was a one time thing, it wouldn't be a problem. I'd make a sprite for this specific ...
1
vote
0
answers
32
views
Saving Tiles in an irregular grid
I have a grid, which the user can expand as he wishes. Since I don't know how big the grid will end up (and many tiles will stay empty) a two dimensional array (...
1
vote
0
answers
76
views
2D faux gravity walk/stick to a planet
I'm trying , to make a Player walk on a planet , through searching , I figured out that I can achieve this effect using Faux gravity , I tried to Implement it , but it's not working as intended:
...
1
vote
0
answers
44
views
Animation clip that acts relative to the object's current position
I am making a 2D game in Unity and I want to create an animation that works with any object and takes that object's position into account.
The animation should be a little bounce, basically move it up ...