A package for creating modd.io games using python!
Project description
pymodd is a python package used for creating modd.io games in python
Features
edit global and entity scripts
organize folders and scripts with a mapping file
a command to generate a pymodd project
Installing
Python 3.8 or higher is required
To install the library run the following command:
# Linux/macOS
python3 -m pip install -U pymodd
# Windows
py -3 -m pip install -U pymodd
Getting Started
Export your modd game json file from the website and then generate a pymodd project by running the following command:
generate-game [GAME_JSON_FILE_PATH]
Quick Script Example
view examples/sample_scripts.py in the github repo for the full example
class EverySecond(Script):
def _build(self):
self.key = 'P8MwXcSxq7'
self.triggers = [Trigger.EVERY_SECOND]
self.actions = [
if_else((NumberOfUnitsOfUnitType(UnitTypes.FROG) < 5), [
create_unit_for_player_at_position_with_rotation(UnitTypes.FROG, Variables.AI, RandomPositionInRegion(EntireMapRegion()), 0),
], [
if_else((NumberOfUnitsOfUnitType(UnitTypes.FROG_BOSS) == 0), [
if_else((Variables.BOSS_TIMER <= 0), [
create_unit_for_player_at_position_with_rotation(UnitTypes.FROG_BOSS, Variables.AI, RandomPositionInRegion(EntireMapRegion()), 0),
update_ui_target_for_player_for_miliseconds(UiTarget.CENTER, 'BOSS SPAWNED', Undefined(), 5000),
], [
]),
decrease_variable_by_number(Variables.BOSS_TIMER, 1),
], [
]),
]),
]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pymodd-0.2.1.tar.gz
(54.0 kB
view hashes)
Built Distribution
Close
Hashes for pymodd-0.2.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a3d797f8e55a2c0796f65c4122a7b17d24e8bff0a5fd90701220f11b387a8d9 |
|
MD5 | b6e8adaf1c2afe816f51fbe3bca8a72b |
|
BLAKE2b-256 | 7f0a079e6ee8c10d3d60ad85e6c6e9efd8cfd1a972d8209983ab23c5c7d6ee02 |