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

How to keep a shape inside a rectangle

So i'm making a game which is based on randomly generated rooms and i need a way to keep the player inside them and make the player glide when he collides with the room's bounds. I currently have a ...
0
votes
1answer
27 views

Unity 2D - scale sprite according to screen width

So I have a square sprite (width == height) and I want to scale it so that both width and height are exactly one fifth of the width screen. To find the desired pixel width I do: float ...
0
votes
1answer
26 views

How do i load, render and trasnform 2D images using Direct3D 11 API?

In my small game project using DirectX 11 API, I created a Direct3D device, and can draw 3D meshes, using web tutorials and a book. But I cannot figure out how to load, transform (rotate, scale, ...
0
votes
0answers
41 views

2D Collisions side detection

I've been working on a 2D collision system for my games and came up with something. I need the collisions to check against any sized rectangles. I understand how to check for overlapping rectangles ...
2
votes
1answer
700 views

What is AABBvsAABB Collision detection?

Currently studying Game Engineering at university and my lecturer has asked us to implement a collision manager. He asks us to use AABBvsAABB to build it, so then we can add the physics. My question ...
1
vote
1answer
16 views

Monogame - stopping a custom shader (drawable game component) when inside another drawable game component [closed]

I have run into a bit of trouble when using a custom shader (gaussian effect) within another drawable game component, as I cant figure out how to break out of the draw method, so the effect is applied ...
2
votes
1answer
57 views

How do I render an object's position trail of a constant length?

I want to show a trail of the last points that the object has been in, but I want that trail to always be a certain length, regardless of the object's speed. How can I do that? At the moment, I ...
1
vote
0answers
48 views

Create a 2D orbit trajectory like in angry birds space and a circular orbit

I am working on a 2D game, and I am working on adding some space physics : I need to find a way to create a circular orbit and an orbit like angry birds space ( the spiral trajectory ) . So there is 2 ...
1
vote
1answer
60 views

Unity 2D: Sprites/Diffuse is making my character weird, like an antialias

i'm trying to put light and shadows on my 2D character but when i set the material on it to Sprites/Diffuse, it's kinda putting a strange smooth on my pixels. Without diffuse: With diffuse: And ...
2
votes
1answer
27 views

Java Libgdx: How do you add cells to a TiledMap?

I'm trying to make a Side-Scrolling game that will allow you to place/remove tiles. I'm using the TileMap Editor to render the custom Tilemap but is there any way to add tiles? I have it where I can ...
-1
votes
0answers
53 views

How should I structure game flow (2D sidescroller in C++)? [on hold]

My question is more specific than the title implies but seemed to long to fully expand in it: My conundrum is whether responding to game events (i.e a collision with solid geometry, picking up items, ...
0
votes
1answer
46 views

Any way to visualize how will game objects look on different screens?

After completing my game and sending it to a bunch of friends with different devices, they complained about how some game buttons were too small. (I have developped a touchscreen game but after ...
0
votes
1answer
42 views

Unity 2D: Change one instanced prefab then make all the others on the scene like it

I want to get this thing working: I have a prefab with coins, some obstacles and enemies, and i want it to be instantiated each time the player got to the right or left on the stage, to make the stage ...
0
votes
2answers
123 views

Is it possible to use one if statement for each level scene?

I'm working on a platform game where you as a player have to collect logs, to keep on all the fires in the level. Each campfire has a timer, which ensures that every x number of seconds the animation ...
0
votes
1answer
28 views

How to modify the Unity sprite renderer (or create a custom one) that can display the sprites on the X-Z plane?

Prefix: I am NOT trying to rotate a sprite 90 degrees by it's transform, this changes what is up/down and forward/backwards for the object. I need the sprite displayed on the X-Z plane in comparison ...
1
vote
0answers
23 views

2D Polygon Collision push direction with large polygons

I have a collision detection/resolution implementation that uses the Separating Axis Theorem. Detection and such works perfectly fine, as well as resolution for most objects/shapes in my game. ...
0
votes
0answers
46 views

Creating a 2D game on the X-Z plane instead of the X-Y plane in Unity, any adverse effects or challenges with this?

After coming to the realization that some things I wish to do in a 2D RTS are easier to do on the X-Z plane instead of the default X-Y plane, I'm considering moving my game over to the other plane. ...
1
vote
2answers
63 views

How can I detect a perfect passageway for collision detection?

The problem is when I move diagonal it moves fractions of units and therefore my coordinates might be a fraction of a unit say (40,400) might be actually (40.12,400.40) but another problem is my pink ...
0
votes
1answer
46 views

2d Collision detection response equation doesn't work

I am currently doing some game engine programming as a hobby. I have been working on getting the collision detection working for a while now, and I'm at my wits end with it. I started with this ...
0
votes
1answer
30 views

Why is each column being shifted down the X value of the column in my 2D Data Structure?

I have a two 2-dimensional arrays. One of which stores characters from a text file, and the other stores pointers to instances of Blocks. For some reason, in either of the arrays (I'm not sure which), ...
-2
votes
0answers
15 views

Search an artist with a comic style like Angry Birds [duplicate]

Hey im searching an artist for my new mobile game. The problem is i want this comic style like angry birds but i cant find anything like that on devianart and other sites. Most of the arts are in ...
0
votes
1answer
65 views

How to bounce the player away after attack by enemies?

I creating a 2d platform game. I would like to bounce the player away after hit by the enemy, so the user get another feedback beside the sound effect. How can I achieve my wish? Use the following ...
0
votes
1answer
38 views

Unity C# 2D Platformer Main Camera should stop on sides of level

I've been working on a 2D Platformer and i succeeded in setting up a script for my Main Camera to follow my Player gameobject using transform positions. Now when my character is near the sides (or ...
0
votes
0answers
18 views

C# Pathfinding in 2d array (procedural generation) [duplicate]

I have the following random example data in a 2d array 030 300 030 003 The 3 represents a room, the 0 represents its an empty block and 1 represents a corridor. Now i want for example the following ...
-2
votes
2answers
59 views

In Unity, how do I make the camera follow a character?

When my character moves, I want the camera to follow them, such that the character always stays in the middle of the view. How do I do that in Unity? Here's my code right now: using UnityEngine; ...
1
vote
1answer
54 views

How to change an int value in the Unity editor

The player of my game can collect logs and can use them for hold on the fires. Each fire has its own status. So one is off and the other one is for 50% on. I created a public int inside my script ...
1
vote
1answer
51 views

Move 2d tank with independently controlled treads

I have made a tank object that knows its position, speed, rotation, and a double value ranging from 1.0 to -1.0 for each tread. I want it to move base on those values. For example, if the value for ...
0
votes
1answer
36 views

Unity problems with OnTriggerStay and Input.GetKeyDown

Background information Some weeks ago, I start by creating my own platform game. You control a character, that can collect logs and should hold all the campfires on in the game. When the user has ...
0
votes
1answer
92 views

How to detect the edge of a platform?

I have create a enemy AI script. These enemies are animals in my game. What I want is that the enemy can detect the edges of a platform. using UnityEngine; using System.Collections; public class ...
0
votes
1answer
62 views

Rotate Object Towards Direction in 2D

For my RTS game's physics engine, I'm trying to find out a clever way to make a unit face the direction it's moving in. Given a Vector2d direction of movement (its normalized velocity), how can I ...
0
votes
0answers
18 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
49 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
1answer
100 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
113 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
42 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
69 views

How to create a ladder script in Unity [closed]

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
147 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
2answers
393 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
80 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
3answers
100 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
2answers
44 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
113 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
32 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
24 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
58 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
57 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
2answers
45 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
60 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
61 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 ...