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
0answers
6 views

Rotation and timer at the same time

I have a project where I flip a card after 5 seconds, then I want to start a countdown timer of x seconds. After x seconds the card flips again. I found a good example for the timer here, but that ...
0
votes
1answer
15 views

How to move dashes towards target?

Would you know how to create a dash line that moves towards the direction of the target, and if it collides with a wall, goes to the opposite angle? I have seen atan2 but I am not sure what it does, ...
2
votes
1answer
36 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 ...
0
votes
0answers
33 views

How would I change an object's fixed angle upon collision with another object?

I'm trying to get an object to change its fixed angle once it gets hit with an object via collision, unless there's a better way. This is the code that I was using for a slingshot weapon so I figured ...
2
votes
1answer
31 views

Replacing a sprite for another on runtime (Unity3D)

I need to replace the sprite of a face down card for another sprite (of a face up card). This is the C# script attached to the face down card: using UnityEngine; using System.Collections; public ...
0
votes
2answers
71 views

Why does this simple if-statement that checks my main characters state never get called (Java/LibGDX)?

Been working on this for a while - basically I want my player to perform a front flip when he jumps (screen tap -> player jumps). I wrote the animation class Animator (extends Player implements ...
0
votes
0answers
10 views

possible way to bring canvas 2d animation in canvas webgl context

when added 2d animation canvas in 3d webgl canvas as texture, 2d animation and 3d animation both stopped working. Any reference for this.
-1
votes
0answers
53 views

Which 2D Game Engines have a visual editor (similar to Unity)? [on hold]

I know Cocos2d-x has a visual editor called Cocos Studio. Are there any other 2D Game Engines which have a visual editor? ps. I'm not looking just for basic 2d game engines, they need to have a ...
-1
votes
5answers
3k views

Too much animation work for 2d characters. Creating 2d character animations by prerendering an animated 3d model?

I've read a bit about creating assets for games and the consensus seems to be that 2D is cheaper than 3D in all aspects with the exception of character animation. That's caused by the need of ...
0
votes
1answer
55 views
0
votes
1answer
151 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
0answers
26 views

3d or 2d engine for 2d game with 3 axis physic [on hold]

currently im developing game like this sonic, https://www.youtube.com/watch?v=KzsdBMg8eOA i think this game using 2d engine at first, and after work some time, i have confusion on the physic world, ...
0
votes
0answers
18 views

Unity PolygonCollider2D acts different on iOS Device

I'm instantiating new game object, then adding a SpriteRenderer component and attaching a sprite object, and only after the sprite is fully loaded, I add a PolygonCollider2D, to fit the sprite I've ...
1
vote
1answer
518 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
87 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 ...
2
votes
1answer
22 views

Collision detection between axis-aligned bounding box and bitmap (pixel perfect) terrain

Working on a Worms-type game, I have my objects in bounding boxes and they sit on the pixel terrain. Currently I am able to successfully do the collision detection for objects when they enter the ...
0
votes
0answers
32 views

Calculating Bounding Rect

I'm trying to clone space invader of atari and I have problem with bounding rect calculations.. the rect is not correctly bounded.. maybe I have problem with the transformations void ...
0
votes
1answer
54 views

Confused with how I should organize my code in a 2D game using OpenGL [on hold]

I've just now started learning OpenGL and I'm getting very overwhelmed and confused with some things. I don't want to permaturely optimize things, but I also don't make decisions about things I still ...
1
vote
0answers
58 views

How to make a sword swing effect

I'm working on a 2d java game on Slick engine and I always wondered how to make swing effects when striking with a sword? How to code something like this? ...
0
votes
0answers
25 views

Methodology for scenario creation [on hold]

We are going to create a 2D zelda-like game with an static world (not procedurally generated), where exploration and interacting with the scenario is the focus of the game. We have a rought idea of ...
55
votes
9answers
7k views

2D graphics - why use spritesheets?

I have seen many examples of how to render sprites from a spritesheet but I havent grasped why it is the most common way of dealing with sprites in 2d games. I have started out with 2d sprite ...
0
votes
1answer
53 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 ...
0
votes
3answers
87 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 ...
-1
votes
0answers
28 views

Basic concept of SceneGraph [closed]

Is there anyone who can explain me the basic concept of the scene graph? thank you
-1
votes
0answers
36 views

What should i use to develop multiplayer game online in browser on Java? [closed]

I'd like to develop a video game as a part of a learning process. I study JAVA. Previously I made one using Java applet. Somehow it works only on linux if you have installed IceTea Plugin and won't ...
0
votes
1answer
76 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 ...
0
votes
1answer
158 views

2D animated sprite jumping and gravity physics

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
71 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 ...
-1
votes
0answers
46 views

In the original zelda, what's the deal with the weird enemy names? [closed]

In the original Zelda, the enemies have bizarre names. I assume there was some problems with regionalization that made the names seem stranger than intended, but I can't find out exactly what ...
0
votes
2answers
63 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 ...
4
votes
2answers
270 views

Jelly ground collision

For fun I am trying to replicate the mechanics from The Floor is Jelly. So far I have successfully created "jelly islands/blocks" which are represented by an array of points and then drawn by using ...
5
votes
4answers
6k views

How do I find the intersections between colliding circles?

I want to find whether 2 circles with radii r1 and r2 intersect, and if so, where they do so. Is there a simple solution?
0
votes
2answers
35 views

Why is this 2d game object platform not moving [closed]

I found this code on a website and translated it to C#. While there are no errors, the platform still doesn't move. It's probably something really simple but I can't figure it out. My game scene: ...
0
votes
0answers
45 views

I have an array of blasts and an array of zombies, how can I efficiently detect collisions? [duplicate]

I have an array of blasts, and an array of zombies, but I'm struggling to find a way to efficiently detect collisions and remove both the blasts and zombies that have collided. Any suggestions? ...
0
votes
0answers
52 views

Steering problem in 2d game

I am creating a little 2D non tiled top down game. The enemy uses steering behaviour for chasing player or wandering around, but I do not think my code is working as it should be. My problem is, the ...
0
votes
0answers
84 views

Most efficient way to achieve the following 2D heat wave background effect?

In Unity, what would be the most efficient way to achieve the following heat wave background effect Super Metroid - SNES (skip to 34m 5s for those on mobile) http://youtu.be/yB317FOcU0Y?t=34m5s ...
1
vote
1answer
176 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 ...
-1
votes
2answers
71 views

Where to start developing a 2D puzzle game [closed]

I would like to start developing a 2D puzzle games, much like sudoku for example. I would like to publish it on Facebook and on gaming websites, like miniclip, agame, kongregate. The game should have ...
0
votes
1answer
38 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 ...
7
votes
3answers
298 views

Unity2D tall grass

I'm using Unity to create a 2D top-down game. Everything has been great so far, but I have come into a problem that I fail to solve properly. I want to implement "tall grass areas" where part of the ...
0
votes
1answer
51 views

Drawing faded lightmap in 2D polygon

I have been making a 2D visiblity algorithm by following this tutorial http://simblob.blogspot.se/2012/07/2d-visibility.html I have managed to create the light vertices and it works fine when I draw ...
1
vote
1answer
186 views

AI movement in 2D

I've got a prototype of a game I've been mocking up and found myself struggling to find a solution for AI movement in a 2D tile based game. Here's the issue: The player is free to roam throughout the ...
0
votes
1answer
73 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
79 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
30 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 ...
0
votes
0answers
10 views

Smoothly scaling positions of GraphicsItems on a 2D GraphicsScene

I layout a bunch of nodes on a QGraphicsScene(A 2D Canvas). The nodes are basic ellipses. It works reasonably well. However I would like to know how to better size the ellipses. Currently I have a ...
1
vote
0answers
16 views

Unity Javascript GUI.Button shows up twice

Hi I have created a simple menu in Unity but I wanted to create my own style for colour/fonts. However for some reason it prints each button twice to the screen, once with my custom style, and once ...
0
votes
1answer
42 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 ...
0
votes
0answers
19 views

organised sprite sheets for hobby game dev [duplicate]

does anyone know of any good sources of sprite sheets? I have found many good sites like spritedb and found a nice source on somewhere called sigtutorials . However, am I just being dumb or are they ...
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 ...