Ooops
April 02, 2020, 11:20:11 AM

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

Offline therevills

  • Hero Member
  • *****
  • Posts: 595
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: 3
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: 834
    • 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: 2300
  • elgol developer
Re: Code the Classics – Volume 1
« Reply #3 on: March 16, 2020, 09:58:49 PM »
Thanks!   :)
Windows 10, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
MacOS Catalina, 64-bit, 8Gb RAM, CPU Intel i5, 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB.
Linux Mint 19.3, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
C64, Raspberry pi 3 and 4.

Offline Qube

  • Administrator
  • Hero Member
  • *****
  • Posts: 2345
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 :)
Until the next time...

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 1546
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: 2300
  • elgol developer
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, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
MacOS Catalina, 64-bit, 8Gb RAM, CPU Intel i5, 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB.
Linux Mint 19.3, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
C64, Raspberry pi 3 and 4.

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 1546
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: 2300
  • elgol developer
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, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
MacOS Catalina, 64-bit, 8Gb RAM, CPU Intel i5, 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB.
Linux Mint 19.3, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
C64, Raspberry pi 3 and 4.

Offline Kris

  • Jr. Member
  • **
  • Posts: 95
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.

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal