AMOS/STOS was a great game coding entry point for Amiga and ST users and the guy behind that is back again with a version for the 21st Century.
At the end of my AMOS tutorial I mentioned that my example Space Invaders clone was playable on the web, and AOZ was how I got that to work. AOZ.Studio allows you to create games and apps for the web, Mac, PC, Linux, Android and iOS, using a high-performance transpiled BASIC.
Since the last tutorial, a LOT of development has taken place in AOZ, so I felt it was time to dedicate a tutorial to it!
Getting Started with AOZ.Studio
AOZ comes with everything you need (for free) to get started coding right in the installer, including an integrated development environment. Unlike AMOS, however, you’re not expected to use proprietary sprite banks and stuff – you can use your modern graphic and music tools.
Eventually there will be a paid version, but that will be mainly for folks who want to cut out the advertising and distribute their games (royalty-free).
Before we get into coding, while you can use the old AMOS BASIC syntax, but using the new abilities affords a lot more cool things, so we will focus on the new ways going forward.
AOZ BASIC Coding: “Hello World”
As is traditional, your first program will be Hello World. Start a new project and enter the following:
print("Hello World!")
You don’t need the brackets but I like to use them.
After entering the above, you can launch your new program either in the embedded browser, using the right arrow in a circle or F2
or you can launch in your actual web browser with the plain right arrow.

Prettier Text, Fonts in AOZ
If you want to get away from the default text, we can display our text anywhere on the display using the Text
function.
Here I will display Hello World again but in the Google Font, Baloo:
#googleFont: "Baloo"
Set Font "Baloo", 36, "Italic"
Text Screen Width / 2, Screen Height / 2, "Hello World!"
Turn off Splash Screen, Mouse and Cursor
You can turn the flashing text cursor and even the mouse cursor off. By default, AOZ will start any of your programs with a little ad for AOZ, in the paid version you will be able to turn that off also.
' Turn off AOZ Splash Screen
#SplashScreen:False
' Turn off the flashing cursor
Curs Off
' Turn off mouse cursor
Hide On
Wait for Key Press
For a simple title screen, you can wait for a keypress before continuing. Of course, there are a lot more control options, including joypad/stick, mouse, and keyboard.
Wait Key
Code

Here is the code so far:
' Turn off AOZ Splash Screen
#SplashScreen:False
' Turn off the flashing cursor
Curs Off
' Turn off mouse cursor
Hide On
' Set the font
#googleFont: "Baloo"
Set Font "Baloo", 36, "Italic"
' Display the text
Text Screen Width / 2, Screen Height / 2, "Hello World!"
' Wait until a key is pressed
Wait Key
' Print end message
print("Done!")
Actors and Movable Graphics
The real fun stuff starts with getting some images moving, so let’s look at the Actor object.
Unlike in AMOS, where we had Bobs, Sprites, AMAL, etc, in AOZ we can use the Actor, which encapsulates all those abilities, plus some new cool tricks.
Seeing as it is now very much Winter here in Canada as I write this, let’s make some snow.
Within the example projects supplied by AOZ you will find a sprite editor, or you can create your images the way you are used to.

Copy your image file to the Resources, Images folder of your AOZ project.

Now you can display your image on screen very simply:
' Our Snowflake Actor
Actor "Snowflake", Image$="snowflake.png"

Making Actors Move
Right now our flake is static, but it is easy to add some motion with a few added parameters:
Actor "Snowflake", Image$="snowflake.png", X=0, Y=0, EndY=720
My screen is set up to be 720 pixels high (1920 x 1080 is AOZ Studio’s default screen size, however ), so setting the start X and Y to 0, starts him out at the top left, and EndY as 720 to be bottom left.
Note how we don’t need to update the Actor’s position, though we could if we wanted to.
We can make the snow keep falling by using the LoopMove=True parameter
Notice how even after the program ends our snow keeps falling? This means once we set our Actor in motion, now it will keep going until we tell it to stop.
Actor Listeners
Rather than set a loop to keep monitoring our Actors, we can instead use an Event-Driven interface. This allows me also to introduce AOZ Procedures which allows us to split our BASIC logic into subroutines that allow parameters to be passed.
For example, let’s do something when our snowflake hits the bottom of the screen:
' Procedure to call when the actor hits the bottom of the Screen
Procedure ON_LIMIT[INDEX$,LIMIT$]
If LIMIT$="bottom"
Actor INDEX$, Y=0, X=Rnd(1280)
End If
End Proc
' Our Snowflake Actor
Actor "Snowflake", Image$="snowflake.png", X=0, Y=0, EndY=720, LoopMove=True, BottomLimit=720, OnLimit$="ON_LIMIT"
Note we set the BottomLimit to 720 in my example, but that needs to match the default screen size of 1080, or whatever your screen size was specified when you created your project.
Also, take note that the If
does not have a Then
– instead we have multiple lines ending with End If
.
More Actors

To finish up today, instead of moving the flake, let’s add a new flake to create a more effective snow scene (it is much smoother in real life, the animated gif is compressed down to save your patience and bandwidth):
' Turn off AOZ Splash Screen
#SplashScreen:False
' Turn off the flashing cursor
Curs Off
' Turn off mouse cursor
Hide On
' Set the font
#googleFont: "Baloo"
Set Font "Baloo", 36, "Italic"
' Display the text
Text Screen Width / 2, Screen Height / 2, "Hello World!"
' Flake counter
Global flakes
flakes=1
' Procedure to call when the actor hits the bottom of the Screen
Procedure ON_LIMIT[INDEX$,LIMIT$]
If LIMIT$="bottom"
'Actor INDEX$, Y=-32, X=Rnd(1280)
flakes=flakes+1
NewX=Rnd(1280)
Actor "Snowflake" + Str$(flakes), Image$="snowflake.png", X=NewX, Y=-32, EndX=NewX, EndY=720, BottomLimit=720, OnLimit$="ON_LIMIT"
End If
End Proc
' Our Snowflake Actors
Actor "Snowflake", Image$="snowflake.png", X=0, Y=0, EndY=720, BottomLimit=720, OnLimit$="ON_LIMIT"
' Wait until a key is pressed
Wait Key
' Print end message
print("Done!")
I commented out the line that altered the passed-in Actor using '
, and added a new Actor statement that creates a new one, leaving the old one sat at the bottom of the screen in snow-accumulation.