 Cześć wszystkim. Jestem Rolando Piralski. W mojej tradycji lubię grać z circuit-pytonem. Chwilać te fajne, świetne devices i programować ich. Ale dlaczego chcesz zrobić filmy z tym? Wreszcie... Kiedy wchodzisz do operacji, czy w rogu koncertu, widać, że tam są te profesjonalne ludzie, którzy pracują za miesiąc lub miesiąc, żeby to zrobić. I nawet na konferencjach tak. Mieszczysz, że masz dużo pracy w jednym eventu. I to jest trochę jak to, co normalnie masz w komentarzach. To jest wielki efekt, z wielkim numerem profesjonalnych ludzi, którzy to robią cały czas. Ale nie jest to jedyny sposób, żeby słuchać muzykę, żeby pośpiewać muzykę. A nawet, że masz sesje, z twoimi przyjaciółmi, czy masz wioska na stronie, po prostu grają, jakaś instrumentka, po prostu na stronie. I to jest to, co robię. Nie jest to profesjonalna rzecz, w której spędzisz dwa lata. 100 osób, z nią poszukiwania. Ale po prostu jedna osoba siedzą i w dwie godziny mając smak czy szlapie, czy coś takiego. To jest bardzo fajne. Możesz jeszcze to zrobić z przyjaciółmi, i to jest super satysfajne. I to jest wielki sposób, żeby się nauczyć. Więc mam tutaj jakieś racjonalne. Jeśli chcesz robić to z Python na komputerze, to są wszystkie te hupy, które musisz wytrzymać. Było to dużo mniej, teraz masz muzykę, masz pygame 0, masz wszystkie te klasy, ale jest jeszcze trudne, jeśli chcesz, na przykład, zakupić swój komputer i rozdaniać to, żeby inni mogli zobaczyć to. I jak się dostanie tego czucia w głowie, to nie jest naprawdę realny komputer. Jest jeszcze tak, że jeśli mogłeś programować swój samochód komputer, to jest naprawdę wystarczająco. Góry na komputerze to kompleks, to tende są trochę proste i nie ma żadnych prac. Nie zawsze, oczywiście. Więc to jest fajne robić to w hardware, ale czemu masz z Pythonem to jest naprawdę programujący język. To nie jakaś bloga czy skracz, czy coś, gdzie masz jakaś droga jest już zrobiona dla ciebie, masz tylko czuć w gupach. Tutaj jesteś naprawdę w kontrolu, jesteś naprawdę nauczyciem, jak ten game pracuje w środku. Musisz właściwie odpoczywać wszystkie kody dla tego. Pytańska języka jest popularna dla edukacji, więc są już familiarizowane z tym. I jest też bardzo ładnie nauczyciem. To jest wielka dokumentacja dla Pythonu co wytrzyma się do Pytańska języka. Więc jeśli już nie macie Pythonu to nie macie Pythonu. I ponieważ wszystko jest w porządku na dywizji, na dywizji, nie musisz installować coś na komputerze. Więc jeśli to jest w porządku lub na porządku na jednym razie to nie musisz wytrzymać się w porządku na komputerze uczestników. Nie masz pomysłu usb w porządku na komputerze, ale to wszystko. I następna rzecz jest, że nie masz wytrzymać komputer. Nie wiem, instaluj coś, co ma komputer w porządku. Nie masz wytrzymać komputer na komputerze. I ten dywizj jest bardzo trudny do wybrania. Nawet jeśli wytrzymałeś kod to nie działa w porządku lub wytrzymałeś to nie jest wytrzymałeś i to jest do tego, co było. Więc można też być bardzo bezpieczny kiedy wypracujesz i myślę, że to jest ważne, że jesteś wytrzymał i robisz te wytrzymałe rzeczy zanim nie możesz zniszczyć ten dywizj z waszym kodem. Następnie jest to, że nie musisz kompylować coś, nie musisz zniszczyć ten kodem i robić to do wybrania. Nie musisz zniszczyć ten dywizj z waszym kodem lub wytrzymać ten dywizj z waszym kodem i z waszym kodem i z waszym kodem i z waszym kodem i magicznie cały moment. To zupu jest podobne wybrania. Jednym z tych wybrania ma wytrzymałeś tato heterozamanego wytrzymałemy mikrojordur na to, co jest wytrzymałeś kodem Rosjana Pi Pico Wytrzymałeś między nimi do wybrania czy coś na PyGamer, czy na PyBatch. Aby zacząć, oczywiście, aby zrobić gra na hardware, masz hardware. Więc, jak znaleźć to hardware? Jeśli idziesz do circuitpyton.org, to jest na celu www.circuitpyton.org. I idziesz do donlabs page. Mogę... To jest websitesa. To jest donlabs page. Ty masz listy od każdego celu, który jest zaangażowany przez circuitpyton. I, oczywiście, nie wszystkie są na celu, aby zrobić to, co chcesz. Chcesz, prawdopodobnie, jakąś formę. Chcesz, prawdopodobnie, też chcesz, mieć klasy na to, jak tutaj, na PyBatch. Wygląda na to, że jest pomysłowe. Jeśli klikasz na to, masz więcej informacji o tym, masz link do filmu, jeśli musisz to zainstalować na celu. Wszystko z tych celów, które są już na circuitpytonu, na jednym z nich musisz zainstalować na celu, przed tym, aby używać. I, tak, zwykle masz link, w którym możesz zainstalować ten cel. I, tak, przygotowałem krótką listę z celu. Możesz używać tych, tych, które są najwyższe, tych, które mają skrę, i w porządku, i, wiesz, nikt z nich nie stopa, nie używaj, nie używaj, używaj accelerometer, używaj tapscreen, i tak dalej. I tak, to nie jest taka spokojna listy. Tak, więc to jest część, w której pokażę Ci, jakichś z tych celów. Więc, zacznę z celu, z jednej z najszybszych celów. To są pewne pewne pewne, w których... To jest w porządku. I możecie być zadowolone z bieżąco z Europejska, z 2019 roku. To wygląda tak. Wszyscy uczestniczy, i w tym razie, jest to najwyższe, tylko trochę większe. I, tak, z tym, możesz używać pewnego biologii, o których będziemy rozmawiać. To jest też, jeśli chcesz, bardziej wzajemne grafiki, jeśli chcesz, możesz używać devices, które mają screen na nich. Adafruit skończy się tych dwóch devices, jedną jest piegamer, jedną jest piebacz, i piebacz też ma ślubą wersję, a ona ma wersję dla wersji maszyny. I w tamtej wersji też pracuje. I oni przyjeżdżają w górę biologii, więc są w porządku. Te 8x8 display na screenie, ale też przyjeżdżają w górę biologii lub biologii, które wyobrażam, w tym momentu. O, a ja też mam wersję w górę biologii, że nie możesz tego już nie pozostawić, bo jest w górę biologii, ale tylko jest w porządku. I też są bardziej recentne devices, tak jak Kittenbot ma ten miałbit device, który jest kompatyjny z mikro-bitem, ponieważ ma ten same koniektor na to, ale możesz też instalować z mikro-bitem na to i zrobić te same rodziny z innych devices. I Pi Moroni ma to piko system, który jest bardzo fajny, solidny aluminium i 240x240 display. Możesz też używać z mikro-bitem. Tak, i oczywiście zawsze jest to z mikro-bitem. Są rzeczy, jak display modules, klasy, które można połączyć do każdego device, czy każdego mikro-kontroleru chcesz użyć. I 3D print twojej case czy laser-cut to i zbudować twojej device od scratch. Nie będę to skończyć, ale to jest całkowicie możliwe. Nie ma magiczności w tym. Ok, możemy zacząć z piupio. Więc już powiedziałem, że to jest rzecz, którą używaliśmy 3 lat temu. Są też w Europie i w Europie będziemy mieć długie sprzętki. Więc jeśli się interesuje w sprzętu i sprzętu, i sprzętu i pracuje z nas, to 8x8 display z piskami, które mogą mieć jedno z 4 lb z błogodą i 6 błogodą do pisków i błogodą. To wygląda bardzo prosto i bardzo limitatnie, ale możesz zrobić all sorts of interesting games with this, starting with this snake game, you know from the Nokia phones, but also Tetris, Sokoban, Bulderdash, we have Frogger, we have Otello, a logic game with actual computer player that plays against you. You could do trackers, I guess, because 8x8, that's perfect for trackers. So there is all sorts of simple game, you could do flappy beard, you know. And because this is only 8x8, you don't have to create your own graphics, so it's super fast for you. There is this problem with making games where people starts doing the graphics and they just stay there and they get stuck in, you know, because making graphics is fun, but the goal is to finish the game during the workshop. So if you remove this time-consuming part, maybe it's a bit less fun, but at least you get to finish the game. The devices themselves are pretty affordable, you can get the PewPews themselves for about $10, plus shipping. So you also will need batteries for them, of course. And they are open hardware. So if you need your own version of a PewPew, you just download the design files, modify it in any way you want, send it to any manufacturer you choose, and they will make it for you. Right. Sorry about that. The library documentation is literally one page of A4 format. But we also have example games in there. We have step-by-step tutorials. And we are working on making more useful materials for teachers, basically, for lessons. By the way, if you are a teacher and you are interested in this, please find me and talk to me, because we only have basically experience with workshops. So any feedback from a teacher what works in a lesson, what works in a school environment would be very useful to us. OK. The next one. The next one is the one that does actual graphics. I can show you. Let me switch it on. So this is the game selection menu. And I can... Let's say we will select this one. So this is an example game written in... using the stage library in Circuit Python. Of course, it also uses some graphics that you had to draw yourself. And... Yeah, you can walk around, shoot, you can jump. You can climb the... Sorry for the... Oh, and you can die, of course. Otherwise it wouldn't be a game, right? If you can't play. So this kind of... This kind of... Games is what I'm talking about here. And the library itself is already built in in PyGamer and PyBatch and of course the PewPewM4. You get graphics depending on the device, resolution is a little bit different, but you can scale it to fill the screen. You get sprites, you get tiled backgrounds. You can display text and you can do beeps. And that's basically it. But it's all you need. All the sprites, all the graphics you use is 16 by 16 images. So they are pretty fast to draw. They are not too many pixels. You only get to use 16 colors in them and you get maximum of 16 frames of animation for them. But that's enough for a simple game like this. Right now we only have two example games in there. There is not much documentation. There is a learn guide in the other fruit system, but it's just a bouncing ball. We don't really have tutorials for a proper game. It's a community effort. How it actually works. So if you look at the screenshot from such a game, you can see there is actually quite a lot of detail. The problem with microcontrollers is that you don't have that much RAM memory on them. The smallest devices I use only have 32 kilobytes of RAM. That's not enough to even fit the image of the screen in that. So how do you display anything if you can't even fit your pixels in your memory? The idea is that you divide your screen into tiles and each tile uses a smaller pixel, a smaller picture and because those pictures repeat, they use much less memory. And here you can see we have two layers of those tiles. One is doing the blue background and the ladders in there. And the second one is actually shifted by half a tile to easier make the corners of the bricks in there. And uses a different set of 16x16 tiles and then on top of that of course you don't always have things that align to tiles. You want to have things that move freely like the enemies and the player character and so on. So on top of that you can also have sprites. And those layers can be mixed in any order you want. So you can have tiles sprites as well and you can have text in there as well. So that's the basic idea with this. The graphics are actually BMP files that contain 16 frames in each of the file. And those are the example ones from the game. Except I replaced the pink background with white. Because the pink color is a special color that is transparent in this game engine. So as I said you use BMP or GIF files actually GIF files. The proper pronunciation is GIF. And the pink color is transparent. If you need to have something pink but not transparent you need to make it one of a little bit less pink than usually you can tell the difference by looking at it. You can create the sprites themselves using the AssetPrite or LibreSprite open source programs or you can even use P-Scal which is a web-based graphics editor for sprites. So that's you still don't have to install anything on your computer. And you also have sound. You can play wave files and easiest way to generate like computer like computer game like sounds like beeps and laser sounds and things like that is to use a utility program that's called SFXR. It also has a web-based version so you also don't have to install it. You have a lot of nobs to turn there to generate exact sounds that you like and then it generates a wave file that you can use. And then of course you will have to make some maps for your game and things like that and here the engine doesn't help you you will have to be creative and either use text files or maybe JSON or whatever to make those for yourself. To actually get the details on how to use this circuit. There is a URL in here. I won't get into details. I won't be showing you code because we simply don't have enough time for this. And the last way I want to talk to you about making games is by using the display IO library. So the state library was written by me specifically to make this kind of simple games like platformers, shooters and so on. And it has a lot of limitations or the sprites have to be 16x16 you only get 16 colors you only get a limited number of layers and so on. I did that to make it as fast as possible and as fluent as possible in there. But there is a library built into circuit Python itself that's called display IO that that lets you do all the same things and more without those limitations. So you get sprites of any size. You get bitmap graphics that are loaded directly from the disk and they don't use upram. You still get sprites and tiles in there but you also get vector graphics, shapes circles, rectangles rounded rectangles text labels you get different fonts you can load. So the state library has one built-in font that you can use. In here you can add a bitmap font you find. The downside of this is that it's a little bit less fluent and might require a little bit faster microcontroller to run and maybe more memory as well. But you know it's still and of course it's a little bit more complex to use. But it's only for graphics so your game is usually not just graphics. So you will have to use other libraries in Circuit Python. But don't worry they are all there, they are available. There is image loader library that lets you load BMP or GIF files easily. There is audio core, audio I.O. and then either audio PWM I.O., audio boost I.O. or audio I.O. for outputting sound depending on how you have your speaker connected to the device you will use one of those. There is audio mixer and audio MP3 for advanced use for sound. You can have several things making sounds at once and you can even play MP3 files if your microcontroller is fast enough for that of course. And then you have the keypad library and touch I.O. and analog I.O. libraries for doing the buttons or like fruits used as buttons or a joystick or whatever you need in your particular device. Yeah, so basically that's it. That should get you started. You can find me and you can come to the sprints if you are interested in seeing more details. There is also excellent documentation and excellent help available from Adafruit. Adafruit is the company that develops circuit python. It's an open source project and it's developed in the open but they hire several to work on it and they pay them for that so that project is really developing on a good pace. They have a help with circuit python channel on their discord which is the single best place to ask questions about anything related to circuit python. And you can also find me on mastodon.technology and if you are interested in my other projects and my hardware hacking you can go to hack at the AIO and search for the shippu. You can see everything I do with hardware in there. That's everything I have. Thank you. So thank you very much for the talk. We do have time for questions so if you have any questions Mike so that everybody can hear it. Thank you for great talk. I am a teacher and so it's interesting baselines. Have you tried these out at kids clubs at all? Sorry, can you repeat? Have you tried out some of these devices with kids clubs programming clubs and things like that? No, so far I have only done workshop with adults and the problem is I'm not very good at with kids. I'm a bit scared of doing this with kids so that's one reason why we want feedback from teachers. We have made like five or six workshops with people from all sort of experience with python from python developers to people completely new to python but it was always adults. Do you have any other question? Any question from remote attendance? Ja, so I got one question just to ask in the development flow for somebody having an idea of developing some game with circuit python and implementing it could you give us an overview of how that works from well implementing some code co comes to that Actually I can show you how you would do it that's actually a great idea, I didn't think about it. So I have a micro USB cable here and I have the circuit python battle from three years ago I switched it on and it ran out of battery so maybe I will use a different one. Ja, by default it displays a menu that lets you select from the games that are already on there but if I connected to the computer and of course the law of live demos sorry about that ok, it comes at a disc and on that disc you can see the python files that are on the device now by default it will run the main.py file that's where the menu is coded, you can see the code for the menu here actually but if you create a code.py file instead it will run this by default you can see the screen is empty it's finished executing that file I can open it and I can start reading my code so I will start by importing pure, let me make the font a bit bigger importing the pure library I need to initialize it I will make a screen image that is by default 8x8 I can put a pixel that is coordinates 3x3 and has color 3 and I can display it on the display and I will need to have an empty loop at the end because otherwise it will go to the wrapper immediately and we will not be able to see anything you can see the display is here, the pixel is visible on the device so if I wanted to make it move for instance I would need to check what buttons are pressed and if say I would move this in here if case and pure.key app is pressed then y reduced by one we will put x and y as the coordinates we need to initialize them of course and we will need to delete the previous let's say we need to delete the position of the pixel and that should we don't need this that should give us some interaction and I got an error because we don't have a display here I can't see the error the solution is either to use an editor like mu to the serial console or use serial console from the terminal I can do that module object has no attribute get pressed that is because it's not called get pressed I mixed up with a different library it's called keys I forgot to show it on the screen and let's initialize it's to something else than 00 because we only have moving up here so we have our pixels and if I press the up key it's very fast because I forgot to wait we can wait for one six of a second to have it move slower to that's how you begin with a very simple game I can't really show you how you begin with graphics and so on because you start with spending two hours drawing your graphics so we don't have time for that but we can do that during the screen if you are interested that was very clear thank you very much for the live demo do you have any other question in the room? Is there any emulator where you could run this while you get your hardware in case you start off with an online course while you build a momentum for people? So there is no emulator for the stage and display I.O I think there is some work on making display I.O work with Blinka Blinka is an emulator on devices like Raspberry Pi however if you go to the we have a accumulator which is basically a library that uses a Pi game to display this 8x8 display and give you the key presses so if you just drop pu.py to go to your code file and just run this code file with Python 3 you won't be emulating the circuit Python it will be Python 3 instead so some things can be a little bit different like you would suddenly have 8GB of memory for instance but you can develop your games on your computer and it can also be a bit more convenient that way so you don't have to look at the device all the time however because of the differences you are encouraged to also test it on the device at the end because sometimes I write a game using the emulator and it doesn't fit on the device which is a very sad thing thank you thank you very much do we have any other questions in the room? we got a final one for you so when you you demonstrated the sprites and use of assets in the game so do you, when you are running the game do you have a runtime that offers your file system or you need to do something with those assets so that they work on the game no, you just copy all the assets to the disk same as the code so it's just sitting right there you can make like subdirectories to sort this of course to make it more manageable but it's just a simple drag and drop thing you just have to make sure that BMP files a 16 color not really you know, not the 16 bit color but 16 colors for bits ok, thank you very much so last chance for questions and if not so let's give our speaker another round of applause thank you very much and thank you very much