Sunday, August 11, 2019

game mechanics - How can I assist players navigating narrow grid junctions?


I'm looking for a technique to help the player navigate a narrow path while the character is in constant motion. When changing direction in junctions, it's pretty hard to time the direction change for a successful turn. With bad timing, the character just gets stuck as pictured.


pacman path


How can I make this easier for the player? (This is for a university assignment.)



Answer



You could "hot spot"-check areas adjacent to the character


hot spot testing


and immediately begin moving in a free direction if the appropriate movement key is held.


For example, if the player is moving right and holds the downward arrow key, they would continue moving right until the below hot spot becomes free. They would then begin moving down.


On platforms that allow multiple directional controls to be triggered simultaneously (such as the arrow keys on a PC), you may want to include an input queue in your control state to ensure the inputs process in order.



The original Pacman used a similar scheme, but even allowed the player to cut corners if they held the controls in the appropriate direction ahead of time like this!


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...