Python desktop application to create, distribute, discover, and run codegames

Overview

Overview

The Codegame Platform is a Python desktop application to create, distribute, discover, and run codegames.

A codegame is a serious game made of levels written in Litemark, a lightweight Markdown dialect.

A level is typically a hypertext that gratifies intellectual curiosity, with an embedded programming problem to solve.

The person who produces a codegame is the creator. The one who consumes a codegame is the user.

The creator can safely insert problems testing specifications in a level. The Codegame Platform evaluates the solution submitted by the user then unlock the next level if the solution is correct.

This project is suitable for:

  • teaching programming, algorithms, data structures;
  • teaching ethical hacking;
  • building a well-articulated chain of puzzles with an exciting story behind it;
  • automating coding interviews;
  • fun, and more...

Now, let's build a codegame demo with the Codegame Platform.

Installation

For the first time

$ pip install codegame

Upgrade

$ pip install codegame --upgrade --upgrade-strategy eager

Codegame creation

The Codegame Platform has a command line interface to create, build and publish codegames.

Initialization

Change the current working directory to the folder of the new codegame project. Then use the command init to initialize the folder.

$ cd /home/alex/cgame-demo
$ codegame init

Now you have a basic codegame project structure.

Basic codegame structure

This is the root directory of the codegame project:

cgame-demo/
    assets/ # [1] this is where you store images
    dist/ # [2] folder to keep distribution packages
    source/ # [3] the main folder to store levels !
    CHANGELOG.md # [4] automatically updated
    codegame.json # [5] the config file of the project
    LATEST_RELEASE.md # [6] latest release
    README.md # [7]
  • [1] this is just a convention, you can ignore this folder and put your images somewhere else.
  • [2] distribution packages are just ZIP archives generated by the Codegame Platform when you issue the command build. You won't need to enter this directory since it's managed by the Codegame Platform.
  • [3] this is where you store the Litemark files that represent the levels of your codegame.
  • [4] this file is managed by the Codegame Platform.
  • [5] when you issue the command init for the first time, you will be asked to submit some information (author name, github repository...). This information is stored in this config file that you can edit.
  • [6] when you issue the command publish, the content of this file is automatically cut and pasted in CHANGELOG.md.
  • [7] there are some basic README text in this file that you can edit.

Note: don't forget to add a license file in the root directory of the codegame project.

Levels for this demo

Let's edit the folder source:

source/
    1.md # level 1
    2.md # level 2
    3.md # level 3
    index.json # we will store levels titles here

This is the content of index.json:

[
    "Welcome Dear Stranger !",
    "Time Is Money...",
    "The Year Of The Four Seasons"
]

Each level is just a file with Litemark text inside. You can preview the rendered level with the command preview:

# cd to the root directory of the codegame project
$ cd /home/alex/cgame-demo
# without any argument, this command will open the first level
$ codegame preview
# preview level 3
$ codegame preview 3

Embed a problem in a level

The Codegame Platform introduces a new level to the user when they complete the problem defined in the previous level. To insert a problem into a level, all you need to do is insert the test specifications to evaluate the solution in a special codeblock called codegame-test. The Codegame Platform will insert a SOLVE ME ! Button at the bottom of the level page. If the user clicks on the button, they will be prompted to submit a solution in an editor that will open. If the solution passes the tests, a NEXT LEVEL button will be inserted at the bottom of the level page.

Let's explore the content of the 3 levels in this codegame demo project.

Codegame demo levels

You can clone the codegame demo project to study it:

$ git clone https://github.com/pyrustic/cgame-demo

Level 1

$ cd /home/alex/cgame-demo
$ codegame preview 1
Figure

Rendered - Codegame demo - Level 1 (Preview)


Figure

Plain text - Codegame demo - Level 1

Level 2

$ cd /home/alex/cgame-demo
$ codegame preview 2
Figure

Rendered - Codegame demo - Level 2 (Preview)


Figure

Plain text - Codegame demo - Level 2

Level 3

$ cd /home/alex/cgame-demo
$ codegame preview 3
Figure

Rendered - Codegame demo - Level 3 (Preview)


Figure

Plain text 1/2 - Codegame demo - Level 3


Figure

Plain text 2/2 - Codegame demo - Level 3

Distribution

Build

$ cd /home/alex/cgame-demo
$ codegame build

Publish

$ cd /home/alex/cgame-demo
$ codegame publish

Check downloads and stargazers

$ cd /home/alex/cgame-demo
$ codegame info remote
# or
$ codegame info https://github.com/pyrustic/cgame-demo
# or
$ codegame info pyrustic/cgame-demo

Install a new codegame from the GUI

Open the GUI of the Codegame Platform:

$ codegame

Then copy-paste in the search bar the GitHub repository URL (or the shortcut "owner/repository") of the codegame to install.

Figure

The Codegame Platform GUI


Figure

Installing the codegame demo


Figure

Solving the Level 1 of the codegame demo


Figure

Solved Level 1 of the codegame demo

The GUI of the Codegame Platform is inspired by Hubstore. Visit Hubstore !

This project is a work in progress...

Owner
Pyrustic Open Ecosystem to develop and distribute Python apps
A solution program of 24. game.

A solution program of 24. game.

1 Dec 12, 2022
WORDLE Helper and Solver

WORDLE Helper and Solver There is a pupular game around WORDLE The game could be hard for non-English speaking people so I started to think of a helpe

1 Jan 24, 2022
A use of the python MCPI to enhance the multiplayer and singleplayer gameplay.

Morpheus 2.0 A use of the python MCPI to enhance the multiplayer and singleplayer gameplay. To Use: You will need to install the keyboard, pysimplegui

11 Oct 11, 2022
This is a script which can be used to autobattle, upgrade metamon, compose eggs and open eggs in metamon game.

This is a script which can be used to autobattle, upgrade metamon, compose eggs and open eggs in metamon game. The only parameters you need to input are you wallet address and sign. The sign can be o

Taxiria 37 May 11, 2022
Turn NY Times crosswords into Across Lite files

NYT Crossword to Puz A windows program to convert NY Times crosswords from the web to Across Lite compatible files. To run this, first download and de

31 Oct 11, 2022
This is a 2D Link to the Past-esque game made using Python 3.2.5 and pygame 1.9.2

Queen-s-Demise Queen's Demise This is a 2D Link to the Past-esque game made using Python 3.2.5 and pygame 1.9.2 I made this for a game development cla

Zoey 1 Dec 15, 2021
Space Invaders x Asteroid Game

Retro Journey 1: Space Invaders A simple implementation of a retro style video game where users compete against asteroids and the goal is to destroy a

Sandesh Lamsal 2 Aug 05, 2022
Aftermath is an anti token grabber written in Python3.

🎈 Aftermath 🎈 Aftermath is an anti token grabber written in Python3. This tool with a GUI setup is checking the Downloads folder to search for token

Billy 39 Dec 16, 2022
Discord based board game, Sneks and Ladders

sneks-and-ladders Discord based board game, Sneks and Ladders intro This is the code-base for the Discord based game, Sneks and Ladders, as used for s

Yohei Nakajima 3 Nov 04, 2022
Unknown Horizons official code repository

Unknown-Horizons based on Fifengine is no longer in development. We are porting it to Godot Engine. Please dont report any new bugs. Only bugfixes wil

Unknown Horizons 1.3k Dec 30, 2022
A script to install a Windows game through GOG on Linux

proton-gog-install A script to install a Windows game through GOG on Linux. Based on this gist. Tested on Arch, might work elsewhere. Requirements: Im

5 Dec 28, 2022
Este repositorio es creado con el fin de brindar soporte a las personas que están en el proceso de aprendizaje MISIONTIC 2022 en la universidad de Antioquia

Este repositorio es creado con el fin de brindar soporte a las personas que están en el proceso de aprendizaje MISIONTIC 2022 en la universidad de Antioquia. Hecho por los estudiantes para los estudi

Andrés Mauricio Gómez 11 Jun 22, 2022
3D online shooter written on Panda3D 1.10.10 and Python 3.10.1

на русском itch.io page Droid Game 3D This is a fresh game that was developed using the Panda3D game engine and Python language in the PyCharm IDE (I

Marcus Kemaul 5 Jun 04, 2022
Graphical impimetaion of Conway's Game of Life in Python using pyglet

Conway's Game of Life in Python Konstantin Opora Conway's Game of Life: graphical implementation in python using pyglet. developed in Python 3.10.0 Re

Konstantin Opora 1 Nov 30, 2021
Pyout - A little Krakout clone called Pyout written in Python 3

Pyout My little Krakout clone called Pyout written in Python 3

Jan Karger ツ ☀ 4 Feb 20, 2022
Basic Python physics library.

pythonPhysics Basic Python physics library. Must have pygame installed. How to: Sketon program is included. for p in env.particles: pygame.draw.circle

1 Jan 16, 2022
Utility to find games owned by all (or at least some) of the passed players.

SteamCommonGameFinder Utility to find games that are owned by all (or at least some) of the players you pass into this programm. You can already find

Daniel O'Grady 4 Jan 04, 2022
Overview: copain, your friendly AI framework to learn and play games

Overview: copain, your friendly AI framework to learn and play games Interface fceux with python and run reinforcement learning. Compatibility Current

fcharras 1 Dec 16, 2021
A tool for the creation of rooms used in maps in the game Wastelands

Wastelands Room Data editor A tool for the creation of rooms used in maps in the game Wastelands Creates .wrd files, that get loaded by the map genera

Avant 6 Jul 12, 2021
Multiplayer 2D shooter made with Pygame

PyTanks This project started as a one day project with two goals: Create a simulated environment with as much logic as possible written in Numpy, to o

Felix Chippendale 1 Nov 07, 2021