# Crost Mods API ## Start ``` 1. Create folder C:\Program Files\Crost\mods\*title mod* 2. Create python file C:\Program Files\Crost\mods\*title mod*\main.py 3. Then work with this file. ``` ### [Pygame Docs](https://www.pygame.org/docs/) ## Main ### Example ``` python def start(pygame): # Code start def update(game): # Code update ``` ### Class game ``` game.pygame - Library game.window - Class pygame.Surface game.players - List[player] game.player - Class player game.chat - Class chat game.bots - List[bot] game.scene - Class scene ``` ### Class player ``` player.x - Int player.y - Int player.z - Int player.animCount - Int player.skin - Class skin player.shadow - Class shadow player.hitbox - Class hitbox player.hearts - Class hearts player.coins - Class coins player.superCoins - Class superCoins player.died - Bool player.speed - Int player.inventory - List[item] player.armors - List[item] player.selected - Int player.isJump - Bool player.jumpCount - Int player.left - Bool player.right - Bool player.startspeed - Int player.positionStand - String player.chat - List[String] player.id - Int player.username - String player.hit(strong) - Function player.kill() - Function player.draw() - Function ``` ### Class chat ``` chat.input - String chat.isShow - Bool chat.send(player=None) - Function chat.clear(player=None) - Function ``` ### Class bot ``` bot.x - Int bot.y - Int bot.z - Int bot.skin - skin bot.hitbox - hitbox bot.side - String bot.on() - Function bot.off() - Function bot.speed - Int bot.stand - Bool bot.canKill - Bool bot.hp - Int bot.damage - Int bot.start - Class bot bot.jump() - Function bot.isHitbox() - Function bot.draw() - Function ``` ### Class scene ``` scene.x - Int scene.y - Int scene.sunPosition - Int scene.limitUp - Int scene.limitRight - Int scene.limitDown - Int scene.limitLeft - Int scene.doTransition - Bool scene.fore - Bool scene.items - List[item] scene.bg - String/pygame.Surface scene.set() - Function scene.restart() - Function ``` ### Class item ``` item.x - Int item.y - Int item.z - Int item.width - Int item.height - Int item.perceived - Bool item.surface - pygame.Surface item.take - Bool item.isTake - Bool item.type - String item.armor - String ``` ### Class skin ``` skin.width - Int skin.height - Int skin.name - String skin.walk - List[pygame.Surface] skin.idle - pygame.Surface player.skin.change(name) - Function ``` ### Class hitbox ``` hitbox.x - Int hitbox.y - Int ``` ### Class shadow ``` shadow.x - Int shadow.y - Int ``` ### Class hearts ``` hearts.count - Int hearts.max - Int hearts.animCount - Int ``` ### Class coins ``` coins.plus(num) - Function coins.minus(num) - Function coins.set(num) - Function ``` ### Class superCoins ``` superCoins.plus(num) - Function superCoins.minus(num) - Function superCoins.set(num) - Function ``` ## Advanced ### Replaced built-in functions ``` python print(text) clear() # Clear console input() # Do not work ``` ### Spec functions ``` python start(pygame) update(game) end() onKeyDown(key) onPlayerDied(where) onMouseClick(x, y, side) onMouseChangeXY(fromXY, toXY) onChangeScene(fromScene, toScene) ``` ## Write comments what functions are missing to create mods!