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
18 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
36 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
70 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 ...
3
votes
2answers
90 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" ...
1
vote
1answer
31 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 ...
1
vote
1answer
41 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
vote
1answer
84 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
57 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: ...
-1
votes
1answer
62 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 ...
-4
votes
0answers
76 views

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

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 ...
1
vote
3answers
89 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 ...
0
votes
0answers
48 views

How to design this kind of images [on hold]

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
34 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; ...
0
votes
1answer
82 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
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
25 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
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
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 : ...
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 ...
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
55 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
48 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
0answers
21 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
23 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
62 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
13 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
70 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 ...
1
vote
1answer
44 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
130 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
18 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
153 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
97 views

Creating a 2d look sprite sheet and textures out of 3d models [duplicate]

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
37 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
33 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
94 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 = { {#,#,#,#,#}, ...
1
vote
1answer
85 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
58 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
29 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
116 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
121 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
18 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
61 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
63 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
45 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
34 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
64 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
39 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
79 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
128 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
39 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 ...