2D games are drawn in a two-dimensional space using two-dimensional objects. To represent its position, each game object will have an `x` and a `y` coordinate.

learn more… | top users | synonyms

0
votes
2answers
150 views

Basic 2d platform collision detection algorithm has a slight bug (Java)

I'm trying to implement collision detection between Player (the main character) and a Platform. They are both modelled as rectangles; when player hits the side of a platform he should bounce off it ...
1
vote
1answer
51 views

How do I make my main character move towards an object? LibGDX/Java

What I want to happen is for my player to bounce from spring to another. For example take the illustration below: Here's my code (what I've tried to do so far). This gets called in an ...
0
votes
0answers
12 views

PlatformEffector2D “Collision Pop” Avoidance?

I have noticed that when "One Way" is checked, and you have your character jump up through the platform, the character pops up to the top as a way to resolve the collision of the player and the top ...
0
votes
1answer
327 views

In Unity, how do I create a drag and drop object?

I have a 2d scene. I want the player to be able to pick up an object, move it around the scene and drop it somewhere. I can't find any way to do this, and all of the resources for Unity are really ...
0
votes
1answer
35 views

Sorting sprite's layers in isometric view

I'm making a strategy game with isometric view and I'm having some problems with deciding which sprite should be drawn first (I'm using SFML 2.2 as graphic library). I'm using std::sort to sort ...
0
votes
0answers
33 views

Free 2d Game Art Program Needed [on hold]

So, basically, I am making a 2d game, and I need a free program to make the sprites and textures, and cannot find a good program to do it. I can't use Gimp, as the interface is crappy in my opinion, ...
1
vote
1answer
585 views

Spritekit - gradually apply force vector in different direction (space ship turning)

I have a space ship that I'm applying a force vector to using a joystick for control. I would like this to smoothly fly around when I'm switching directions.. Exactly like minisquadron if you've ...
0
votes
1answer
152 views

Can't play animation from script in unity

I'm making a 2D sidescrolling game in Unity, and when the player shoots an obstacle, I want the obstacle animation to play and then destroy itself. I got it to destroy itself, but the animation won't ...
3
votes
2answers
131 views

2D Physics: What happens with torque when center of mass changes?

Novice programmer and explorer of simple 2D physics, here. I have a simple 2D object made up of two rigid bodies connected at a fixed joint. The two rigid objects can rotate freely about that fixed ...
3
votes
3answers
136 views

How do I get rid of this coloured border on my sprite?

I'm working on a 2D game in Unity. My triangle sprites display in-game with a line along one of the transparent sides: Larger view here. You might need to zoom somewhat. It's quite obvious on the ...
0
votes
0answers
34 views

How to update gametag and call a new animation? [on hold]

I want to change the tag of an game object when a new animation is triggered by the animator parameter. This works, but when my gameObject tag is changed from "fire0" to "fire25" it doesn't change to ...
0
votes
0answers
42 views

I'm looking for an outline of a simple 2D game architecture, as my projects always get overcomplicated [on hold]

So quick backstory: I'm currently getting into game development with C++ and SFML for graphics. I have a pretty solid grasp of C++ so my question is not really language related. What I've been ...
0
votes
1answer
80 views

Using collectable items to change a gameobject Unity

I’ve been working on a 2D platform side scroller. I’m rather new to Unity and C#. Basically what I’ve achieved so far is a character which can collect Logs throughout the game and those logs are ...
1
vote
3answers
95 views

Calculate intersect point / aim point

I'm working on a simple game, and I need to calculate the position to aim. Since my math days are a bit behind me, I put together a simple example to illustrate: So given that I know the position ...
1
vote
1answer
33 views

(Java) Trying to animate an arraylist of coins with a (working) animation class

I have a coin class which takes in an integer numOfCoinsand an enum LayoutType, which can be linear or curved. A linear layout displays the coins in a straight line one after the other - we'll work ...
0
votes
1answer
66 views

How do I make this block go back to the left with another click?

This is the script I've written so far which makes the block move from the left of the screen to the right on a mouse click. What I want to achieve is for the block to move back to the left when I ...
2
votes
3answers
132 views

Creating a unit selection box in Unity (2D)

I've been trying to get my head around how to create a selection box for a selected unit in a 2D top-down type game. When you click on a unit, a small box would appear around that unit based on some ...
3
votes
2answers
98 views

Can I use the HD Graphics 3000's quad list primitive type via D3D?

I was studying some technical documentation on the Intel HD Graphics 3000 GPU, which I'm using as a lower-end reference for my 2D game engine. I noticed the hardware supports a nice "Quad List" ...
0
votes
1answer
91 views

StartCoroutine inside TriggerOnEnter2D isn't working

I am new to this, but I need help with a CSharp script. I need to collide with the desired object, pass the game to be 1.6 in TimeScale. After passing 8 seconds in the game, change back to 1 ...
2
votes
1answer
10k views

How can I programatically generate sprite instances in Unity?

I want to create a block-based puzzle game that generates blocks as they are required, however I cannot seem to find any good information on how to do something like this using Unity's new sprite ...
1
vote
1answer
47 views

How to create a ladder script in Unity [on hold]

I tried to create a climb script and found some similar code. I would like to climb with my player on a ladder. I came up with the following: bool canClimb = false; float speed = 1; GameObject ...
-1
votes
1answer
66 views

How to attach 2D object to a rope?

I was wondering, how I can attach a game object (player) to another object (a rope) when both came in contact in Unity. I think it should be done with a OnTriggerEnter2D, but doesn't know how I should ...
1
vote
1answer
94 views

Unity - Basic AI Enemy Follows Player - Prevent Flocking Of Enemies Together

I'm in the process of implementing a 2D top-down shooter game. I have a basic AI script that allows enemies to follow the player around. Currently it works fine for one enemy, but as soon as there are ...
1
vote
1answer
73 views

How to add a UI Text for keeping Score in Unity 5

My Problem is simple I want to show scores on my game. The examples on internet are good but in Unity 5 there are no GUI elements but instead these are now UI elements. I was following this example: ...
-4
votes
0answers
83 views

What is the best game engine for indie game development? [closed]

I always wanted to create a game, nowadays it seems to be possible with no budget/a small budget and all by yourself. With the news of Epic Games releasing Unreal 4 for free, Unity releasing Unity 5 ...
0
votes
1answer
172 views

2D animated sprite jumping and gravity physics [duplicate]

I'm currently writing a Megaman clone for my school project. So far all I did was making the character run and stay put when needed. Know I want to be able to make him jump using the 'X' button. I ...
0
votes
1answer
90 views

Creating a separate renderer for entities in a 2D game

I'm making a 2D shooter game. As of now, every entity "draws itself", meaning every renderable entity has a draw function. I know it is better if rendering is handled separately, but how can I achieve ...
0
votes
0answers
49 views

How to design this kind of images [closed]

I am new here and I hope I do things right. I am a C++ programmer who wants to learn new things, and I am now trying to learn how to illustrate in 2D for games. I don't know if this question belongs ...
0
votes
2answers
36 views

onCollisionEnter2D not behaving as expected

I have two game objects. They both have a Rigid Body 2D and a Box Collider 2D components. One of them also has script component. Below is the full script using UnityEngine; using System.Collections; ...
1
vote
1answer
90 views

Does game engines (like Unreal, Unity, Crafty) add value compared to pure js frameworks (react, ember..) for my isometric tile-based games [closed]

I'd like to create a huge tile-based board (say 100K tile). The game does not have any advanced graphics (you don't see the players or landscapes), the main difficulty is that it has 100K tiles to ...
1
vote
1answer
248 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 ...
0
votes
1answer
49 views

Animation fails due to a NullPointerException which I'm certain shouldn't be thrown (LibGDX / Java)

What the title says basically. I've been stuck on this error for a few hours I got it to work earlier but I honestly can't see why its failing now (ctrl + z'd back to the working stage). Here's my ...
126
votes
9answers
28k views

How did LoZ: A Link to the Past handle sub-tile collisions?

The Legend of Zelda: A Link To The Past is rendered with 16×16 tiles. How did they implement collision with tiles where only a quarter or half is occupied? You can see such tiles in the cliff corners ...
-1
votes
0answers
20 views

What size sprites should I use for developing a 2D game for iPad Air and iPad mini? [duplicate]

I am developing a side-scrolling platformer that will run on an iPad Air and iPad mini. I am not sure how big to make my sprites/textures to ensure everything looks good on the retina screens. 1) How ...
0
votes
0answers
26 views

Collision Detection acting weird

I started learning programming in java. and I've decided to make a simple game but, got a problem in collision detection. The problem here is that the collision detection is sometimes not working. ...
0
votes
1answer
88 views

How to “piece together” an image in code, to render later?

I want to make a game in Dart and have decided to use the available port of the JS Phaser game engine. This will be my first time really making a game involving graphics so I guess I'll have a lot to ...
0
votes
2answers
107 views

Unity2D Collision Issue

I have a crate setup (in pic below) with a rigid body component, box collider and 3 circle colliders(they allow me to push the crate most of the time without getting stuck on the floor textures which ...
0
votes
1answer
40 views

Player position on second player connection

I'm having some trouble trying to run my game for the multiplayer part. I'm creating a 2d game. I have followed this tutorial : ...
0
votes
0answers
23 views

Efficient point-in test on static Polygons

I have some convex 2D polygons that are static and I would like to create an efficient point in test for them. I'm pretty new to this area of study so I just want to make sure I haven't made an error ...
0
votes
1answer
50 views

LibGDX - Executing 2 different touchDown events in the same method

On the bottom left of my screen is a circle with an Arrow and on the bottom right is a circle with a gun. If the player is in jetpack mode and the Arrow "button" is clicked he flies like flappy bird ...
1
vote
1answer
46 views

Position and rotate a 2D point array into a 3D world

I have a set of 2D points (defining a flat 2D 'connect the dots' shape). I want to calculate the 3D positions for these 2D points at a specific 3D position and rotation. For example, say I have five ...
0
votes
1answer
53 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 ...
1
vote
0answers
23 views

PRNG/Encripting Algorithum that returns the same number if given the same input?

I've been trying to find an algorithm that will take in an x value, a y value, and a seed value and then spit out a number between 0 and 255 (or an int that I can cut up into bytes). I want to be able ...
0
votes
1answer
49 views

My Raycast will not detect collisions in my Unity 2D project. What am I doing wrong?

I appreciate any help you can offer me. I created a script for a character controller that casts two rays below the player's gameobject. The rays extend infinitely and should collide with another ...
0
votes
1answer
1k views

Slope polygon collider 2D causing box collider 2D to 'bump' while sliding on it

I'm doing procedural terrain generation. So far I've created the mesh, and attached a 2D polygon collider to it. The terrain is made up of hills going up and down. After doing so, I put a 2D rigid ...
0
votes
1answer
57 views

Math for 2d movement with max speed?

I need some help with math in a 2d environment. I have a joystick that controls the acceleration vetor for the player figure. Its suppose to look like the ground is slippery which makes the figure ...
0
votes
1answer
90 views

Why my dynamically generated Sprites overlap?

I'm trying to dynamically generate scene representing chess board made from sprites. I'm using two textures for these: - pieces.png (taken from here: ...
2
votes
2answers
66 views

Creating LOS zones on a 2D grid for chase AI

I have a 2D grid, around 20x20, stored as an array. Each grid cell can contain an opaque object or not. I also already have an algorithm to calculate LOS between any two squares via Bresenham. I want ...
1
vote
1answer
173 views

What is the correct multiplication order for a 2D matrix?

I'm currently trying to create a camera and entity/model matrix for my 2D game similar to that of Unity3D. I've already tried to find answers to this question on stackoverflow/gamedev but i couldn't ...
0
votes
0answers
23 views

Are there conventional 2D isometric axis directions?

I'm making a 2D isometric game, but now that I gotta decide which direction X and Y increase, I think it would be best to consider the common practice. In which directions do each of the axes usually ...