 My first Python program, of course, like I said, was writing a script in Maya to produce an automatic bouncing ball. After that, some other weird stuff like sign language issues and other fun things. I'm currently teaching Python to our third-year 3D students because they kind of need it for a third-year specialization course, and they kind of need it for writing tools for Maya. I love 3D applications, pretty much run on Python as a base scripting language, so I'm kind of addicted to Python now. In fact, I'm probably using more Python now than I am in 2D, 3D, to get to that. Today, we're going to put a project that we're working on, and that's reliving my youth and rebuilding some of my old basic games in Python, just for the heck of it really working out. So I thought, can we teach a new dog old tricks because Python is kind of treated like the home computing language of the long day, because it is nice and easy to learn, it's fun to play with, and it reminds me a lot of what I used to do back in the days with basic. So there are a few challenges with this. I want to find out how easily old games could be converted or rewritten in Python. I want to be able to recreate the whole retro experience as well. I'm going to look at my slides while I see things. Can we take tips from the eddies using the modern code? So there are a lot of things we did back in the 80s that had to be kind of optimized for the era, for the hardware and everything else. So there's some kind of little tricks used to use, some kind of approaches that used to use a lot of, like, millions for things rather than adding values. Can we take those and maybe use them in my modern Python code? And can we build new games from all ideas? Now, I written some links down here, so I wouldn't go all my way through this. So let's go. Now, modern day game development, it's that third one that I think is kind of credit, almost like a lost art of programming. It's back in the 80s, we had to program. It was part of the front of the 80s. Nowadays, you can get games like Scratch or they have some kind of WYSIWYG drag and drop thing. But I saw it back here. This is running games in code. I think it's a lot more fun than clicking and doing new things. So back in, I'll show you. Put some props along. All right, one second. Oops, I got them down behind me. This is, as everyone has seen, it's the next 81 before. Yeah, a few people. Okay, this is where I start. This is my very first computer. It's actually my first computer because I bought the stuff. I need to throw it away. It still works. It's growing enough. It's basically a one-care brand. And back in the day, it was pretty good for its time. It was cheap. It was one of the cheaper computers. It cost $199. And as an 11-year-old back in 1981, that was my entire life's savings. That was years and years and years and years of savings from secondary primary school. Now, it's a horrible memory keyboard. Everyone used to kind of play that. But it could do pretty much everything a normal computer could do. You just had limitations because of the hardware. One-care around. I don't know how many people can even imagine what one-care around looks like these days. But it's, yeah, it's kind of like icons online is kind of smaller than one-care in some places. So the program was a necessity back then. Most machines had basic, which is basically access the operating system of the machine. It was a necessity, sorry, a verbal way of doing this, because it's like the operating system of the machine. To do anything you had to pretty much type a command like loading a file from the tab or from the set-tap. Of course, if I had to open a set-tap, I'd have people in the background on the set-tap. What's that? I don't know why. I thought there was an iPhone cover. Yeah, exactly. It's like, welcome, there's my iPhone. Make one screen, there's one specific take. And when I show it, it goes, oh, my dad had some of those. Yeah, why do you make me feel all of them? But basically, you stop over at the store on this. It was a cheap alternate for blocky disks at the time. Blocky disks were expensive. I think blocky disk drive was a grand, two grand, sometimes the thing I bought the machine you had. And then blocky disks were like $10 a disk. It was quite expensive. You could store like $19,000 inside a blocky disk. This is the store. Okay, I guess. It depends on what the tape was. I just had 90-minute tapes. You know, just a stretch. Then you'd have no program security anymore. So I'm thinking of operating the machine with basic. Yeah, well, it's very slow to load for the tape. Oh, yeah, well, we're talking about four or five minutes to load again. For this one, for loading on 1K again, it would take two or three minutes. Very low. Oh, wait. It's very far up. Well, here. So after the next launch from Stead, after learning a bit of basic operating machine, it was, of course, the right games. Now, with some wild west times, and unlike today where you've won hardware, you've got your game engines and everything else, there wasn't a lot of stuff around for this. I mean, most of the time you were in beating stuff. You were learning to teach yourself how to code. There weren't a lot of resources. You didn't have the internet. You pretty much had no... We had kind of no real standard basic. Every machine had basic, but the problem was every different kind of machine had its own flavor for basic. So you could write a basic program on one computer and then it's directly loaded into another one. So the training also had to be crowded to deal with the limitations of the hardware. You said 1K around a bit, quite, the level of how you code it, to make sure that you could fit the programs into it. There was a few exciting pictures from some of the other hoarding stuff that I read in my books. Okay, so learning basic or learning program is all through experimentation by example and also by reinvention. And what I mean by that is experimentation through just playing with the code. Now, you'd learn the code pretty much from... This is the manual for this machine. It's basically a type of a program of basic, and this is what you get on time with your home computers. It wasn't like ideas had to load a game and everything else. It was like, here's how to program a computer and have a load game. What you'd also do is, after experiment, you'd start getting books like this. This is the first book I ever bought. It came in 34 awesome games for my one game, ZX81. And pretty much my first complete collection of gaming software for the machine and she was hand typed in from this book. But you basically type in, you'd learn a lot. This is how you used to learn a lot about programming. You'd type it in and you'd go, oh, yeah, that line reads a keyboard. Oh, I see this line now prints the screen and this one deletes it from the screen. And then you'd reinvent. And in fact, it even says at the beginning of this book that you should type these games in and then put your own first thing, your own touch to them and rewrite them. So you'd reinvent some of these games by changing stuff and seeing what would happen. And of course, Parkland Books is another one. The other big resource for programs was magazines. And back in the day, magazine wasn't like this day. You'd have one glossy reviews and then play some music. Parkland is full of programs, game programs that people write. It's events with magazines. And you type these and you type these for hours and hours and hours and hours. And then it began to suck. You just turn the machine off and type another one for a couple of hours. If it worked, it's safe to type. I can't imagine how many hours. I probably would have wasted a type of stuff and just turned the computer and started again because it just sucked. And we didn't have any internet, of course, so we didn't have access to a huge amount of resources. So all of this stuff was pretty much our knowledge base and our education. If you wanted support for some of these games, anybody who gets support would be to spin it somewhere, would be to write, let it to the editor of the magazine. This is program working. There's an error or something in there if you're lucky in that good print, your letter. A month later, when you got the next magazine, you'd find out, oh yeah, here's the answer. The interesting thing about New Zealand was that all of these magazines were always three months behind everyone. Mostly from the UK and all in the Dutch, which I think is still around, in the country, but they did it three months ago. But I think it's because of shipping them and of course, you know, the fire surface and everything else would take months. Of course, they're coming every month, but they'll always be three months behind. So if you send a letter and you have to wait three, four months to see the result of that, you can't forget when you've just got it. Of course, that'd be like three, four months ago and then what was this guy asking about an old magazine for? I think we were a lot more patient back then. I mean, that's part of the part of the fun is curiosity of typing and seeing if you can come out and have a read. And he did mind typing it because it was really fun to think about it at that time. Now, I kind of upgraded eventually from that one to one of these. So this is my specific spectrum. This one's the 1983. I think this one came out. You'd probably catch type with that. And you've got this rubber keys. It's still a memory keyboard underneath, the keys that push down on the memory keyboard. As a real keyboard, as they call it, as color, this one has no color, no sound, literally almost no graphic capability. You can craft some glyphs on the keys and maybe 64 by 44 pixels. Used to read that for fonts. Oh, yeah, this one, I'll read it for the font, the UDG, so I've used five graphics. So unlike this one, where you couldn't do anything apart from text and some glyphs and a few random blocky pixels, you could define your own things. You could print things in color. Ran a little bit faster. This one had a 16K around. And I eventually had 48K around. So I could have some real power to program stuff. This was the network progression. This became probably one of the most popular machines on the market back in 1983. It has a huge amount of software available for it. It's a website world of spectrum and it's just archived. Literally everything and it's all legally up there. It's one of the key permissions for this machine. And it was also bought by the software for a set date. So this is for the screen. It's you draw things in the screen. It's you load, play, what do you have in the background. Sprites in there. Call your game logic in there. This is what kind of inspired this project. It was a fact that I picked that up and I thought this would be quite fun. I wanted to use it because I was trying to teach my students about logic and understanding that the hard program is being logically break down something and understand how to implement it. And for exercising in a 3D class I thought, oh, I like retro stuff. So I get in the gym and say let's do ghost and background maze. What's the logic behind programming how a ghost should move in a maze? So they kind of got it right and quite thinking things like that's what make it go around and around in circles. What I'll do is I'll put together a shell program and just have like a ghost in there. So you fill in the logic and make it work. Nothing really did it. And what I was doing was, well, hold on, this play game stuff looks kind of similar to how I was creating basic techniques. Maybe it's this could be a real fun little kind of system for translating some of this old video stuff just as a challenge to see how similar it was the whole way of developing programming stuff. So I went ahead after I got in here after I kind of played with the exercise I just opened it up and I thought, well, I'm going to throw the rest of the game. So I sat down in it writing all backman just with kicks and it's probably playable version of backman. It's not 100% finished. So you get scores you can equal the dots when you die it just sits even and it doesn't finish all the code before the game probably like the full game. So it doesn't start new maze or anything else, but the whole code was in it was actually quite cool. It said, well, this is no different than writing this in the 80s. So let's have a look at what I can do to get that whole 80s vibe going and can I get it to kind of look like something in the 80s as well. So can I get that kind of look of it, can I get the games working, can I code it with the same kind of approach I used back then. So let's kill backman. Here's my slide. No, we're closed. I'm sure I'm closed. Oh no, didn't I close it? Yes, I probably closed it. Let's go back and I'll just reopen that. I'm going to take it off. Okay, so I'm going to play some pie game heads that any players should obviously play on. It's actually really easy to get groups with. The coding structure is pretty similar to what I was doing in basic. And yeah, just like basic, it was a lot of fun. So I wanted to start off with some basic games. So I decided to go for the old ZX81 games. This one here, in particular, this is 1K. Now, interesting with 1K games is they're short and are really amazing. I didn't want to spend ages translating 12 pages of basic code. OCR it. Right there at once, it doesn't recognize half the characters for some weird reason. That's what I see about a basic game. Let's get out of this rat question. There's a whole crap I can't record. What was it? There's, that's a whole game and that 15 lines of code. But you could play, actually they're not bad games. I mean, for 1K, it's pretty impressive. Now, there were some interesting things for the 1K games as well. Just the fact that we were looking at, we're looking at short code and now, so I'm looking at ways of optimizing. But the way they would optimize to put the sentence around would be through using all kinds of odd techniques that kind of look really weird and alien these days. But they did make more interesting code and it's kind of a specific actually to utilize some of that in my Python. So there, there are little little Linux icon. That's actually more for 1K. This is where to show 1K. It's just to show a picture these days. Students, you just can't visualize what is 1K. So the first game I thought I'd try was a simple dropout. The whole idea was you catch coins and say drop down the screen and you had to get to square a 10. So 10 coins would drop down. You'd move a little bucket, which is a funny little black thing. It's just the lifts on the keyboard. And basically after 10 at the tell you you scored whatever on the 10. Now, I broke it down and once you had a little structure of this thing, it actually all makes make sense how it's pretty crumbly, but it was all pretty straight forward. And by understanding that, I could go, well, actually in Python I just work it out my head. So you have like the initialization of course at the top of your variables. You have two for loops. The first for loop runs again 10 times. So basically you have another loop in the middle that basically moves this O, which is a coin, down 10 frames and then it works out if you caught it or not. And that loops again again and updates the score. And at the end it just prints up, hey, you scored this much out of 10. Pause before you fall. Pause for a very long time. Until you hit a key and then run as it just gets back and re-runs the program. So, the observations I thought I'd just make some of that. The use of constants versus values. Interesting thing is because you have 1K of RAM everything you type in basic takes up this RAM. And the scoring thing such as numbers this actually takes about 8 bytes of memory. So 8 bytes 1000 bytes of total memory you can imagine that starts right real quick once you start putting lots of stuff in there. So what they do a lot with this game was they start doing the thing where you'd set a value and then you just use let another variable equals that value. So you use constants. And by doing that, of course, saying this variable is this variable, it actually shaved off about 6 bytes. So it's a lot easier. It does make some of the coding look really weirdly inefficient. You think it's kind of what you need to do. I'll see if I can find another example. I think it was you set the top all the variables A instead of using a value because what was doing was storing the start, storing not only the accurate representation of 10 when it was a value, it was also storing a binary value inside the internal value itself. So vowel 10 would basically say convert a string into another, which of course you can do in Python really easy. Then B would equals that. So that would shave off maybe more bytes. Z equals B divided by B, which is kind of one. That's just a really fast way of saying one, but that would actually give us four or six bytes. Vowels again, T is Z plus Z. So you see all of this stuff here looks really, really weird and looks really strange and inefficient, but it was all done because it was using less wrap. So it would be quite creative with some of the approaches to how they would apply stuff. So a lot of mathematics were used as well because all of these commands let, which is for setting variables, if you're not familiar with basic friends or things, are actually stored their tokens. So they're all bytes. So that would take a lot of space. I forgot why I was scanning that kind of story there. So I might move on because I've just got enough of a weird attention there. You get to observe that you belong to the program. The program itself is using up your memory. Your program is competing to store itself with the actual running. The running doesn't take the memory. It just, because it's interpreted, right? So it just starts to process that. The commands don't take a lot of memory to store. It's the things that strings and values that take the RAM. And with one K of RAM saying, I'm a lot, what would happen is if you were to do something fancy, like you print a maze, for instance, or that data would match all of your RAM. So you print a screen and it would come up without a memory. Without any game at you in there. So you had to do this weird approach to start. Just the shape that takes a few bytes off, just the force you've got in there. Let's get back to this one. There's a lot of things like Booleans as well. If you in key, let's you read key on the keyboard. So if in key, 4 key was pressed, then of course that's true or false. True or false is like 1 and 0. So rather than going if x was pressed and x equals x plus 1, you just go in this case p is position p plus 1 or minus 1 or 0. So you set to add or subtract from 1 often. And do the score same thing again. 1 to the score. You just use some Boolean logic and then select t, which is the t, half the variable name. So you get 1 letter as a variable name. Plus whether the position of the character or the player was lined up with r, which was the coin position, or p plus 1 because it's 2 bytes was lined up with it. So just use that to say add 1 if these 2 things are true. Listen to the truth. So this is an interesting approach. You can use this and you can use this quite easily as well. So before I could start counting in 5, I actually needed some stuff in here. First of all, I wanted to get that whole retro feel. I needed a mono space file because everything back then was of course done as 8 by 8 pixel characters. And a lot of the time when you're making games on this machine, you're basically going and you're blanking things out. So you draw it and you wipe off the screen by printing a space back on top of it. And of course with our mono space file the spaces are usually tiny out so you get these weird glitches that are kind of ugly as part of your stuff that doesn't disappear. So I found this one here called zx81.font. Now I also had these glyphs and the promise with the glyphs that font doesn't have those. So what it did instead was I actually drew it and I think it was a Japanese bit a sprite drawing program that I found a free one. So I made it a graphic that represented periods where there are two glyph characters and a new one other function because these games have a lot of printing going on. So rather than having to go and print things to the screen all the time I just made a B print that's basic print. And I also had the four parameters which exactly the same as what the basic command was. So I'm kind of duplicating the basic command for the Python function. Okay. Now I kind of compared the two after I stripped out a whole pile of pygames that I was like checking for events and everything else I got with kind of pretty similar code. After what you said the code isn't actually that different neither is the structure. So there was an interesting exercise on the show what this game looks like. I should play that before it's this fantastic. Okay. So our idea is a bit of catch. The coins which is the other one. Of course the thing is you could never get 10 because they fall 10 characters down for a 10 for the test. And coins can be anything between 0 and 17 across the screen. So there's no way you can get to the other end of the screen and catch the coin. So there's a few flaws in the game that are probably to make it more of a challenge for some weird reason. So if anyone has not seen Pygam it's actually incredibly easy to set up for a generic starting boy. And I'll just I was going to do a quick demo of Pygam anyway. But just to show you how easy it is to set up. Can you just up your font size a bit? I would touch this application in a long time. I usually use the control class. I've never heard it before until I had to come out of college. It's an interesting thing is that security skills are now teaching programming. Digital technologies unit standards and then when it's in real intermediate, they will fight on the start. And they said, oh we use Wing ADN, I've never heard of it before. It's actually not a ban on IDM for coding. There's a free version which is this one. There's also a pay run because I don't have the error stacks and the property bagging and everything else. But what you do for Pygam is you import Pygam and you import this. There's another library in Pygam called Pygam.Time. Because you need that because what you want to do is when you're writing a Pygam you want to be able to set a play rate, a speed frames per second. You also want to import a bunch of local basically your kind of enumerated list I guess. What it does is because you can get at least used for identifying events like quit and stuff. So from there's a little Pygam.Lobels and just bring them into the default root namespace. It's also important to assist library. I just want to assist quit, assist.exe. Because when you quit a Pygam application, it doesn't always clean the player itself out. So you need to run assist.exe to make sure it purges the whole thing. It comes up with this weird conditionalised error when you start it again. So setting up Pygam is pretty straightforward. What we need to do is start with Pygam. And then we'll just make sure it loads. Then we'll just make sure it loads and initiates all the Pygam modules that you need. You need a clock and it's GameSpeakControl which is where the time comes in. It equals Pygam. Time.Clock While they're downloading that Pygam there's a number of times there's OK stuff and functions and there's things like that. Sometimes it's OK. We also want to basically get a window, display window. So of course we type in I've got my messy code there. Display.setMode so set your window. You want a little tuple in there that defines width on my height. And that's giving you all the basics that you need to start running your Pygam. Game window really increases its surface. Basically you can draw straight onto it and it gets buffered and then you update or basically flip the buffer onto the screen by frishing it. So everything you do with your game you're basically using game window and you're basically starting game window just and they just refresh it back on the screen. Something you couldn't do with this of course because you don't have a buffer in the background of course we ran for that. So what you did when you printed was why is it down the screen. So games back then were flickering because they're like printed or blanked out. It's a TV screen which is going update, update, update, update, update. There's TVs there. So once you've done that all you need to do is have a loop in there. Now this is the real problem. It doesn't have a game in there of course obviously. You do an infill loop and you just put your game loop in there. And that's it. And then you just have to have, I think there's events here to just make sure if someone closes the window that you cleanly exit the application. So poor screen current terrible event program and there's a big pie event not good. Just read all that events that occur like mouse clicks and key presses and everything else. Big left top small isop top I promise not to break this down as a commander. So the event equals and this is where your hope is coming which means someone's closed there. Close the window you just want to go pie down dot quit, quit and just do a system to make sure it's properly closed down and that's by the tree. It's as simple as that to do any kind of a pie game. If I'm running it's going to be very exciting and we'll probably display a new load syntax type wrong equals though and it's quit defined in here. quit came in here put into the root space so it's just exciting stuff do stuff obviously there's nothing in there so it's going to display a nice black window exit it should typically now exit because I've probably got to do something I'm pretty sure I'll eventually die. I'm trying not to worry I'm supposed to go away Let's see what you did in your code you should have done. So let's have a quick look back here so we initially initialize it we've got a pie game clock we have to use that of course made a window I'll put through my source code did I do yeah it's quit so let's the events start type get the type might help and then I cringe and hope it doesn't crash yeah so you pretty much do stuff here you always have to check this because you want to make sure that person exits again that it does force it to close properly but quite literally that's what there is to it now there is if you were drawing things in here you would go in and you would have to type basically pie game with the slide not update which will make sure any graphics you drew onto your window were refreshed on the screen and to make sure the game didn't run too fast this is where you put in your clock which I think is a cool game to speed dot and there's a colloquial tick and that would basically go in and say having friends sitting on 24 that would just make sure the machine didn't run fast in 24 frames so I could delay in there to make sure that it holds the game re-runs the loop for that meaning now when I'm doing the 8-bit stuff to make it run like that it's like about 4 frames a second just to make it feel right but pie game is simple as that that's the nice thing about it basically you do the same thing you set up and you just have like a game loop line or a follow and it'll just loop it around now there's a dropout on there it's always like oh my god it's complicated 90% of it is comments it's in green stuff don't worry about this it's just lots and lots and lots of comments I like to keep the comment like that anyway mainly because it's really about me remembering what I did in first place so for that dropout game I put in some like some constants in here some colors which are just 3 digit 2 pools one of the scaling thing obviously the machine runs at 32 by 24 characters each 8 by 8 pixels on a 1920 by 1080 screen so I put a scaling factor in there so I could scale everything up there's my timer there there's my lovely window there I loaded the font that thing there's a thing called the font class you can load the fonts and then they become kind of font and you can then read the text so it generates like everything it generates but then you put them to your surface so I wanted to bring in that block excuse me drawing that will shape like that I had to basically use transform to just make sure it was the same scale as the text because it was drawn as 8 by 16 there's my function different and you know it's just splitting basically a graphics object which is like a bitmap to column and row and so I made the game a function the reason I make it a function rather than put it into that while loop is so that if I need to exit the game or rerun it you call the game as a function then when you exit the game you can go back to this main loop you can have a press space to play again and then just run the game by calling it as a function again and I can also use it to return the score so I can have it once the game finishes I can print the score on my main loop and then go back and run it again if I need to so it's pretty straightforward with the basic I've copied it live for life I had my two variables obviously it's easier on Python then p equals 0 and t equals b I'll wear the inefficient one again for loop for loops and basic they are really just number to number it's basically a range game with a fill white basically is what called CLS which is the clear screen so it fills that it fills that surface up with a pure white this is when we use my font and what I'm doing is print the score so just set it to black and white and the true means for anti-aliasing all this stuff is on the PyGam website it's a really good documentation for everyone you can print a random number from 0 to 17 which is what I'm using for positioning this coin so basic and then I have another loop that basically drops that coin down so it's just like the basic it's almost an exact copy of course you have to check in there to make sure that someone hasn't quit the game or you're only playing it and you make sure the coins closes everything I used the same Boolean approach that was in the basic there's a PyGam thinker.key.getPressed which I'll ask, you know, this is key pressed all this stuff here is part of the locals k underscore key so plus whether that key was pressed minus whether that key was pressed again that whole Boolean thing plus checking for balance, making sure it's again side then I printed the coin again just using that font and then dot render which generate a little bitmap and it's in to my big print thing so big text is basically a bitmap generated by that this is blipping it to the screen and we printed a nice graphic for a character which I loaded up there somewhere there and then I refresh the screen and then I go through and I just wipe it out just so you can basically see we used to print the space on top and it just kind of wipes it off the screen and of course here's my tech so I used 6 frames a second later to make it run like this high spec machine right here so that's the loop that goes here your coin drop then I did my update my score so score to score plus with a position of the player was at the same position of the coin going down and once that loop of course is finished it returns back the score so all I have to do is give my main game loop call the function get the score back and then just use the font, render and print the screen then of course you can refresh the screen otherwise you need to see the print thing I've got a bit of a hard way I might not be able to see my score going I'll go back to update the screen and then I still loop to wait until the space key because it said if you press key call score 44 print the key but obviously you won't be holding the key down why you were kind of playing the exit and then oh, hold on, key is pressed so I can jump back in so I used the space bar to see if I could space the replay so we just keep looping until the space is pressed and then of course it just goes back out calls the game again gets that print to score so that's literally just a transition it's not that different to what I was doing 33 years ago so that got me kind of inspiring how I'll do more so I ran into a few other problems now once I've done that one I suddenly realised all these other games are cool there's scrolling games and everything else some of you are getting to produce a new challenge I found that basic jumps around because basically it's really just through the alignment right so you have to go to to jump to the parts in there go to or go sub so I had to rethink a lot of logic on these games because if this happens then go to 90 if this happens go to 100 if this happens go to there and I had to just build different logic so I didn't have to jump around my curves and then do the curve in there using these ability to input text that was the tricky one because you can't pop up a window so I typed some text to make it that true retro thing I had to have the typed input at the bottom the other thing was interesting this is where it got a little bit more complicated some of the games were asking for what was on the screen everything in that machine is done through memory so all your sd characters are stored in a block of RAM and to exit the screen you basically would print to the location where you want to position the cursor and then you read the memory address to find out what the bytes had there memory address was and you had to also track that and the graphics were actually printed so drawing on those custom graphics that little thing that popped up for the player was going to become really tedious because some of these things had lots of characters and everything else so I ended up having to write my print function to then handle these new globes and then I realised there were other modes that had input the text and everything else so I ended up developing ZX basic class so I ended up making this class that did it all for me that was pretty more fun than writing the games it basically replicated a lot of this common basic commands like print and input and all the things that I needed to scroll on the screen and everything else it took care of printing the graphic glyphs to text and then do the text so it would kind of manage all that so I didn't have to draw graphics all the time I just had to draw all of those but as far as controls the user input controls the screen scrolling because the screen can actually scroll allows for almost a one to one code translation so by the time I finished I was literally just typing basically the calls almost identically to what I had there now the problem is that it's making it almost too easy and I actually got bored out of my games so I was going to do 34 as a challenge but on my lines I had 34 but I've done games based on this book I don't know if you can follow it because it's just getting bored doing those new challenges but it's too easy it takes care of also making it screen memory because of course as you print you need to position this into a memory so I made this big list that basically represented the memory spot sands or a code that we scroll, shift or let data out from everything else ok it made life so easy the camera was boring and each of the games started getting done like between 20-30 minutes at most I think it got something like 10 minutes which is a good short ones and I'm going to bore you there for a quick quick bore so here's my class my class is in here this is where I put my glasses on there's a class that's important here and what I did was you can kind of see what's happening here if I can't see the screen basically you initiate your instance of your class and then it says you create screen which is doing the whole setting up the game window and everything so I wanted to take care of all that that's why having a class that manages everything inside itself CLS basically my complete screen double window I experimented in retro-rising the screen refresh so I could just say I got an update TV screen I bought it I decided I'll put that in this is the one game that actually replicates probably the most accurately because it does have flashy blinks and horrible features on there and then I have my function of course in here we have my I put a random command which is a basic one all it does is just the random command but of course it needs to type in the basic how it looks like more like it I've got my printout command I'll put my TV update to print that you notice I have in here an underscore, sorry a pipe what I did was to put glyphs into the text or normal text I actually just started tagging the first few characters of strength with a pipe and then G to your I so you have to make it a little different as anyone obviously because you don't have those so I do that that gives me my kind of flexible input print reference without having to draw all the stuff and then printout I had an in key basically just go to keep key first thing so I pretty much typed exactly what the basic was plot command which draws a pixel, 64 by what you call it if it was and then I have this TV again and of course there's my print again, I've got my TV again so I can blink, which is awesome okay hey quite literally this is almost a one to one copy of the code of the basic code because it just made it so easy to do that I'm going to run this I'm playing this over command in one game so the whole idea of this game was really just to get to get below the missile from the city oh is that the city at the bottom? yeah that's the city that's what Auckland looks like in 1983 you know it's a nice flickery plus that's because I'm treating it with my little extra special I just update the screen when I actually print the space there so it kind of does exactly what this can go forever it's almost too easy these days when I was a kid this was really hard because of course you can't push buttons at the same time on the can here to go dangling sitting here down there I didn't see a peak in your class this one you don't have to worry about because what it's doing is it's not actually checking for a character because what it's doing is checking a corner this is plugging a pixel and then it's checking a corner of the plus and then there's that one oh I blew it, I lost so this one was fine there's some of the games that some became a lot more complicated so I got one here called Niagara where you have to take your little barrel down the rapids and reach the whirlpool now this one was where I the second one there's all the whack I usually use I usually use I usually use I usually use no pet plus plus for most of my Python just that I have it does anyone use no pet plus plus so now I've set it down and I've got the 5-in-10 just that you launch Python straight out I use it for everything I use it for scripting too I think I've got a language syntax highlighted for a mel script for Maya and one for Hellscript which is the lightweight can you do a control plus again oh yeah sorry it's got a real tiny yeah this one's a little tricky because this one actually does require, I've got a ZX scroll this one did actually require this one character and I had to pass it was passing the same structure the I, the G or the T so I could pass the character I needed to check and then the coordinates of the cursor inside the memory so I inverted you have to watch out for the inverted spaces and precisely it used to go to the end of the program to exit so the nice thing being a function it's going to return to exit the program going back to that again and again it's just literally almost a one-to-one translation of the basic so I've probably spent more time writing that class in the program but I'd love to find something new and add that function to where I just keep wanting to use commands and translate the entire language to play class so I just type ZX stop ZX stop the whole thing got to get that go to ZX stop line number right funny so the basic module I should have done updates and my thing was changing the version ok so print modes use the pipe that ok I have a whole pile of my values in there so if you've got tv stores against this object there's also a cursor location there's a print command that comes in the machine just print to the top of the screen and of course if you print just go down the screen down the screen so I wanted to be able to just get print so I needed a cursor location where the character cursor was so I wanted to print it that would come up at the right spot I also put a border on there because again it starts to look ugly when they're crammed to the edge a list which is the screen map which is your screen memory and also have a dictionary called screen codes because all of the characters like the inverted graphics and everything else oops it's all actually in the manual here all have their own pipe being so I would get it to look so good carry away with that I ended up initialising it doing that so all of the files I've done all the books on so all of those little 8x pixel books and then again I put more G and then the key name so it's easy to manage them so what I've done is I've kind of loaded all the images into basically a dictionary the graphic keys I've gone through and then I went through and see it to draw those clips yourself it took a while there's a 20 or something and then I basically went through and I just did a whole ton of kind of looping through and setting up this dictionary with all of the pipe codes and the characters they written that so I've put them in some memory papers and that's probably the most time consuming part was just making the screen memory part because everything as I was printing as I did scroll everything I had to have to that screen memory so then I could read with the peak memory address or location just find it in that big list so nice and easy was kind of easy and as you can see everything down here that was really basic that's terrible unplot which were a white square a white pixel instead of a black one there's only black and white nothing else I thought it was kind of interesting because all I did was I ended up just putting this thing at the bottom of the screen as you type keys it would just render that string on the bottom and you'd be backspace and you'd push return it would just keep going until you'd push a return key and just throw all the stuff inside inside the string that you'd be able to return so it was probably the truth one of the most interesting ones but surprise it wasn't that hard to code print command and scroll command it was actually a scroll command and play game that will scroll your screen surface and I won't read through all this code because I know it's at the worst and actually someone's there and talking about coding and re-coding that there's one that I did need to do was SIGNAM SIGNAM does it's basically returning the sign of the video I looked everywhere and typed off one in the edit it was copy sign bracket one copy sign bracket one copy value I just made a sgm command which is the basic one and then of course you've got a little test code down there just so people can give an example of how to do random stuff so I could tell that just like the ease so I ended up doing that I think at 9 games I came up with pieces which this is a motorbike game you have to drive down the motorbike the track and my question resides I've seen that on a Niagara and I think we ran this right down the key so yeah I didn't read the instructions one and four there we go 10 green bottles I think it was the L1 Tesseract which I was thinking was Tesseract it wasn't so much a game one of our novelty patent drawing program this whole purpose was literally just draw patterns randomly like that and then every time you get around the level you clear it and start drawing I always run this book so I got a bit of obsessive over it I did one text game used it as a stick it all up and get up and just take photos of the pages for the ones you haven't done well I would scan the whole book you can't buy this book anywhere it's online I think you can buy it if you look around but of course it's probably out of print for the last 30 years so that was one where I actually had to use the input form and then print it to keep scanning down the screen or anything else it's an obscure little game it's just I don't know everywhere in the 80s it was a Hustle Wompers game I guess it's a monster or something like that it's a terrible game as well did you enjoy it? it was awesome basically you travel around these caves by cutting the number on the map and as you went there if you were near to there was a bat you'd hit the text black with popup it would tell you where you'd click it and it would take the number so there was a mine close it would work out basically next to a bat it would tell you flat flat so you knew this way this way that way that way if you moved in the wrong spot it would pick you up and click it around the location draft the easier bottom of the spit so somewhere around you is a bottom of the spit if you move on the wrong way and you die and sniff this means you need the Wompers if you move on to the Wompers you kill them and you catch them these are sort of games that were around I don't know for some reason these are like oh my god this game is awesome nowadays it's like oh my god that game is terrible but the nice thing about this kind of Hero is that it's basically a lot there's nothing to copy at the time today you've got video games you've got mobile games Hero wants to make a recreation of something in the style of something there is you didn't have a lot of that we're talking about the birthplace of the computer gaming industry I guess and and let's say something exciting and the nice thing is I've got I think about 400 magazines at home so I've got giant library games and the fact is there's so many games that are kind of original and interesting and it was quite a creative time that I've got a really good library of standing points so I can build more modern games from but no palm but no one I've got Breakout and remember Breakout it's like someone said I want Breakout it's Iconoid it's Iconoid's granddad that was the last one I actually coded to be honest it's quite rare so it's a good kind of fucking season and surprise for 1k it's actually hard hard basically the whole idea is to try and the whole idea is to try and clear that the bricks I guess the big black mess up there now if I get my notice it does have a slight inaccuracy in terms of pixels when you read the texts because I saw the notice these little lines randomly disappearing all over the place that's the authenticity doesn't it there is one called yeah so authenticity there was actually a thing called squash which is long I'll show you I mean by original really quickly just share some of the things that kids would come up with so these are all ruined by kids so this is running on a spectrum so it's the big pretty color one these are the ones I actually typed in I found a bunch of tapes and I digitized them and it's just been playing the emulator so the whole idea is you had to go over and you had to jump over the dragon I didn't have the logic right for this because I could never work it out to you anywhere then it's how flickery that is that's because it's drawing and undrawing it's actually because the spectrum could define your own graphics suddenly it went from O's and blocks and everything else to actually be able to do something that looks like graphics from a video game and you have a color of course the colors are but these are games that you wouldn't see these days kids don't sit down and start carrying on I'll just see what the cave in that jumps out you jump over the fireballs and jump on the dragon and everything else that probably will like to go oh I'm going to make a version of something because there's so much of stuff around now this one here you have to stop the mosquitoes attacking so the mosquitoes fly over and you press one key or the other key to fire a jet of bug spray and it will just randomly move around so quite quite interesting some of the wacky ideas people come up with and this one here it's slow because it's actually physically flattened pixels and drawing lines you basically had to get your dog and stuff the cats laying on the bottom and scare off and then get back up to the trash can bouncing cats it's hacky it's catty sack it's like the drop the coin gate you can never get to the other end because it's further to go then the mountain's higher down there and if they get to the bottom the number of fish go up but it was an interesting time I mean like I said all these some really creative ideas the cats are smacking stuff up because what else are you going to do back in the 80s when you write games you're just going to have to invent them yourself hey I'm doing really well now there was actually quite a bit of something between a fiction club or that that's why I'm throwing that up to me now I'll put it all or something yeah I have a point to a few meetings in town with it as well I used to host it at some time we had a photograph studio oh okay put something like QL to oh yeah that's the last very long that's the end of some years when you get your R you get your mic and it's just going on crazy so this is a chance to take a lot of that stuff these days you've got it and you know convert it to Python because it's not actually that in different coding the language might be different but the logic is the same then you boot this up a really nice library of new ideas and then take and kind of build something a bit more uniquely so that didn't bore everyone too much if you want to read more about my waffle edge you have a three article blog a bunch of blog posts up there that talk to the dropout thing my thought process through comes that PyGang stuff explains how to understand the basic and on the code for this I just showed you all those games I put up on my Google Drive so I figure out what's the download of the stuff and all themselves in there and that's all up there too so the class and all that stuff so you can read that apart do you have any questions we like to finish by yeah okay this is 5-2 right now you've got your basic whatever class that it was with a lot of the basic commands in there plot and that sort of thing if you're getting bored of converting the games from basic to Python you've got the third dog to do do you think about expanding the class so they can interpret the original basic I didn't mean to blow in the text files yeah just having it interpret the programs to sort of straight out of the book as it were actually I didn't thought of that but that's quite interesting I'd be able to interpret it and get all the functions there so it's just basically doing the file breaking it up and then just split so she logged out again I'll try that just to challenge my thing I was also thinking whether to start looking at translating some of the other basics the basics of all different machines every machine has its own way of doing things some weird characters to do clear on the screen hard to symbol or something I know there's been I think the fresh implications we've actually been taking on other systems of the VPC basic from the model B computer so I wonder if there is a ZX81 that's already out there with emulators no but there is there is an implementation and an interpretive of the VPC basic along the lines of what I've said is that a ZX81 or what so I'm not worried I went to PyGam, there were a few old retro gaming which translations on there so people had been doing it and really creating old retro things but it was an interesting challenge again a chance to relive my childhood and give me kind of a bit of a midlife crisis fix for a while so anyone else can approach me so boy are you really sad when you've done that that's cool the point where I got sad I remember there was that point where everything was in basic your first example is 15 lines actual basic and then things like Spectrum came out which was so much better hardware wise but the basic was still the same and people started coming up with those clever little loaders where you would write a 10 line basic program which would then 20 lines of DATS and poke them into me and they were effectively writing machine code as a basic program and you would just at that point type in random numbers it was a freaky thing that way because it was a basically good computer and then used the current machine code listings and I got to look through 20 pages of hits a decimal and you have to type that in yourself you work with a learning thing that was like 4, 5, 7 7 hours of time they were using you as a type reader weren't they but once you've done it you can then go save the name code and address and you can save it as a binary you can then just load that into memory and run it but of course type in that in the first place and it's like hour and hour and hour and hour I wish I didn't have to do this and every line would have to have to check some wrong old thing would be wrong and sometimes you type them in and just hope that they would run and nothing worse than typing someone's program and then suddenly realizing it doesn't do anything or it crashes all the time you have to decipher someone has to code I mean the other thing I was hoping to do was I found one of these old listings it was a film paper I was surprised they survived 30 years luckily they've been stored between pages and I've got a machine code game I wrote that's about 7 meters this paper is 10 cm wide so I found one of these old games I want to eventually see if I can translate into drinking pipe or running figures next basic one based on because someone asked me about I can you book that game somewhere we can play it as if you know typing it last time I remember it's getting ages writing some good space shit about the game there's all the music and everything else somebody put the beat the funny thing about this hardware was to make it sound it actually had to sit there and vibrates a buzzer so it had to vibrate a buzzer at a certain rate to make it tone and to do that you could do anything else because it had to run fast enough to do the tone so the old machine would pause when you made sounds and so it would be so what you do in the end is you find these little tricks where you make these little boots and you just do lots of little boots instead so you can at least play it while someone's playing the background so interesting time to see it oh there's our nice our nice graphics where you start to draw on good paper and then type the binary into bytes just hope that so you had to use the 16K memory for this one right oh yeah I've got about six of these at home I don't know four of them actually were going to test them and I wanted the keyboard to sharpen them because someone's opened them up that's why this basically had plates that came off them and they had this rubber they had a membrane in there that's why I put the membrane out and it's a bit that usually goes because of the heat of the machine just disintegrates this thing here just two bits of plastic and it's separating two sets of contacts and the keys are just like a group and you have the horizontal vertical and it's just working out from line 6 and line 4 of keywords and this is like little contacts you squeeze them together and follow up these are your key threads and they get heated up and then these things crack and then some of the lines crack and it doesn't have keys anymore and I read to my parents and they buy me an extension keyboard because my computer was broken but it's because I couldn't play games because the space key was broken so I can't play many games I can't jump, the space key stopped oh my computer's broken thanks okay cool the tree's about done in this as well so thanks very much for that