FAQ: Why is my player object glitched on the first level?

Many NESmaker developers will encounter a weird glitch where the player object shows garbled graphics when a level loads. As soon as the player starts moving, everything seems all right. When does this happen, and how can it be fixed?

The cause

The “garbled player graphics” glitch occurs when a NESmaker game transitions from a 8×8 tile (for example: a title screen or interstital before the first level) to a 16×16 metatile (for example: the first level) screen. I am not sure why it happens, but it might have to do with lookup tables being addressed wrongly. Whatever the cause is, it’s a well-known NESmaker bug. I might delve further into it at some point, for now it’s just good to know there’s a pretty easy fix for this.

The fix

To fix the grapichs bug, you’ll have to force the player to be in action state zero (idle) before starting the game. You can implement this in either the input script for starting the game, or the Post Screen Load script (make sure this line is only applied on the actual game screen though). The single line of code you’ll need, is the following:

ChangeActionStep player1_object, #$00

This will force your player to be idle when entering the screen, which also enables the game to draw the correct graphics for the player.

Addendum: player keeps on moving after a warp

The same solution can be applied when your player stays in a moving state after warping to a different screen. This happens when the action step of your player does not get reset after warping; therefore, the player keeps on moving, as that was the last action step before warping. Add the above line in your Warp To Screen script to fix this behaviour.