Skip to content

kea/code-the-classics1-php

Repository files navigation

Code the classics

This project aims to port into PHP the games of Code the classics Vol. 1 originally developed in Python.

It's not a web game with the backend in PHP but a fully PHP game.

It is possible thanks to the Php-SDL extension. You need also two PHP extensions for SDL_mixer (sound) and SDL_image (multiple image format loader).

Boing

Cavern

Infinite Bunner Myriapod

Porting status

  • Boing! [Ready]
  • Cavern [Ready]
  • Infinite bunner [Ready 99%]
  • Myriapod [Playable 95%]
  • Substitute Soccer [TBD]

Install SDL extensions

The games in this project depend on SDL PHP extensions. You can follow the installation instructions to get those extensions via PECL, source or PHPBrew.

Run the games

You have to clone this repo (or download the archive) and run composer:

git clone https://github.com/kea/code-the-classics1-php.git
cd code-the-classics1-php
composer install

Boing

php src/Boing/boing.php

Menu selection Up, Down and Space to confirm.

Player 1 keys: Up or a and Down or z

Player 2 keys: k and m

Bunner

php src/Bunner/bunner.php

Menu Space to start.

Player keys: wasd or ←↑→↓ to move.

Cavern

php src/Cavern/cavern.php

Menu Space to start.

Player keys: a d or ← → to move left and right, w or to jump and space to fire bubbles.

Myriapod

php src/Myriapod/myriapod.php

Menu Space to start.

Player keys: wasd or ←↑→↓ to move and space to fire laser.

Copyright of assets

The assets are Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0) by Code the classics Vol. 1

About

It's a porting in PHP of the games of "Code the classics - Voume 1" originally made in Python (https://wireframe.raspberrypi.org/books/code-the-classics1)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages