I am trying to make a step-on script in which the hero steps on an NPC and this makes an "action icon" show up on the screen which indicates to the player that they can carry out the action by pushing the action button on their keyboard.
So far I have a script which displays a HUD in the auto-run loop of my code:
Code: Select all
script, initializeHeroHUD, begin
# Call this script once, at the start of your game
FullHUD := load small enemy sprite(0)
#ITEMS:
actionGrind := load small enemy sprite(1)
#Place the sprites on the screen
#HUDS:
put sprite(FullHUD, 260, 160)
#ITEMS:
put sprite(actionGrind, 260, 160)
updateHeroHUD
end
script, updateHeroHUD, begin
if(grind1 == true) then(
set slice visible(actionGrind, true)
) else if(grind2 == true) then(
set slice visible(actionGrind, true)
) else (
set slice visible(actionGrind, false)
)
end