Actions

Store

From Shoot Em Up Kit

This is an introduction to setting up a store page - the page will be updated as we add new features to make this more flexible. In this example, there are 2 weapon upgrades to buy.


Set up the Weapon Variable

In the Level Editor, select Custom Variables from the Define Menu and select Create New. Set the name, type and initial value:


StoreCV.png


You can also set up a variable for coins held in the same way.


Create a Store Page in the Front End Editor

In the Front-End Editor, select a page for the storefront (in this example I have used the Level Complete page which is displayed after every level).


Add text or sprites for the items to buy - in this case, 2 weapon options


StorePage.png


Set the On Click action to change the Custom variable, in this case to 1 for the red weapon and 2 for orange:


StoreClickable.png


FUTURE FEATURE: - We are adding the option to have more than one action on click, so you will be able to subtract an amount from the coins variable too when that is in.


You can set colours for highlighted/selected options in Properties


StoreProperties.png


Set the Player Properties

Add weapons to Player Weapon Slot 2 and 3, and set them to be Disabled:


StoreWeaponSlots.png


Select Upgrade in the Define Menu and select Create New. Create 2 upgrades, one for each weapon option in the store, and set them to enable the weapon slots (in this example, the other weapon is disabled too):


StoreUpgrade.png


Add Actions to the player for Variable Equals events that trigger the upgrades:


StoreActions.png


The ship will now upgrade to the new weapons if they are selected in the store. You can show remaining coins in the HUD.