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
Inject custom C++ code into GameMaker Studio 2 YYC builds

YYC Boost Inject custom C++ code into GameMaker Studio 2 YYC builds! WARNING: This tool is currently in an early stage of development and it is not gu

Patrik Kraif 7 Dec 30, 2022
An automation bot to play Myuu Discord game

Auto selfbot Myuu is a self Discordbot, meaning it will use your TOKEN to logged as your account and take commands from yourself to play the game.

6 Dec 15, 2022
Blackjack Game made using Python

Blackjack Game made using Python Blackjack is a popular card game played in most of the casino.This is an intuition to replicate the same card game us

SUHASJAGADISH 1 Nov 28, 2021
Chesston (Chess+Python) is a two-player chess game with graphical user interface written in PyQt5

♟️ Chesston (Chess+Python) is a two-player chess game with graphical user interface written in PyQt5. 💿 Dependencies This program uses Py

6 May 26, 2022
Navicella cavallo, gioco 2D stile space shooter

Navicella Cavallo Il miglior gioco in circolazione Navicella cavallo è un gioco 2D basato sullo stile dei giochi space shooter Come installare Navicel

Matteo 6 Jul 03, 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
Simplerpg - python terminal game made from scratch.

Simplerpg - python terminal game made from scratch.

reversee 3 Sep 17, 2022
A small Python Library to process Game Boy Camera images

GameBEye GameBEye is a Python Library to process Game Boy Camera images. Source code 📁 : https://github.com/mtouzot/GameBEye Issues 🆘 : https://gith

Martin TOUZOT 4 Nov 25, 2022
Pendulum Simulation using Pygame

Pendulum project, built using pygame and math modules.

3 Nov 09, 2021
Simple game where you try to survive as long as you can on screen.

Survival Game Simple game where you try to survive as long as you can on screen. Play To run, download the code and run the survival_game.py file. Fro

Logan Morris 1 Feb 10, 2022
A puzzle game coded entirely in Python.

Pyzzle A puzzle game coded entirely in Python. This is a school project created by me, Mohit Singh. The .exe file, created from the main.py script, is

Mohit Singh 1 Mar 19, 2022
It calculates the Nim sum of a nim game.

nim-sum-calculator It calculates the Nim sum of a nim game. The rules of Nim The traditional game of Nim is played with a number of coins arranged in

2 Jan 02, 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 an amazing game make using pygame.

This is an awesome balloon game. It is made in python using Pygame library. It is a project game while learning game development.

Rishikesh Kumar 2 Oct 10, 2021
Dota2 AI bot - Last Order Dota2 Solo AI

Last Order Dota2 Solo AI 该库提供一个由强化学习训练出的Dota2影魔solo智能体。该智能体通过自我对战的训练方式训练,从随机动作开始学习复杂的策略。玩家可以与该智能体进行影魔solo对战。 对战规则 1.物品方面不可以出凝魂之露,灵魂之戒,魔瓶,真眼。 2.不可以吃符,或

bilibili 365 Jan 05, 2023
TetrisAI - Tetris AI Bot using computer vision to play game automatically

Tetris AI Tetris AI Bot using computer vision to play game automatically bot.py

11 Aug 29, 2022
Quantum version of the classical Nim game. An automatic opponent allows to game to not be as easy as it seems.

Nim game Running the game To run the program just launch : python3 game.py Rules This game is inspiring from the Nim game. You are 2 players face to f

Michaël 1 Jan 08, 2022
Discord.py Gaming Bot🎮, for fun & engaging discord minigames

Status 🧭 This Project will not no longer be developed/finished due to a) discord.py's ( main dependency ) discontinuation b) My personal lack of int

Wordsetter 11 Nov 21, 2022
A comprehensive, feature-rich, open source, and portable, collection of Solitaire games.

PySol Fan Club edition This is an open source and portable (Windows, Linux and Mac OS X) collection of Card Solitaire/Patience games written in Python

Shlomi Fish 368 Dec 28, 2022
This is a python interactive story game that I made to show off what I've learnt in python coding for a month

Purpose The files in this repository are for that of a story game created with python version 3.8.5 The purpose of this project was to get familiar wi

0 Dec 30, 2021