------------------------------------------------------------------------------ Making Convey by Neil White . Formatted by Chris Published on Thu 10 Apr 2003, see: http://www.drobe.co.uk/riscos/artifact626.html ------------------------------------------------------------------------------ Contents 1. Background 2. Designing the game 2.1 The grid 2.2 Referencing points on the grid 2.3 The hero 2.4 Collison detection 2.5 Jumping 3. Evaluation 3.1 Tools ------------------------------------------------------------------------------ 1. Background The actual concept for the game was inspired from a dot matrix display sub game on the Data East pinball table Batman Forever where you guide the batcar up the side of buildings smashing ten million point bonuses and across roof tops avoiding air ventilation units using the flipper buttons to move you out of the middle of a three wide path. 2.1 The grid I had a 10x10 isometric grid from some previous tests for an isometric shemozzle, this had never got much further than being a 10x10 grid of tiles, so I decided to use this as a template for the beginnings of the game convey. After deciding on using a conveyer belt device of 6 player widths, I altered my 10x10 grid so it was a 6 wide and fitted nicely in the screen. The original grid was an array containing a number read from a data line of the sprite to be plotted, the rest of the work done using FOR NEXT loops. So I altered my data lines from 10 wide to 6 wide and added several more data lines underneath and altered the two loops that collected and plotted the data appropriately giving me a template for the actual belt. 2.2 Referencing points on the grid Running my program gave me a 6 wide line of little tiles going from the edge of the screen, so to make it display only part of the conveyer belt I created the variable 'jug' (always name your variables appropriately kids, so when you come back to your code you understand it!) I then used 'jug' as a marker for the start point of a 24 tile section of conveyer belt, running a loop from 'jug' to 'jug+24' plotted me a 24 tile section of the conveyer belt so by increasing 'jug' by one I moved the conveyer belt by one tile. The next step was to create a loop that altered the (x,y) point of the line of tiles and after the line had moved one tile increase 'jug' by one giving the illusion of smooth conveyer belt movement. Well, it doesn't look so smooth without the pink bits covering each end which hide the jump back of the (x,y) positions. I now had a nice looking conveyer belt. 2.3 The hero Next Step was to add our hero, the green sphere, so I set up an array for his position on the conveyer belt and arrays for his x and y plot points in each of those positions. I could now use key presses to move him left and right on the conveyer belt and compare his position with the sprite number array of the conveyer belt, so his position is 1 to 6 (the width of the convey belt) and 'jug + 6' (he's always 6 tiles from the end of the conveyer belt). 2.4 Collison detection Next I simply used his position to tell if he was over a hole, the hole sprite being 2 and a 'safe tile' being 1 so he plummets to his doom if he hits a hole tile, and you start again. The same system was used for detecting if he was collecting a red blob, if his position reads a sprite 3 in the conveyer belt array the amount of red blobs he has collected goes up by one until he has collected the amount on the conveyer belt, which is counted as the belt data is collected, and if all the red blobs have been collected and he lands on the finnish square, level complete. 2.5 Jumping After play testing a little I decided to add a jump feature, which just changes the blob sprite so he looks higher up and switches off checking what tile he is under until he has gone the length of two tiles when he crashes back down and checking is reactivated. Then I added the jump tiles that simply activate the jump, added left and right shift tiles which add or subtract one to the position of our hero forcing his move, then I added the cracked tile which has the same effect as a hole but isn't so obvious. 3. Evaluation After making sure our hero couldn't be guided off the edge of the conveyer belt and adding things like score, lives, the title screens and making the data read from a text file I had made a quality little game in which the levels can be created simply by editing an ASCII file. Not bad going for a couple of days watching the TV and typing the odd line of code. There are a few minor bugs in the game, one of which being the way I plot the tiles: they are plotted form the bottom row on the screen up to the top row on the right, this means I can't have anything on the tile higher than the back of the tile, because the next row up is plotted over it. Also the same kind of problem occurs because I am plotting the character after the entire level has been plot meaning he wont go behind stuff, but all these problems will be solved in Convey 2, or I might call it 'jug'. 3.1 Tools Generally the software I use is just Zap, a basic file cruncher called BC, Paint and the fast sprite part of Andy Southgate's game suite. Occasionally for graphics I pull out Artworks and Photodesk. ------------------------------------------------------------------------------