Panels, Status Bars and Score
Let’s add the finishing touches to this simple little game! We’ll be adding a Game Over panel, score, victory state and a status bar for displaying lives.
Panels – what are they?
In Scorpion, a Panel is a image-based element you can print text, health bars, and other visuals to. They’re useful for menus, status bars, title screens.. Things like that. Recently background copper gradients and parallax backdrops were added to the list of things that Panels are used for, so they’re extremely important. Foreground panels, on Amiga at least, are either at the top, bottom. or instead of the game screen. They have no transparency, you can’t overlay one, as eg; a speech bubble in the main game window, but you can print text to them at the top and/or bottom.
Anyway, lets add some of them! In the Panels tab in Scorpion Editor. We’ll be adding one for gameover.png, statusbar.png, winner.png and title.png .. Save them to the Panels folder as gameover.panel, statusbar.panel, winner.png and title.panel

When selecting Gameover, Title and Winner panels in the sidebar, you have some settings to change:

Panel gap is the space between a panel and the gameplay window (or between two panels) – on a full screen panel like these two screens, 1px is fine. Fade in and out 50 means it’ll take 1 second to fade in and out, and Centre Adjust px 32 shifts the panel rendering to the right, to match the rest of the game.
Now lets move to the statusbar, where things get a little more complex.

With statusbar selected in the panel tab, you’ll need to add some Elements (+ button, top left). Elements are things like life counters, timers, score – things that will be paired to individual variables. For the lives at the top right – choose the Counter option, below that select the variable “lives” (that we created last issue), click where it says “Counter Image” and select “Snowblall.png” from the Panels/ folder. Thenset the Max Value to 5. To get the lives into the correct location you’ll have to drag them in the preview window into the space shown.
Two last things for the panel, both which I frequently forget.. You must set the panel type to Bottom Panel, and set Centre Adjust px to 32 again.

For the second element we’ll need the Digits type, to select the “score” variable, and choose the defaultnumberfont. Numberfonts (and fonts for that matter) are stored as PNGs in the project folder so you can edit or make your own. Numberfonts can also be used for things like character portraits and other UI components. You can set the max value to 9999 and drag the four (0123) digits into the score box in the preview.
Making things work
Now we’re going to have to add some lines to codeblocks to make things actually happen. Back in the Code tab, select the startup codeblock and add a Display/Panel command. Select “title” in the Panel selecter and make sure “Wait for Fire Button” is ticked.

Now on the line below where we previously created a Load Level command; Select that line and on the right choose statusbar as the Bottom Panel:

Now we need to connect the game over state to the game over panel.
In the Code tab, modify the “enemyhitsplayer” codeblock to have the following lines:

In a more complex tutorial I’d add timed invincibility when you’re hit by elfs. Check the Amigo The Fox example bundled with Scorpion Engine to see how you could do that.
The two panel commands (“unload bottom panel” and “display panel gameover”) pause the game as “wait for hit fire” is selected. Then when you hit fire it resets the score and lives and goes back to the start codeblock.
Over in the Actor tab we need to select the snowman actor and set his Attack Delay to something higher than 0 so that you can’t spam snowballs so quickly!

Now.. Currently the elves just become extinct when you shoot them, so lets make them more threatening!

We’re changing a lot here – Ticking “Is Attacker” enables the actor’s second timer. The standard Actor timer (far right, bottom) is now being used to switch left/right motion. The Attack timer and its delay are set to make the elf Jump. We’ve also reduced his health slightly, increased his jump distance. Importantly we’ve ticked “No spawn if too many” and set the Max Entities to 8. Now we’ll not be able to spawn too many elfs!
Now it’s time for a routine to create more elfs. Create a new Codeblock called Enemyspawn. In this codeblock you’ll need a Base/Roll Dice command and a Level/Spawn Actor command.

By setting the minimum side to 16 we know the first 16 pixels of the map won’t be included (there’s a wall there) when randomly choosing a elf position.
Now in the bottom right of the Maps tab set the enemyspawn routine to the level timer:

We need a win condition, so let’s put a score of 200. (20 elfs murdered) Circle back to the “snowhitsenemy” codeblock in the code view and add the following section:

Now lets run the game and see if the changes worked!

Yup. That’s working! Elfs appear at random x positions along the top of the screen.. Can you kill 20? Or.. Change the code so you don’t have to get rid of so many? A lot of this could be balanced better to make it more fun. Faster snowballs with shorter range, etc? But…
You now know the basics of everything you need to make this game. In the zip I’ve included some sound effects you could add to things like jumping and firing. You can do that either through codeblocks (Code/Audio/Sound) or on the Actor Panel by the attack timer and jump options.

I’ve also included some graphics for other enemy types. You’ve seen how to make projectiles and use basic conditionals so maybe a new monster type could fire too? You’ve seen how to load levels, use Actors and level timers, as well as panels for UI.
I hope this has been a fun and interesting project, and enough to start your scorpion journey, I’d love to see if you can take this further and make it more complex! Scorpion has so much flexibility you can make almost anything, which is wonderful but it also makes a comprehensive tutorial a bit of a fool’s errand. Feel free to ask me questions though, or even better join Scorpion’s Discord and ask the community. As always I recommend looking through all the included projects, and copying things like the highscore table example, which is more advanced than anything I could cook up, but essential if you were perhaps making an arcade game.. Maybe for a game jam?
