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.
0
votes
0answers
13 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 ...
0
votes
0answers
16 views
How to use Android Sensor, only in x axis
I have seen some tutorials but they are very complicated and they are about the three axes (x,y,z). So I want a code that moves an object or more (for example) to the right or the left when the ...
2
votes
2answers
47 views
How to select random points within grid meeting min/max distance requirements from each other?
I have a 2D grid map that is relatively large. I'd like to pick some semi-random points all over it (say N points). The rule I want to ensure here, though, is that any selected points are at least M ...
0
votes
0answers
12 views
2D smooth Rotation Unexpected
I am trying to get a smooth 2D rotation and this semi works but only in (-x, +y) I have tried using a lerp but I still get the same result.
So I believe, it has something to do with the rot_z value ...
1
vote
1answer
55 views
How To calculate camera boundaries
Is it possible to calculate the exact camera bounds? By this I mean the white lines that represent the camera area e.g the lines in the picture:
I'm using Camera.main.screenToWolrdCoordinates to ...
0
votes
1answer
45 views
Make tiled spritesheet [on hold]
So i've got some sprites from the kenney site. I'm using Tiled to make maps with the spritesheet from kenney.
My problem is that i cant get to use all elements in the spritesheet, cause if the size, ...
1
vote
1answer
32 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
2answers
116 views
Space invader barrier implementation algorithm
I've been struggling with implementing the space invader bullet to barriers. I wanted right now to blast a circle around, when the bullet hits the barrier and modifies the circle. As shown in the ...
0
votes
0answers
17 views
How to get camera to follow player, but stop when reaching end of screen? [duplicate]
I'm making a 2D game in Unity and I'm having issues with the camera.
I need the camera to stay within the boundaries of the level (the background sprite), but then follow the player around the level.
...
0
votes
3answers
125 views
Collision between AABB and Circle
I'm programming collision systems for a 2D game engine. The idea is that different systems can interact with each other. So one of the cases would be check collisions between axis aligned bounding box ...
1
vote
1answer
82 views
Creating a 2d look sprite sheet and textures out of 3d models
I'm trying to make a 2d game (rpg top down), and I've got no 2d artists help me out making 2d characters and textures, but I have one who can make 3d stuff (using Blender and 3d Max), I was wondering ...
1
vote
1answer
35 views
LibGDX/Java - Trying to find the vector from one object to another
I want to add springs in my game that work like the ones in sonic - i.e. if you can't get over an obstacle you have to hit a spring which sends the main character flying towards another spring that ...
0
votes
0answers
30 views
Per pixel collision using marmalade bug
I'm trying to implement space invader, collision with barrier in which you blast some pixels, for the time I'm drawing a circle, right now I get correct collision but only on the bottom of the ...
0
votes
3answers
83 views
What would be a good way to implement a large 2d map? [duplicate]
I'm thinking of a way to implement a large 2d map which can be easy to handle a certain area of the map to update.
I've seen many 2d map using double array like
int[][] gameMap = {
{#,#,#,#,#},
...
0
votes
0answers
30 views
How much can Instantiate slow down my game Unity [closed]
I want to create a game like pang 3, so you have balls bouncing and you shoot them. Every time you hit a ball it will create two balls smaller than the ball that you hit, except when you hit the ...
1
vote
1answer
77 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
56 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
28 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
104 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
97 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
13 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
50 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
1answer
61 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
42 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
27 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
60 views
Confused with how I should organize my code in a 2D game using OpenGL [closed]
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
36 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
73 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
2answers
95 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
0answers
35 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
59 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
95 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
84 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
40 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
60 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
34 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
78 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
20 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
41 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
30 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
70 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
44 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
468 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
186 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
37 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
52 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
65 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, ...