• Bruce

Let's create an MPAGD game - Part 7 - Generating the Players Script

The Script Generator looks a little daunting at first, but it soon makes sense.


Basically, in MPAGD the code behind the Player and your various enemy sprites will be placed into a SPRITE EVENT file, these are just text files that contain your MPAGD scripting code.


The Script Generator tool can create these scripts for you as it has some built in scripts for basic player movement and basic enemy movements & behaviours. Fortunately these are fully customisable, plus you can write your own scripts and invent new mechanics and enemy types. As you can see from the Generator there are 8 Sprite Types for us to take advantage of, plus the Player Controls event, there's also a row for 'Other Events' (mainly scripts that will manage the game set up, loops, menus and so on...we don't need to worry about that.


For now though, we haven't started to look at enemies, all we have is our player. You can see that on the top row MPAGD has already guessed this is your player sprite:




First though, lets sort out a few things with the Player Controls row.


Click on the second column and you can cycle through the available prebuilt scripts that we can load into our game. For our game were going to select 'Platformer' - this will generate a script that handles LEFT, RIGHT and JUMP movements.


On the right hand side MPAGD has guessed our sprite images - however, we have a left facing sprite too, click on the image next to L to cycle through to the correct image.


For all of the other Sprite Types, let's get MPAGD to generate the files, but not add any code into them - to do this we need to click until it says 'Empty Template' for each of the Sprite Type events


In the last row 'Other Events' click until it says 'Auto generate'.


Now the tool should look like this:


We're nearly ready to test our 'game'. First, let's save our work


From the File menu, select Save, give your game a name, don't use any spaces.


Now go back to the Script Generator tool, if everything looks good, click Generate Scripts.


NEXT: Our first build and play test

aboutME

Hello, I'm Bruce and I write games for old 8bit computers using Jonathan Cauldwell's excellent Multi-Platform Arcade Games Designer (MPAGD)

I've written a few successful* games for the Sinclair ZX Spectrum and MSX platforms that have been (largely) well received with my most recent game - Twenty Four Hour Parsley People scoring a 10 out of 10 on Planeta Sinclair.

In my blog I am sharing lots of the code that I wrote for my games, in a way that you can use in your own games.   I've commented it so that you'll learn some of the techniques I use to create interesting new mechanics and help your games stand out from the pack.

MPAGD includes lots of standard scripts, they're great to get you started, but if you're new (or just rusty) when it comes to writing code, hopefully my tutorials will help you get started and  turn your imagination into awesome 8 bit games!

All my code is free to use and do with as you please, but if you find them useful please feel free to buy me a coffee :)

*successful is a very relative term in 8bit computer games

Subscribe Form

  • Twitter

©2020 by Minilop Retroware