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 and compile 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:
pymodd generate-project [GAME_JSON_FILE_PATH]
Quick Script Example
view the examples/froge directory for a generated pymodd project
@script(triggers=[Trigger.EVERY_SECOND])
class EverySecond():
def _build(self):
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),
set_variable(Variables.BOSS_TIMER, 200),
], [
]),
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.3.0.tar.gz
(55.4 kB
view hashes)
Built Distribution
Close
Hashes for pymodd-0.3.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24184217b40e36a06b9ff07126441e08dadb5769f83fc1092e52c1adc8d1527e |
|
MD5 | fd5886bb04eeaa99171449e237ba7311 |
|
BLAKE2b-256 | 5dc645016a7eb13ee0200dee2016262c5c3653f0d63a18b086ca18d9fa5c286a |