All Projects → arnauddupuis → pygamelib

arnauddupuis / pygamelib

Licence: GPL-3.0 license
A (not so) small python library for console (as in terminal) game development. It is developed as a framework to help learn development and python in an entertaining way.

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to pygamelib

Hacktoberfest-Nepal-2020
A beginner-friendly open source repository to create your first pull request.
Stars: ✭ 15 (-55.88%)
Mutual labels:  hacktoberfest2021
Heel2Toe
A beginner-friendly repository to get started with HTML, CSS, and JS.
Stars: ✭ 22 (-35.29%)
Mutual labels:  hacktoberfest2021
Peregrine
A blazing fast language for the blazing fast world(WIP)
Stars: ✭ 1,483 (+4261.76%)
Mutual labels:  hacktoberfest2021
CPCODES-Hacktoberfest2021
No description or website provided.
Stars: ✭ 11 (-67.65%)
Mutual labels:  hacktoberfest2021
notnow
A terminal based task and TODO management software.
Stars: ✭ 25 (-26.47%)
Mutual labels:  terminal-based
hacktoberfest
www.sharjeelyunus.me/hacktoberfest/
Stars: ✭ 15 (-55.88%)
Mutual labels:  hacktoberfest2021
Xpendi
iOS expense tracker
Stars: ✭ 13 (-61.76%)
Mutual labels:  hacktoberfest2021
autocorr kr
리브레오피스(LibreOffice) 자동 교정(Autocorrect)기능에 대한 말모이 저장소
Stars: ✭ 15 (-55.88%)
Mutual labels:  hacktoberfest2021
djangoReact-template
A perfect template for you to focus on starting your hack project or your deployed project. Leave all the gibberish of setup and just focus on innovating and creating amazing tech
Stars: ✭ 23 (-32.35%)
Mutual labels:  hacktoberfest2021
mongo-express-node-template
This template is designed to help kick start Node.js applications that would use MongoDB as a database and Passport.js as an authentication middleware.
Stars: ✭ 19 (-44.12%)
Mutual labels:  hacktoberfest2021
editor
A text editor written in Nim
Stars: ✭ 24 (-29.41%)
Mutual labels:  terminal-based
nodejs-express-jwt
Node.js Express REST API boilerplate with JWT Authentication and support for MySQL and PostgreSQL.
Stars: ✭ 56 (+64.71%)
Mutual labels:  hacktoberfest2021
cryostat
Secure JDK Flight Recorder management for containerized JVMs
Stars: ✭ 147 (+332.35%)
Mutual labels:  hacktoberfest2021
Hacktoberfest 21
No description or website provided.
Stars: ✭ 17 (-50%)
Mutual labels:  hacktoberfest2021
starter-kit
Start your career path to become a developer.
Stars: ✭ 19 (-44.12%)
Mutual labels:  hacktoberfest2021
VCPlayerBot
Telegram bot to stream videos in telegram voicechat for both groups and channels. Supports live steams, YouTube videos and telegram media. Supports scheduling streams, recording and many more.
Stars: ✭ 432 (+1170.59%)
Mutual labels:  hacktoberfest2021
LuminousNewTab
Luminous New Tab is a beautiful 'new tab' browser extension that has an animated gradient background! New tabs will show your bookmarks, the time, weather and let you do searches too!
Stars: ✭ 18 (-47.06%)
Mutual labels:  hacktoberfest2021
Hacktoberfest
In this repository you can contribute quality code in languages you are comfortable with during the Hacktoberfest event. Raise Genuine PR's Only your. You aren't allowed to Update README.md. Invalid PR's is not supported here.
Stars: ✭ 20 (-41.18%)
Mutual labels:  hacktoberfest2021
hacktoberfest2021-easy
Add a code in any language
Stars: ✭ 24 (-29.41%)
Mutual labels:  hacktoberfest2021
Hacktoberfest-2021
This repository dedicated to Hacktoberfest 2021. Hacktoberfest is a month long open source contribution program held in October every year by Digital Ocean. This is a beginner-friendly open source event.
Stars: ✭ 10 (-70.59%)
Mutual labels:  hacktoberfest2021

Linux: Ok Windows: Ok Mac OS: Ok GPLv3 license PRs Welcome Documentation Status CII Best Practices CircleCI codecov

pygamelib

A (not so) small library for terminal based game development.

Preemptive warning

Between version 1.1.1 and 1.2.0 the library was renamed from hac-game-lib to pygamelib and reworked to its core. So even though all the objects remains API compatible across versions, there is a bit of renaming to do in the imports.

Introduction

Historically, this library is used as a base to teach coding to kids from 6 to 15. It aims at giving an environment to new and learning developers (including kids) that let them focus on the algorithm instead of the lousy display or precise management.

It started as a very simple library with very little capabilities, but over time it became something more. To the point that it is now possible to make very decent games with it. So this is obviously still extremely simple compared to other game framework and it still does not aim at being anything serious for real game developers. However, it can now be used by aspiring game developers for an introduction to 2D games development.

There is a Youtube channel that (will) contains tutorials.

suparex.py screenshot

Here is a quick view of what can currently be achieved with that library (base_game haven't been updated for a long time):

base_game.py animation

The base game makes use of:

  • The main "game engine" (pygamelib.engine.Game)
  • Many different types of structures (from pygamelib.board_items): Wall (well the walls...), Treasure (gems and money bag), GenericStructure (trees) and GenericActionnableStructure (hearts and portals)
  • Game()'s menu capabilities.
  • Player and NPC (from pygamelib.board_items)
  • Inventory (from pygamelib.engine.Inventory)
  • Player and Inventory stats
  • RandomActuator (NPCs in level 2) and PathActuator (NPCs in level 1) (from pygamelib.actuators.SimpleActuators)

For more up to date examples, have a look at:

Here is a poorly done gif of Suparex: Suparex animation

Strong points

Hopefully you'll find the pygamelib to have a lot of strong points:

  • It is simple. It requires very limited Python knowledge to start coding games.
  • Yet powerful offering more advanced programmers a lot of possibilities.
  • The possibilities scale up with the students offering basic feature and default values "good enough" for beginners and lots of tunning opportunities for the advanced coders.
  • Lots of stuff are available by default. Any idea how long it would take a beginner to display only a part of a board? 1 second with the pygamelib, probably slightly more if they had to do it by hand ;)
  • It is Terminal based. This means no graphics card dependencies, cross platform, and a framework that stimulate imagination and creativity.

Installation (recommended)

The easiest way to install a stable version is to use pypi:

pip3 install pygamelib

It will pull all dependencies

Installation from sources and requirements

Python

The pygamelib only supports Python 3.6+. It will not run with Python 2. We use pipenv to manage dependencies.

Run Pipenv to install the requirements:

pip3 install pipenv
pipenv install

If you want the development dependencies you need to run:

pip3 install pipenv
pipenv install --dev

Or you can just run make devenv if make is available on your system.

Runing tests

To run the unit tests use the following command:

python -m unittest discover -s tests

Terminal color and emojis

It is not really a hard requirement but colored emojis are really bringing the games created to life.
We then recommend to have a color emojis font installed like Noto Color Emojis (on most Linux distributions you can install it from the package manager, search for "noto-color-emoji").

If your terminal application is not displaying color emojis, please have a look at this file and follow the instructions.

Running examples

To run the examples using pipenv:

pipenv shell
(pygamelib) cd examples/suparex
(pygamelib) python3 suparex.py

Limitations

There is tons of limitations but for the most important ones:

  • Only one player is supported.
  • There is little protections against messing up with the internal. This is on purpose, I want the kids to learn to use the API not mess up with the internals of every single class.
  • It's pure Python (it's slow).
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].