# Tag Info

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. ...
• 2,104

### 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 ...
• 120k
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 ...
• 135k

### 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 ...
• 2,126

### 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 ...
• 1,763
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 ...
• 14.8k

### 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 ...
• 1,728

### 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 ...
• 138

### 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.
• 1,019
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 ...
• 2,248
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 ...
• 126
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 ...
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. ...
• 1,637

### 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 ...
• 222

### 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 ...
• 311
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 ...
• 14.9k

### 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 - ...
• 135k

### Java Libgdx Attaching Sprite to Box2D Body

Two (simple) solutions could look something like this: Give the player class a Sprite (best). ...
• 7,870
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 ...
• 1,433

### 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 ...
• 141

### 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 ...
• 141

### 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 ...
• 5,508

### 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 ...
• 196

### 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 ...
• 14.9k
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 ...
• 15.8k
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 ...
• 1,260

### 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 ...
• 317

### 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 ...
• 14.8k