Pickup Objects


Setting Up a Pickup Object
Making Something Happen

Making a pickup object in NESmaker only requires a few steps. Keep in mind that objects in different modules need to be slightly different, depending on if there is gravity in the module or not. All platform game modules (MetroVania, LR Platformer and Arcade Platformer) have gravity.

Setting Up a Pickup Object

1. Choose a free Game Object from the list in the Context Menu on the left. Remember that most objects here don’t have any meaning in the code, despite their names in the list. In this case I will choose the Game Object labeled Currency Pickup.

    2. Click the Object Details button and go to the Details tab. Make sure pickup / powerup is checked. If this is a platform game (where we have gravity), then you also need to make sure that Solid Object Reaction is set to Stop.

    3. Then go to the Bounding Box tab and set the size of the collision for this object. I recommend covering the entire graphic.

    Close the Object Details window and you’re done.


    Making Something Happen

    Now we have the pickup object set up, and if you also have a monster group set to a screen, then we can place our pickup object on the screen (in the Screen Editor) by right clicking anywhere and select Place Monster 1, 2, 3 or 4. However, most likely nothing is going to happen when we pickup the object in the game. That’s because we haven’t written any code to handle this pickup. In order to do that we need to edit the pickup script.

    1. Start by opening the Project Settings window.

    2. Go to the Script Settings tab and scroll down till you see the folder icon named Game. Find and select the line that says Pickup Script. Click the Edit button on the top.

    This will open the pickup script in your code editor, like for example Notepad++.

    Here is an example file that shows what happens when we pick up Game Objects 4, 5, 6 and 7. If you are new to Assembly programming it’s most important that you focus on understanding the concepts rather than the code itself.

    The first thing that happens in the code is LDA Object_type,x. This code is triggered by the pickup object itself, so the object ID for that object is loaded into X now. That means we check what object number this is (in the Game Objects list), starting to count from the player (which is Game Object 0) at the top. Since I made my pickup object in Game Object 7, the code that will run in this case is AddValue #6, myMoney, #1, #1, which will add 100 to myMoney. If this was Game Object 4, then the code for the Health Pickup would be run instead (see below).

    Creating and editing scripts like this takes practice, and you also need to be familiar with how NESmaker works in order to make the script you want. If this feels complicated and difficult I recommend asking for help on the NESmaker forum. There are a lot of friendly and helpful people who can assist you there.