Skip to main content
146 votes
Accepted

What is actually moving in an endless runner?

I slightly disagree with Philipp's answer; or at least with how he presented it. It gives the impression that moving the world around the player might be a better idea; when it's the exact opposite. ...
CosmicGiant's user avatar
  • 2,104
87 votes

What is actually moving in an endless runner?

Both options work. But if you want the endless runner to be truly endless, you will have to keep the player stationary and move the world. Otherwise you will eventually hit the limits of the ...
Philipp's user avatar
  • 120k
48 votes
Accepted

How to differentiate landing on top of an object from falling down the side?

There are three common ways games sort this out: Minimum Separation Vector Upon a collision, compute the shortest movement that pushes the bodies apart into a non-intersecting position. If I've ...
DMGregory's user avatar
  • 135k
41 votes

How to make healing in an exploration game interesting

I think you need to consider this at a more fundamental level: what is the gameplay purpose of having a health system in your game? A conventional health system serves two purposes: (1) it gives a ...
Jack Aidley's user avatar
  • 2,126
37 votes

What is actually moving in an endless runner?

Building off of XenoRo's answer, instead of the re-rooting method they describe, one could do the following: Create a circular buffer of parts of your infinite map generated, which your character ...
Krupip's user avatar
  • 1,763
34 votes
Accepted

How can I detect the player being crushed in a 2D platformer?

I think you'll have to take the box's movement into consideration. That is, only crush if the box is moving towards the player. This is similar to other problems in platformers, where the movement is ...
congusbongus's user avatar
  • 14.8k
14 votes

What is actually moving in an endless runner?

As already asked and accepted, it really depends on the scope and style of your game, but since it wasn't mentioned: FlappyBird moves the obstacle across the screen, rather than the player across the ...
Stephan's user avatar
  • 1,728
12 votes

How to make healing in an exploration game interesting

You mentioned having thought about auto-regeneration and your issue with that was the possibility of a player, while in the middle of a fight, running around while they auto-regenerate health. Have ...
DerpKat's user avatar
  • 138
9 votes

How can I detect the player being crushed in a 2D platformer?

Have the "crush test" points be inside the gray box shown in your image #1 - i.e. kill the player only if you detect a hit on one of the pixels there.
Peteris's user avatar
  • 1,019
7 votes
Accepted

Unity2D jumping inconsistancy

I'd recommend changing Input.GetKey("space") to Input.GetKeyDown("space"). This way the check is only performed on the initial ...
Chris McFarland's user avatar
7 votes
Accepted

How to make healing in an exploration game interesting

Perhaps you can add some non-conventional healing system. Like for example : Health steal -> percentage of health gained = percentage of enemy health lost, and varies with enemy level. Every nth hit ...
Yash Mishra's user avatar
6 votes
Accepted

How can I avoid "Moonwalking"

If I recall correctly, both Prince of Persia and Flashback (as well as its predecessor, Another World/Out of This World) only allowed movement in set 'steps': if the player ran or walked, they would ...
MassivePenguin's user avatar
6 votes
Accepted

How to handle complex inputs in 2D platform game?

This is an excellent question because you are experiencing a problem that's quite commonplace with less experienced programmers: attempting to solve your problem with a purely imperative approach. ...
Pharap's user avatar
  • 1,637
6 votes

How can I detect the player being crushed in a 2D platformer?

As someone who grew up with 80s platformers, my first comment is that the contact points must be exactly on the sprite, not anywhere outside it. There were few experiences more frustrating than dying ...
Graham's user avatar
  • 222
6 votes

How to make healing in an exploration game interesting

There's lots of examples out there in 2D platforming, it's really a question of how you want healing to be "interesting"? I would agree with suggestions that "skillful" play should be rewarded, but ...
Phil S's user avatar
  • 311
6 votes
Accepted

How to control jump strength by how long the player presses the jump button?

You have essentially 2 options. You can either apply a constantly decreasing force to the character while the player is pressing the space button and stop immediately when they release it or apply a ...
Bálint's user avatar
  • 14.9k
6 votes

How to map gamepad inputs for my platformer?

Most importantly: plan for remappable controls from the start. Different games use different conventions, and different players have different preferences. This is also important for accessibility - ...
DMGregory's user avatar
  • 135k
4 votes

Java Libgdx Attaching Sprite to Box2D Body

Two (simple) solutions could look something like this: Give the player class a Sprite (best). ...
Charanor's user avatar
  • 7,870
4 votes
Accepted

How to implement a clipped shadow in 2D?

1)Cast a set of rays from origin to the ground evenly distributed through the width of your object. 2)Draw your shadow as a small portions of black sprites with varying height so you can round the ...
Ocelot's user avatar
  • 1,433
4 votes

How to make healing in an exploration game interesting

Limit healing resources and put any additional resources into new, unexplored areas. Create the incentive where if a player wants to heal, they have to press on into more of the map. You can do this ...
BastionGamma's user avatar
4 votes

How to make healing in an exploration game interesting

If cowarding during a boss fight is your major problem with auto-regeneration, make the auto-regeneration non-linear: give it a cap of auto-regeneration, and disable it during boss fight (boss fight ...
Chenxi GE's user avatar
  • 141
4 votes

Swept AABB Collision Detection Conflict with Tile-sized Gaps

Since you have a tiled world and an exactly tile-sized character, a first step to sort out this problem can be to recognize when the character aligns with a tile. In the falling-into-a-hole case, this ...
Kevin Reid's user avatar
  • 5,508
3 votes

How to create a walkable crate box?

Finally I fixed it. I added two empty GameObjects to check the right and left side of the player. Now he can push the crate and walk above it without being stuck at ...
Yusufmm's user avatar
  • 196
3 votes

What is the best collision detection method or algorithm for a 2d platformer?

For horizontal boxes AABB is great, for slopes, you need to add a twist to it. The height of a slope that's positioned between x1 and x2 at a specific point can be calculated the following way (x is ...
Bálint's user avatar
  • 14.9k
3 votes
Accepted

What's wrong with using physics engine in 2d platformer?

It's not necessarily a completely terrible idea but there are significant cons to weigh against the pros you mention. In particular, the physics in a platformer character usually isn't totally (or ...
jhocking's user avatar
  • 15.8k
3 votes
Accepted

Keyboard input conflict in wall jump

Your actual way of handling this is a frame perfect, this mean that to actually go to the C state you have to press both right and jump at the same frame (which very hard). A solution could be to ...
Shashimee's user avatar
  • 1,260
3 votes

How can i collide two bodies without filtering(collision filtering)?

setfdef.isSensor = false; and fixdef.isSensor = false; A sensor shape collects contact information but never generates a ...
Morchul's user avatar
  • 317
3 votes

How to implement a clipped shadow in 2D?

If you're rendering the shadow as a texture in hardware (which most 2D renderers do as well), you can specify texture coordinates so you only render part of the texture. So imagine you have a shadow ...
congusbongus's user avatar
  • 14.8k
3 votes

Why do old platformers typically scroll to the right?

The answer to this is a synergy of a number of factors. Most people are right handed. Most languages are written from left to right. When placing objects, people typically start to the left and ...
ROGRat's user avatar
  • 114
3 votes

How to make healing in an exploration game interesting

Doom (2016) actually has a great example of rewarding interesting gameplay with healing through its glory kill system. By rewarding the player with health for getting close to finish off demons, it ...
Beefster's user avatar
  • 133

Only top scored, non community-wiki answers of a minimum length are eligible