January 21, 2021, 09:03:27 AM

Author Topic: Code the Classics – Volume 1  (Read 1509 times)

Offline therevills

  • Hero Member
  • *****
  • Posts: 614
Code the Classics – Volume 1
« on: December 20, 2019, 10:52:48 PM »
Over on SoCoder, Krakatomato posted about this (free pdf) book:

https://wireframe.raspberrypi.org/books/code-the-classics1

Quote
This stunning 224-page hardback book not only tells the stories of some of the seminal video games of the 1970s and 1980s, but shows you how to create your own games inspired by them using Python and Pygame Zero, following examples programmed by Raspberry Pi founder Eben Upton.

In the first of two volumes, we remake five classic video games – ranging from Pong to Sensible Soccer, each represents a different genre. We interview the games’ original creators and learn from their example, as well as utilise the art and audio engineering skills of two of the 1980s’ most prolific games developers for our recreated versions of the games.

Get game design tips and tricks from the masters
Explore the code listings and find out how they work
Download and play game examples by Eben Upton
Learn how to code your own games with Pygame Zero
Read interviews with expert graphics and audio creators

Offline ricardo_sdl

  • Jr. Member
  • **
  • Posts: 12
Re: Code the Classics – Volume 1
« Reply #1 on: March 16, 2020, 08:32:40 PM »
Really good resource! Thanks.

Offline Xerra

  • Hero Member
  • *****
  • Posts: 1207
  • Wait, what? This isn't Porn Hub?
    • Retro Evolved
Re: Code the Classics – Volume 1
« Reply #2 on: March 16, 2020, 09:27:46 PM »
Nice spot. I'll have a look at these. Bought a magazine with loads of python lessons recently that I've been meaning to read and see how hard it is to learn.

Offline Steve Elliott

  • Hero Member
  • *****
  • Posts: 2918
  • elgol 2021
Re: Code the Classics – Volume 1
« Reply #3 on: March 16, 2020, 09:58:49 PM »
Thanks!   :)
Windows 10 64-bit, 16Gb RAM, Intel i5 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
MacOS Big Sur 64-bit, 8Gb RAM, Intel i5 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB
Linux Mint 19.3 64-bit, 16Gb RAM, Intel i5 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
Raspberry Pi 400, Pi4, BBC B, C64, ZX Spectrum

Offline Qube

  • Administrator
  • Hero Member
  • *****
  • Posts: 2587
  • I mostly code at night... Mostly.
    • SyntaxBomb - Indie Coders
Re: Code the Classics – Volume 1
« Reply #4 on: March 17, 2020, 04:55:59 AM »
Oo, nice nice, downloaded and will read later. Thanks for sharing :)
Mac mini ( 2018 / 2020 ), 3 GHz 6-Core Intel Core i5, 16 GB 2667 MHz DDR4, 1TB NVMe, eGPU Radeon Pro 580 8 GB, LG Ultragear 27GL83A-B 27 Inch
Commodore VIC-20, 1.1Mhz MOS 6502 CPU, 5KB RAM, VIC ( 6560 ) GPU

Until the next time...

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 2057
Re: Code the Classics – Volume 1
« Reply #5 on: March 17, 2020, 06:17:55 AM »
Very well put together. A bit like the 80's with typing in the source code.

One interesting thing is that both Pong (and Breakout) were not computer games - they were built with analogue components. no computers or CPU's were hurt in their   :o

Offline Steve Elliott

  • Hero Member
  • *****
  • Posts: 2918
  • elgol 2021
Re: Code the Classics – Volume 1
« Reply #6 on: March 17, 2020, 09:27:33 AM »
Some good coding information here (the most important part) and I'll probably buy the book too at some point.  But while the games run on the Raspberry pi and PC without a problem and run fairly smoothly, they do run a bit jittery though, so not super smooth (even on PC).
Windows 10 64-bit, 16Gb RAM, Intel i5 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
MacOS Big Sur 64-bit, 8Gb RAM, Intel i5 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB
Linux Mint 19.3 64-bit, 16Gb RAM, Intel i5 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
Raspberry Pi 400, Pi4, BBC B, C64, ZX Spectrum

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 2057
Re: Code the Classics – Volume 1
« Reply #7 on: March 17, 2020, 10:37:22 AM »
Quote
they do run a bit jittery though, so not super smooth (even on PC)
That's an interesting observation. Would you attribute that to the language or the code itself?

Offline Steve Elliott

  • Hero Member
  • *****
  • Posts: 2918
  • elgol 2021
Re: Code the Classics – Volume 1
« Reply #8 on: March 17, 2020, 11:09:59 AM »
Quote
they do run a bit jittery though, so not super smooth (even on PC)

That's an interesting observation. Would you attribute that to the language or the code itself?

AGK also runs Bytecode too so I wouldn't blame the language, the code I haven't looked at in detail.  I would say it's the way the library (Pygame Zero) handles delta time.  I read in the book they're converting back from floating point to integer values for whole pixel movement and compensating.  So if the normalized values mean the pong ball needs to move 1.0 pixels in the x direction and 0.5 in the y direction (for a 45 degree movement) every other frame is skipped for the y movement.  What if the value doesn't fit neatly into a frame like 0.5 (half a frame) does?  How is the library handling that?

It's not always noticable, but in the Frogger/Rabbit game it is noticable - the cars have a jitter every few frames.
Windows 10 64-bit, 16Gb RAM, Intel i5 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
MacOS Big Sur 64-bit, 8Gb RAM, Intel i5 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB
Linux Mint 19.3 64-bit, 16Gb RAM, Intel i5 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
Raspberry Pi 400, Pi4, BBC B, C64, ZX Spectrum

Offline Kris

  • Full Member
  • ***
  • Posts: 118
Re: Code the Classics – Volume 1
« Reply #9 on: March 18, 2020, 11:45:56 AM »
One interesting thing is that both Pong (and Breakout) were not computer games - they were built with analogue components. no computers or CPU's were hurt in their   :o

This reminds me to the Mellotron from the music synthesizer world. Digital technology wasn't anywhere near ready for sample playback...so they solved it in an analog way. If they could develop a non "mechanical" magnetic storage for it instead of using tape could have been very interesting.

Offline Steve Elliott

  • Hero Member
  • *****
  • Posts: 2918
  • elgol 2021
Re: Code the Classics – Volume 1
« Reply #10 on: April 09, 2020, 09:09:10 PM »
Ordered the book today to support them.  It looks like a quality product too though.
Windows 10 64-bit, 16Gb RAM, Intel i5 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
MacOS Big Sur 64-bit, 8Gb RAM, Intel i5 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB
Linux Mint 19.3 64-bit, 16Gb RAM, Intel i5 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
Raspberry Pi 400, Pi4, BBC B, C64, ZX Spectrum

Offline Steve Elliott

  • Hero Member
  • *****
  • Posts: 2918
  • elgol 2021
Re: Code the Classics – Volume 1
« Reply #11 on: April 20, 2020, 02:19:17 PM »
Code the Classics – Volume 1 came today and it's a high quality book.   8)
Windows 10 64-bit, 16Gb RAM, Intel i5 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
MacOS Big Sur 64-bit, 8Gb RAM, Intel i5 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB
Linux Mint 19.3 64-bit, 16Gb RAM, Intel i5 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
Raspberry Pi 400, Pi4, BBC B, C64, ZX Spectrum

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal