147
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. ...
88
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 ...
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 ...
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 ...
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 ...
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 ...
24
votes
Accepted
How can I adapt A* pathfinding to work with platformers?
You don't need to adapt A* at all. The only consideration is where you put your nodes and how you connect them. The linked article seems to convert from a platformer-friendly model to a grid based ...
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 ...
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 ...
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.
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 ...
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 ...
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 ...
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. ...
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 ...
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 ...
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 ...
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 - ...
4
votes
Accepted
How to test if procedurally generated level for infinite runner can be passed?
I understand you are dealing with both box obstacles and gaps. The way it was described, I can see three possible situations. Correct me if the game is designed differently.
With the first, there are ...
4
votes
Java Libgdx Attaching Sprite to Box2D Body
Two (simple) solutions could look something like this:
Give the player class a Sprite (best).
...
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 ...
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 ...
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 ...
3
votes
In Game Maker, how do I make invisible platforms the player can walk on, and reveal with an item?
Looking at the pieces one by one:
Invisible floor
You can make invisible floor tiles by choosing your usual floor image as the collision mask, and setting the object to have no sprite.
Partially ...
3
votes
How to test if procedurally generated level for infinite runner can be passed?
Do it at the generator level: Always generate your level using a selection of passable gaps / obstacles section prefabs.
If two successive sections are not passable mark them as such so the generator ...
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 ...
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 ...
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 ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
platformer × 4032d × 129
unity × 99
physics × 70
c# × 68
collision-detection × 66
java × 32
xna × 29
box2d × 27
libgdx × 20
c++ × 19
javascript × 18
movement × 18
game-mechanics × 17
collision-resolution × 17
jumping × 17
camera × 16
game-design × 15
tiles × 14
side-scroller × 14
game-maker × 13
tilemap × 12
godot × 12
sprites × 11
xna-4.0 × 9