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
🐥Flappy Birds🐤 Video game. With your help I can go through🚀 the pipes. All UI is made with 🐍Pygame🐍

🐠 Flappy Fish 🐢 I am Flappy Fish 🐟 . With your help I can jump through the pipes and experience an interesting and exciting flight deep into the fi

MohammadReza 2 Jan 14, 2022
An single python server emulator of MMORPG game WindSlayer also known as WS1.

PySlayer An single python server emulator of MMORPG game WindSlayer also known as WS1. Requirements Python = 3.7 Old windslayer client (Korea Yahoo!

mirusu400 29 Dec 19, 2022
Algorithm to solve Wordle correctly 100% of the time within 6 attempts.

WordleSolver © Zulkarnine, 2022. Algorithm to solve Wordle 100% of the time within 6 attempts. You can go ahead and run main.py to run it for all 2315

Zulkarnine Mahmud 69 Dec 11, 2022
Atari2600 Training / Evaluation with RLlib

Training Atari2600 by Reinforcement Learning Train Atari2600 and check how it works! How to Setup You can setup packages on your local env. $ make set

Jinwoo Park (Curt) 1 Dec 12, 2021
In the works, creating a new Chess Board and way to Play...

sWJz4KingsChess date started on github.com 11-13-2021 In the works, creating a new Chess Board and way to Play... starting to write this in Pygame, an

Shawn 2 Nov 18, 2021
offline bot for game on chrome

Бот офлайн игры браузера CHROME В автоматическом режиме запускает браузер Chrome под ОС windows, так же автоматически определяет разрешения экрана, на

Andrej Marinchenko 19 Dec 17, 2022
This is a basic virtual quiz game using opencv-python

Basic Virtual-Quiz-Game This is a basic structure of a virtual quiz game using opencv-python. As the camera window opens up we can see the questions a

2 Dec 11, 2021
Racers-API - a game where you have to go around racing with your car, earning money

Racers-API About Racers API is a game where you have to go around racing with yo

3 Jan 09, 2022
Tic Tac Toe game developed in python; have 2 difficulty levels

Tic Tac Toe Game This is a code for Tic Tac Toe game in python. Game has 2 difficulty levels. Easy Hard To play the game, use this command in a LINUX

Akshat Mittal 1 Jun 25, 2022
Hangman Game

Hangman Game Este juego fue creado a partir de los conocimientos adquiridos en el Curso de Python: Comprehensions, Lambdas y Manejo de Errores que exi

Carlos Valencia 2 Nov 14, 2022
A fun discord bot for music, mini games, admin controls, economy, ai chatbot and levelling system

A fun discord bot for music, mini games, admin controls, economy, ai chatbot and levelling system. This bot was specially made for Dspark discord server.

2 Aug 30, 2022
Wordle - Implementation of wordle and a solver

Wordle - Implementation of wordle and a solver

Kurt Neufeld 1 Feb 04, 2022
A Python Sudoku Game Made with Pygame.

A Python Sudoku Game Made with Pygame. A Begginer Aimed at Learning Git, This Game Uses a Puzzle Generator Made by RutledgePaulV, Link to his Repo:

helaxious 3 Jun 29, 2022
A Game of Life implementation in Python

Game of Life in Python (Golipy) Golipy is a simulator of John H. Conway's Game of Life, developed in Python based on the Pygame library. This is a toy

Alber 2 Dec 10, 2021
Open source translation for the Tsukihime Remake game

Tsukihime-Translation Open source translation for the Tsukihime Remake game prepared by Clovermoon and Tsukihimates. Copyright Disclaimer under Sectio

118 Jan 01, 2023
🪨 📄 ✂ game in python with recursion

🪨 📄 ✂ Game Rock Paper Scissor game in python with recursion ⚙️ Developer's Guide Things you need to get started with this code:- Download python3 fr

Atul Anand 3 Jul 25, 2022
Synthesizer based on Conway's Game of Life

Conway Synth Synthesizer based on Conway's Game of Life Trying to avoid step sequencer fashions that have been done before and basing it on actual cel

Giacomo Loparco 4 Mar 15, 2022
A shooter game.

Screenshots Installation GNU/Linux Go to the Releases tab. Download InfiniteShooter.flatpak from the latest version of InfiniteShooter Open the termin

PastThePixels 13 Dec 01, 2022
Games: Create interesting games by pure python.

Create interesting games by pure python.

4.2k Jan 06, 2023
An all-inclusive Python framework for the Riot Games League of Legends API. We focus on making the data easy and fun to work with, while providing all the tools necessary to create a website or do data analysis.

Cassiopeia A Python adaptation of the Riot Games League of Legends API (https://developer.riotgames.com/). Cassiopeia is the sister library to Orianna

Meraki Analytics 473 Jan 07, 2023