Krazy Katapilla - Peter Shaw (Your Spectrum-No.5-Page 78) [Note: There is a followup letter on the game in issue 7, but it just ] [covers some suggested customisations rather than error corrections, so I] [haven't included those changes in the program. JimG] If you're a fan of the old one-armed bandits (if you can remember them that is!) you're going to love this program. Play is simple but addictive and extremely colourful use is made of the Spectrum's display. Dead centre of the screen is the window to the action. This is the equivalent of the wheels that tumble within the fruit machine and comes up with a new line of objects and fruits each time you set the wheels in motion. The particular piece of code to operate these 'wheels' has been written in Basic, but if any of you out there fancy converting the routine to machine code you'll much improve the game. Incidentally, Peter would be very pleased to hear your suggestions as to how this can be done as he didn't quite manage to come up with the goods by the deadline (Life isn't a line of cherries. Ed.). On the left-hand side of the screen is a graphic representation of what you can win providing you come up with the right lines on the centre window. To the right of the centre display are the boxes for the 'gamble' routine, which will be explained later. The boxes at the bottom of the screen provide you with an indication of the options open to you, such as 'Feature Hold', 'Hold', 'Collect', 'Gamble', and so on. You'll get the idea once you get the program working. Up at the top is the Krazy Katapilla, which can be made to 'grow' until it reaches the right-hand side of the screen and hits the #2 symbol - no prizes for guessing what happens then! You start off the game with 10 credits, each worth lOp. Press Enter to start the wheels spinning and one credit will be subtracted from your rating. When each of the wheels has stopped, you will be notified if you have won anything and the Krazy Katapilla at the top of the screen will move a certain distance towards the #2 symbol. If you are lucky enough to gain a 'Feature Hold' facility, the Krazy Katapilla will stay where it is and the next score will be added to its length; if not, it goes back to the start for your next turn. Should you get the message 'Hold' flashing at you on-screen, you can hold any or all of the wheels with the '1', '2' and '3' keys respectively. There is also a 'Nudge' facility which enables you to move the wheels up or down. This is done again using the '1', '2' and '3' keys to nudge the wheels one symbol down; the same keys are used to nudge the wheels up, but you need to press the Symbol Shift key at the same time. Using this feature carefully, you can try and get one of the winning combinations shown on the left of the screen and, who knows, you might be lucky enough to get a 'Hold' next go! One of the most fun features of the game is the 'Gamble' facility. Once you have won an amount of cash, say 20p, you will be offered the chance to 'collect' the 20p or try for 30p. On the right of the screen there are a number of boxes with figures in each - for this example, the lOp and 30p boxes will flash on and off and all you have to do is to press the 'G' key to gamble and then press Enter when the 30p key is lit. You'll then be offered the chance to win 50p or 20p. If you're not the gambling type, simply press the 'C' key at any time and you'll collect whatever amount you're up to. If you can manage to ignore the game for more than a few seconds (no easy task) the computer will begin egging you to 'have a go' with some on-screen messages at the bottom of the screen. These can obviously be changed to suit whoever is playing the game. A note for those about to type it in - all the graphics characters are listed as lower case letters and all lower case letters are graphics characters. Got it? Well, go on, get on with it! Lines 10-40 Set up the BORDER colour and switch the keys to Caps Lock. Lines 50-90 The 'screen set-up' routine. Lines 100-110 Finish off the screen layout and check the number of credits you have left. Lines 120-170 The main calling loop. This routine calls all of the subroutines for the general running of the program. Lines 180-270 The 'Hold' routine, which includes the 'Feature Hold' routine. Lines 280-600 The 'Nudge' routine. Notice that in lines 300 and 310, the IN function has been used to detect if the Symbol Shift key is being pressed (shown by printing 'UP' in the 'Nudge Status' window). Lines 610-850 The 'Collect' and 'Gamble' routines. Most of this section of code deals with the 'Gamble' feature, controlling the flashing boxes and deciding which of the boxes you have chosen based on the split second you hit the Enter key. Lines 860-980 This routine checks for a win on the wheels. After the wheels have finished spinning and have been nudged if the option was open, the resulting line is checked against the winning combinations specified on the left-hand side of the screen to see if you have won anything. Lines 990-1190 The 'win' routine. When you manage to get a winning line, this routine causes the BORDER to flash with various colours and a message telling you how much you have won appears at the bottom of the screen. Lines 1200-1300 This routine prints the wheels of the fruit machine in the centre of the screen whenever the reels have to be moved - during an ordinary spin or when the 'Nudge' option is offered. Lines 1310-1640 This routine controls the main running of the program, calling various subroutines when necessary. Lines 1650-1820 The 'initialise' routine. This sets up the arrays, defines UDGs, etc. Lines 1830-2030 Contain the data for the second bank of UDGs (from A to U). Lines 2040-2200 Contain the data for the contents of the wheels, the value of the prizes, and the other various arrays in the program. Lines 2210-2510 The 'waiting' routine. While the player is not using the program, this routine prints up a number of on-screen messages to keep the user amused. Lines 2520-2660 Contain the data for the first bank of UDGs (from A to J). These are used to draw on the screen and include the symbols displayed in the 'win information' windows and the 'little' letters which make up the word 'KRAZY'. Lines 2670-2790 Draw the wheels in the centre of the screen. Lines 2800-3000 Draw the 'Gamble' feature boxes. Lines 3010-3060 Draw the information windows at the bottom of the screen. Lines 3070-3170 Draw the 'win' information boxes and return to the main program. ------------------------------------------------------------------------------ TYPE: Fruit Machine COMMENT: This info file was typed by Jim Grimwood Downloaded from: Desert Island Disks -- http://www.image.dk/~frankie/ Maintained by: Michael Bruhn -- frankie@image.dk