Questions tagged [2d-games]

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.

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, but not a z coordinate unlike in 3D games.

This can range from top-down games, like dwarf fortress, to side-scrolling ones, like platformers. It would refer to any games where the character / objects can move freely in two dimensions (e.g. left-right & up-down).

Related tags:

Remember there is also a special StackExchange site: Game Development

1116 questions
5
votes
2 answers

Detecting collisions between polygons and rectangles in Pygame

So I am trying to make an among us type game with pygame. I just started, so I don't have much of anything and am working on the map right now. However, one thing I'm struggling with is the collision logic. The map has an elongated octagon shape for…
5
votes
2 answers

Unity iOS Build Size Enormous but Textures Small

I'm building a unity game for the first time. When I build for iOS I get a full build size greater than 700mb but in my build report it says that the user assets are only 71mb. So what is the rest of this coming from? I know this is a bit vague…
maiamachine
  • 280
  • 4
  • 14
5
votes
2 answers

Using Phaser together with React

I am trying to understand how I could use React for rendering all the UI elements and Phaser for rendering a game (using Canvas or WebGL) within the React application. One way would be to use React's componentDidMount, so after I have my HTML ready…
5
votes
2 answers

Does C++ has an equivalent of HTML and JS fillRect?

Is there a way to draw figures in C++ like you do in HTML combined with JavaScript? By drawing figures I mean the function in HTML and [canvas name].fillRect function. I'm trying to make a 2D brick breaker in C++
Recondito
  • 71
  • 3
  • 7
5
votes
1 answer

Algorithm for finding an empty space that fits a rectangle that is closest to a target rectangle among other rectangles

Let's say you're placing rectangular tooltips on a screen of elements you want to provide information for. You want all these tooltips to be visible all at once and not cover any of the nodes any of the other tooltips are for. You want each tooltip…
B T
  • 57,525
  • 34
  • 189
  • 207
5
votes
2 answers

Is it possible to develop 2D games in Android Studio?

I have searched in the web and found very few material on this question. I've heard of Unity 3D and know that there are other tools. But I would like to know if it is possible to develop games in Android Studio? I'm learning Android development and…
Marat
  • 6,142
  • 6
  • 39
  • 67
5
votes
0 answers

What is the Alternative for DirectionalShadowLight in LibGdx?

I Have a 3D Model with Animations in LibGdx. I Want to Create a Dynamic Shadow that Moves congruent with the Model. I researched how to and found a lot about DirectionalShadowLight, but it seems to be not applicable anymore. So What are the Other…
TAA
  • 59
  • 4
5
votes
1 answer

Is there any way to "commit" the state in Redux to free memory?

I'm working on a real-time multiplayer game and I use Redux on both the server and the client to store the state of the application. However, the amount of actions dispatched into the store is significantly higher than in an usual application…
Crisu83
  • 93
  • 1
  • 6
5
votes
2 answers

Creating a collision layer in Phaser using JSON and Tiled

I'm trying to create a platform game using Tiled to create my maps. I've made my map and exported it as a .json object. I can make the map appear in my game, but my sprite falls through my floor. I've been going through tutorials for hours and seem…
Rokitar
  • 191
  • 2
  • 12
5
votes
10 answers

2D game development basics

I would like to write some simple Mario-like game from scratch using language C. But honestly I have no idea how to do so, and I can´t find any good tutorial for this, which is for free. But to the actuall question, I have only written WinAPI…
B.Gen.Jack.O.Neill
  • 8,169
  • 12
  • 51
  • 79
5
votes
3 answers

Unity3D - Shader for sprite clipping

I am trying to create a shader that can be used to clip 2D sprites in a game, I found this shader in another question Shader "Sprites/ClipArea" { Properties { _MainTex ("Base (RGB), Alpha (A)", 2D) = "white" {} _Length ("Length", Range(0.0,…
Khaled Abu AlKheir
  • 301
  • 2
  • 3
  • 11
5
votes
3 answers

How to get started with andengine

Are there any good resources to get started with Andengine? Any good tutorials, blogs or books? Of course, I have visited its official website http://www.andengine.org/, but I didn't think the documentation they have is a good starting point.
Waqar
  • 263
  • 1
  • 9
4
votes
6 answers

Interview question: Create an object oriented design for Sudoku

I answered that I will have have a 2d Array. And then I will have 3 functions one to check the horizontal condition. another function to check vertical condition and another one the check the 3*3 block condition. But he is not satisfied, can any…
javaMan
  • 6,352
  • 20
  • 67
  • 94
4
votes
1 answer

How to penetrate or cut holes through a 2D foreground

I'm currently making a 2D game in Javascript, but I want to the game to have different lighting levels, for example, if I were to create a day and night cycle. However, I want to be able to cut holes in the lighting/foreground, or do something so…
Scollier
  • 575
  • 6
  • 19
4
votes
1 answer

Kaboom.js: how to set the background to an image

I'm making a kaboom.js game and I want to set the background of a scene to an image. I can only find solutions on changing the background to a colour. I hope someone can help!
1
2
3
74 75