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

-1
votes
0answers
29 views

Why is my animation not happening? libgdx / java [on hold]

public class Animator extends Player implements ApplicationListener { private static final int FRAME_COLS = 7; private static final int FRAME_ROWS = 1; ...
0
votes
2answers
41 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 ...
-2
votes
0answers
39 views

o whant to make unity laser 2d [on hold]

hi i am new in unity and i whant to creat a 2d laser light and i whant to make it move like this vidéo exemple :laser exemple https://www.youtube.com/watch?v=d2EI10mCEMo i have try sow many code ...
-2
votes
0answers
31 views

Searching for a good Code example for a Java platformer [on hold]

I am like the titel tells you, I am searching for a example. I learn by looking at things and then taking them apart, so what i need now is a well made platformer. The Platformer should feature ...
0
votes
1answer
49 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 ...
1
vote
1answer
32 views

How to deal with two different axes on isometric game?

Hi! Above is a visual of the problem I am having. My game has two different coordinate systems. You have the client, or the canvas, where the game is rendered - a standard coordinate plane; however, ...
2
votes
1answer
65 views

How can I create 2D, sprite-based reflections in HTML5 Canvas?

I'm trying to create simple reflections in a 2D, sprite-based game using HTML5. I'm looking to recreate an effect like the one you'd often see in GBA games, such as Pokemon Emerald and Mother 3: ...
-1
votes
0answers
21 views

Walls collision and obstacles [on hold]

I have an easy game in Unity 3D. But I don't know how to make wall collision.. I have two walls, one on right side and one on left. The player must jump from one wall to another because on the walls ...
-1
votes
0answers
28 views

Looking for a point to start (Tutorial or something) [on hold]

I want to make a 2d top-down RPG just like "Harry Potter and the Prisoner of Azkaban" on GBA. (Yeah, I know it's oldskool, but I love it!) Can you guys give me a point to start, like a tutorial or ...
0
votes
2answers
70 views

How does rendering with Swing compare to rendering with openGL?

[summary: Is the performance of Swing at least in the same dimension as openGL [through LWJGL]? If yes, what percentage would you give it? What possible other problems can I expect from Swing in the ...
1
vote
2answers
62 views

Simplify paths when a user builds

I am looking for some guidance on how to simplify my nodes on a path when a user builds on the fly. Imagine a path like this with a gap: Logically 3 nodes are required 2 connected one isolated. ...
0
votes
0answers
54 views

Alternative to a timer in a separate thread in a turn-based game

I'm making a 2d turn based game and I'm having some difficulties with the timer itself. 3 characters vs 3 characters, two players. A timer giving them a chance to preform acts within a set amount of ...
0
votes
0answers
29 views

Good practice/pattern to create and draw high resolution 2D fish [closed]

i simply want to create/draw a 2D fish with animation and implement it in my android application. For drawing i use gimp and the gameengine is libgdx. Why gimp? Because it is free and mighty and ...
0
votes
1answer
33 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
vote
2answers
102 views

How do I limit the rotation speed of a mouse-following object?

I am trying to make a 2D top-down game where player controls a spaceship. The spaceship (a rocket) is just a sprite following the mouse cursor with a fixed speed and is always pointing toward the ...
0
votes
0answers
85 views

2D Distortion shaders for water effect

I'm working on Unity, and I'm trying to improve my water. The water will be seen top down, and I want to apply a shader to it to make it better looking. I understand the concept of distortion shaders ...
6
votes
0answers
148 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
87 views

How to deal with different resolutions in a 2D game? [duplicate]

For example, you have a sprite of mario with a size of 20px x 20px. This sprite however was made for a game resolution of 1000px x 1000px. What if you want to provide a different game resolution as ...
0
votes
1answer
276 views
+100

Problem with update/render in game loop (scrolling view, render interpolation)

I use SFML 2.2 and program a 2d prototype game (2d mario style where the camera follows the player). I am experiencing the buggy imagery during rendering, for example a chunk of vertex array blocks ...
0
votes
2answers
138 views

What level of use can I give to these third person IP based art assets?

I'm making my first game (2D), and while details are irrelevant it compromises lots of spaceships in and out of the screen. They are not the main character or controllable by any means (I don't know ...
1
vote
1answer
116 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 ...
0
votes
3answers
124 views

Drawing image with an angle

Edit: the images below aren't supposed to have whitespace. I am just trying to show you that i am trying to create a rectangle from a 1x64 image, positioned as shown in the second picture I know how ...
0
votes
1answer
131 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
0answers
39 views

'Bad' triangles when doing affine texture mapping

I am really clueless about what i must do. I wrote a function to do affine texture mapping, but i get in most situations 'bad' triangles. I really didn't want to ask this question as it probably is ...
0
votes
1answer
53 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
59 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
28 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 ...
-1
votes
1answer
51 views

2D bouncing formula doesn't work properly

am new to unity, and i am trying to create a bouncing ball, so i've did many researches about bouncing realted physics and i found a formula : Formula: -2*(V dot N)*N + V Where V is the velocity ...
3
votes
3answers
162 views

How to have coins burst out in random directions after destroying an object in unity?

I want coins to burst out of an obstacle in random directions after I destroy it, kind of like the rings in sonic. I have everything else done: the physics, bouncing, instantiating to coins. I just ...
0
votes
1answer
55 views

Coins don't show up in game in Unity

I have a 2D game I'm making with Unity, and I want the player to be able to collect coins that I place all over the game. I used the coin prefab with a 2D circle collider and an animation to make it ...
0
votes
1answer
32 views

Why my dynamically generated Sprites overlap?

I'm trying to dynamically generate scene representing chess board made from sprites. I'm using two textures for these: - pieces.png (taken from here: ...
0
votes
2answers
60 views

Unity question on OnTriggerStay() function

I'm currently working on a soccer game.I have a script for the ball that whenever the ball collides as trigger with the goal line,the ball will return to the middle point.But seems like the ball ...
0
votes
1answer
40 views

How to reposition a bouncing ball after it has passed through a surface

I have a bouncing ball which can collide with lines of a random slope. The ball passes through the lines a bit and I need to set the ball back some distance from the line. The ball (defined by ...
2
votes
3answers
197 views

Generating 3D-like effect

I'm making a 2D sidescroller game and want to give the blocks a 3D like effect. This way it looks like the player is walking on 3D blocks while walking on a 2D plane (thus having only x,y ...
0
votes
1answer
50 views

Perspective Projection - Drawing Lines

So I sort of understand the math behind projecting 3d points onto a 2d plane. It's just some simple dividing and multiplication of distances. However I can't seem to wrap my head around projecting ...
2
votes
2answers
52 views

AndEngine rotate all connected bodies

I have created below hexagon structure in Andengine with box2D physics extension. I want to rotate whole structure with respect to center when other ball collides with the structure using physics. ...
0
votes
1answer
60 views

How do I calculate the bounce vector of a ball hitting the starting point of a segment?

I have a ball (with parameters x, y, radius) that travels on the screen (with vectors directionX directionY) and can collide with a segment with random slope (with parameters startX, startY, stopX, ...
0
votes
1answer
95 views

How can I map regions on a world map image?

I am trying to use a map of the real world, but I need to have a way to break it down by countries and regions. Ideally down to a province level. I figure that I'd need to be able to define ...
0
votes
1answer
62 views

Intersperse 2D with 3D opengl

I want to be able to draw 3D objects as well as 2D objects in an openGL environment. Normally, I would draw my 3D stuff, disable the depth buffer and depth mask, then draw my 2D stuff. However, this ...
0
votes
0answers
26 views

Configuring touch input for a mobile game?

I'm trying to configure my game to take touch input from buttons but my scripts don't seem to be working. Here is the script for receiving touch input: using UnityEngine; using System.Collections; ...
0
votes
1answer
36 views

How to make a gameobject Scale up from another GameObject script

hi there im having a rought time with this code, trying to make a gameobject grow in scale from touching this one, and when a set amount of scale is reached destroy this game object ( the one who ...
0
votes
2answers
49 views

Unity2D Best way to determine degrees between two colliding entities?

I'm trying to determine the collision-direction between two objects. I'll be using this for various things such as creating blood-entities in a specific direction proportional to where the other ...
0
votes
2answers
135 views

C# xna/monogame ghost trail effect

I would like some know how can someone make an animation like this, in Monogame specifically.Since i am completely clueless on how to go around this i how should i go about this ? I hate asking ...
0
votes
0answers
34 views

How to rewind time on just the main character? [duplicate]

I have a 2D sidescrolling game and I want the character to be able to rewind time on him if he messes up. I don't want anything else to change, just the main character's position. Any idea how I can ...
1
vote
0answers
123 views

Xna 2d texture antialiasing

I've got a problem with drawing 2D texture in xna 4.0. My program generates terrain texture: The problem is in rough surface of my texture (dark-blue) that is generated by-pixel. Is there any ...
0
votes
1answer
39 views

Port sandbox flash game to Android and iOS

I'm want port my sandbox game to Android and iOS. Game written in AS3 (i'm use my simple 2d engine on stage3d). What do you recommend I use? Haxe + OpenFL MonoGame + Xamarin (C#), or other 2D engine ...
1
vote
1answer
44 views

Why is the Hiero font not coordinated to fit neatly in the display window?

I imported a font with Hiero and I draw the font like: font.draw(batch, "1", 0, 48); This is the resultant image: So the font it moved up to hit the bottom perfectly, but it doesn't touch the ...
0
votes
1answer
86 views

Mesh Generation In Code [closed]

My camera looks like this: I am trying to add 2D polygons to the screen based on the percentage that they take up of a 1920x1080 pixel canvas. Therefore, I calculate this and then use ...
0
votes
1answer
42 views

Raycasting on Z in 2D

I'm making an isometric game in Unity. So far I have managed to render a diamond shaped board, with tiles that are aligned on the x and y axis (and the camera looks down the Z axis). I am spawning ...
7
votes
1answer
452 views

How to implement this kind of ripples with a GLSL fragment shader?

So I have already implemented the reflection part: uniform sampler2D texture; uniform vec2 resolution; uniform vec3 overlayColor; void main() { vec2 uv = gl_FragCoord.xy / resolution.xy; if (uv.y ...