Back N Forth (Hyperspace Edition) --------------------------------- ZX Spectrum Game for the Crash "TYPE IN" competition (issue 3) Updated and Adapted By Andy Jenkinson (Originally "Back'N'Forth" by QuangDX) Backstory: You are the pilot of the Exploratory Ship DELTA-CV19. Your ship has been tasked with the simple task of patrolling all of the 10 known quadrants, and then returning home. Why they need a human pilot is anyone's guess, but I'm assuming it's cheaper than those new Pilot Bot 3000s. You're paid for every quadrant you jump to. Which would be easy for a pilot like you - but there's a catch - The Corporation hate spending money on fuel - so you can drift about just fine - but changing direction [using the SPACE button] will cost you. Then, when you're over a portal, set off the FTL portal trigger and the hyperspace portal will colapse taking you into the next quadrant. Easy. Well easy-ish. Turning your ship around will leave an ion trail that you can't subsequently enter (the ship is far too fragile to withstand that) ...And for heaven's sake DON'T MISS with those FTL charges! If you set one off when you're not directly over the portal, it'll close the portal without you - and you'll be left trapped in the quadrant you're in. Oh and one last thing, each quadrant is slightly smaller than the last. But your mission is pretty simple. Fly around 'til you're over the portals, and FTL jump home. You're only 10 jumps away. Just try not to take too long. The Corporation is relying on you. I've tried to keep the spirit of the original Back'n'Forth - but I've add stuff, hopefully not just aesthetic fluff but also gameplay enhancements. I hope this feels like an evolution of the original, rather than a bloated mess. Updates; The Game adds one new key ("Z") which is used to enter a HYPERSPACE PORTAL. Use [SPACE] to change horizontal direction, and [Z] drop into the portal. Difficulty: I've made the game quite brutal - one errant 'Z' and you're done! But that felt 'right' for the initial unforgiving nature of Back'n'Forth anyway. Levels: The game narrows the playfield every time you enter a portal, so by the final stage it is very narrow. This makes getting to the portal efficiently much harder as you progress. Scoring: you score 10 points for entering a portal, but LOSE 1 point for each change of horizontal direction (to a minimum of zero points). This encourages efficient play to get to the portal. High score - the High score is saved, to give a player something to beat. A high scoring player also gets to enter their initials in arcade tradition. Game Ending: If you get to through 10 portals without missing one, you'll be treated to an ending screen, and a (famous) tune as your reward. Opening screen: Using the Big Font routine I wrote, there's a title board at the start, with a scrolling message with the instructions. As this is a bit time consuming to draw subsequent plays don't use this. UDGs, in order to not have lots of UDG DATA statements to type in, I've kept it to four very simple UDGs (primitive slopes). The 'normal' graphics are also used. I like the minimal aesthetic this leaves. Big font routine. For fun I've written a BIG FONT routine - used for the front page, mission briefing and High Score/Ending screens. It's made out of the primitive UDG graphics, and is defined in DATA statements from line 3680. There are various graphical things (like the portal disappearing) that are carefully error mapped to stop them being outside of the playfield etc. There's also a ship 'fly in', the ship can pass over the portal (ink 9), the "clipped" corners of the screen (Battlestar Galactica, anyone?), and the printing #1 in the "input" area. Actually I've used the top of the screen and the bottom of the input area as two symmetrical "status" panels, that I thought worked quite nicely. "Advanced" BASIC jiggery pokery: Jiggle Text: There's a routine that uses the system font, but alternately POKEs one byte later to point at where the system variable for the font is. This is used to make a 'jiggly' version of the text. A simple POKE to force caps lock. There are calculated RESTORE statements for the BIG FONT data (which have been left in an easy to understand format if the user wishes to make their own version of the font). This proved quicker than loading the data into a text variable array and addressing it that way. Lines 3680 onwards should be easy to understand (characters, space, then there's comma, hyphen, full stop and the numbers, then the letters) I used zmakebas so I could edit on a PC based text editor rather than within the ZX Spectrum basic environment. Optimisation: I've moved BASIC around a little, to get the main game loop right at the top, and shortened variable names and assigned the common ones first (for a tiny speed boost). RUN 2500 to set up UDGs (once). RUN on subsequent playthroughs. Andy Jenkinson June '21 andyuglifruit@hotmail.com