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
23 views

“Orbiting” four objects to a specific point over time

I'm hoping my image makes sense as it is the best explanation for what I'm trying to do. Basically, I have four objects (think of them as a moving rectangle: x,y,w,h) that start all in a row beside ...
1
vote
1answer
50 views

Dot based light mask with shader on sprites

So I have a scene, completely based on 2D sprites. I want to render "light sources" into a seperate frame buffer (so mostly dots around, for example, the centre of a flame) and then render that frame ...
0
votes
1answer
42 views

How do I make a time lapse in my code so it updates slower?

I have made some collision if statements, but they didn't work. birdbox3.X += 5; birdbox3.Y -= 5; if (birdbox3.Intersects(Banner1)) { birdbox3.Y ...
0
votes
1answer
21 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
2answers
63 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, ...
3
votes
1answer
53 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
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.
2
votes
1answer
36 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
0answers
27 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
1answer
60 views

How can i calculate that normal lays in same part of plane with point?

I.e. n0 for A and n1 for B. Plane divided by plane CD.
0
votes
0answers
34 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
0answers
20 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 ...
0
votes
1answer
56 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 ...
2
votes
1answer
23 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 ...
1
vote
0answers
60 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
26 views

Methodology for scenario creation [closed]

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 ...
-1
votes
0answers
29 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
37 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 ...
-1
votes
0answers
47 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
70 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 ...
0
votes
2answers
36 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
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 ...
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
53 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
85 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
votes
2answers
73 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 ...
0
votes
1answer
53 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 ...
0
votes
0answers
12 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 ...
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
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 ...
1
vote
0answers
17 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
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 ...
1
vote
1answer
34 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 ...
0
votes
1answer
29 views

switch between player camera/non-camera positioning

Sorry if this sounds ambiguous. But I am writing a traditional top down game. And normally the player would be centered in the middle while moving the orthographic camera. However, I would like this ...
1
vote
1answer
67 views

OnMouseUpAsButton not always called

I'm working on a 2D implementation of Free Cell in Unity 4.6.1, and I'm having trouble getting my click-detection code working consistently. The code below should be called every time a card is ...
1
vote
1answer
32 views

How to make a scrolling background in Delphi with FireMonkey?

I'm making a scrolling background game alike classic Mario 2D games. How do I make a scrolling background in Delphi XE7 using FireMonkey?
5
votes
4answers
419 views

Difference between Update method and FixedUpdate in Unity?

i am starting to learn Unity3d and one of the confusion i get is difference between Update() and FixedUpdate(). I am following Lynda Unity 2D game development tutorial there, the instructor uses ...
6
votes
1answer
166 views

How to make Line Renderer lines stay flat?

I've noticed that as I add more vertexes to a Line Renderer line the line twists and stops being a smooth line. .GIF Here: http://i.imgur.com/hRAhCXM.gif All lines are on the same z level, even ...
0
votes
0answers
36 views

2D Platformer Pathfinding [duplicate]

First of all, I'm sorry, I know this is a really broad topic, but I've been trying to do this for days, I've looked at about a hundred different Google links, and I'm just not having any luck. ...
0
votes
1answer
51 views

Path finding for Vector Based System

I understand that typical path algorithms are based on nodes in a graph (not tiled nodes or whatever), but i can't get my head around to find an idea how to implement a path finding algorithm for a ...
0
votes
1answer
51 views

2D game with angled top-down camera perspective [closed]

I want to create a game similar to binding of isaac, a slightly angled top-down 2D game. In binding of isaac, the character moves and shoots along a 4-way path, so when he is shooting towards East, ...
0
votes
0answers
20 views

How to display armor/equipment on a character? [duplicate]

I've been working on an Online 2D RPG mostly for fun and for getting a basic understanding of Socket Communication, packets, and just basic game development. Like most RPGs there is some kind of ...
2
votes
2answers
219 views

How can I generate a 2D mountain landscape procedurally?

Every level in my game needs to have a different mountain landscape background generated automatically (but the landscape must be the same for each level). How could I generate such a landscape ...
0
votes
3answers
88 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 ...
0
votes
1answer
41 views

How to determine whether a given line intercepts another

I have a collection of lines: List<Line> _lines; Each has the properties: X1, X2, Y1, Y2 How can I determine whether any given line in the list (Line[n]) intercepts, at any point, any other ...
1
vote
3answers
195 views

Create random polygon shapes

I want to make a random shape made out of points. I want the points to create a polygon shape. Is there a clever way to create a random shape like this? Im thinking going throug X points and giving ...
0
votes
0answers
52 views

2D GLSL Lighting and Sprites

I'm trying to make a 2D game engine, and I really want to support ambient light as well as multiple point lights that you can define the color, intensity, radius, etc from uniforms in glsl shaders. ...
0
votes
1answer
60 views

Trying to add a feature to my (basic) level parsing algorithm - not sure how to (JAVA)

Right now this method goes through a list of GameObjects (e.g. JetPack, Platform) with their respective x and y positions in a text file called level1.txt: platform 840 280 platform 1130 280 coin ...
0
votes
0answers
35 views

Fake Lighting 2D Space Java

I have an image that I want to be used as the light. The white are should be drawn, the black should not. I need the light to be tinted to whatever color I pass to the light object. I have code ...