-
Notifications
You must be signed in to change notification settings - Fork 21
How to create a new Item
Simon edited this page Mar 29, 2020
·
2 revisions
Follow these steps to create a new item. All code adjustments are done in the core project:
- Add a new enum value to the
Item
enum in theItem.kt
file - Add a new configuration for the enum value that you have created in step 1 within the
loadItemConfigurations
method of theItem.kt
file. Let's say that you have added the value POTION_GAIN_STRENGTH to the enum then a new configuration might look like this:To see all possible options for a configuration, refer to thecfg(Item.POTION_GAIN_STRENGTH, "potion_strength_plus") { lifeBonus = 25 }
ItemCfg
class of theItem.kt
file - Finally, to link your new item to the correct graphic go to the graphics_raw/gameObjects folder of the root project.
- Add your graphic to this folder, start the graphicsTexPackProject.tpproj texture packer project located in the graphics_raw folder and repack the gameObjects atlas.
The file name must match the name that you used for theregionKey
of theItemCfg