Tooling and templates used for building games
Project description
coopgame
Library of tooling and templates used for building games
Example:
from coopgame.gameTemplate import GameTemplate
from coopstructs.vectors import Vector2
import pygame
from coopgame.colors import Color
from coopgame.sprites import RectangleSprite
class MyGame(GameTemplate):
def __init__(self):
super().__init__()
self.sprites = pygame.sprite.Group()
def draw(self, frames):
for entity in self.sprites:
self.screen.blit(entity.surf, entity.rect)
def handle_hover_over(self, mouse_pos_as_vector: Vector2):
pass
def handle_left_click(self):
self.sprites.add(RectangleSprite(self.mouse_pos_as_vector(), Color.BLUE, 10, 10))
def handle_right_click(self):
self.sprites.add(RectangleSprite(self.mouse_pos_as_vector(), Color.RED, 20, 30))
def handle_key_pressed(self, pressed_key):
if pressed_key == pygame.K_r:
self.sprites.empty()
if __name__ == "__main__":
import logging
import loggingConfig
loggingConfig.initLogging(loggingLvl=logging.DEBUG)
game = MyGame()
game.main()
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
coopgame-1.0.tar.gz
(72.3 kB
view details)
Built Distribution
coopgame-1.0-py3-none-any.whl
(102.7 kB
view details)
File details
Details for the file coopgame-1.0.tar.gz
.
File metadata
- Download URL: coopgame-1.0.tar.gz
- Upload date:
- Size: 72.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7e141cbbaafc033a58b8a1a136a259e16ff7a6c576cea1f66bd753a8b36a57b |
|
MD5 | 7f0fcd0949e9b125706b4ea72747ce42 |
|
BLAKE2b-256 | 6d2793f36ca83ec511fcb590bf26ae04c615573a1367e275ff4e8ff882c657d9 |
File details
Details for the file coopgame-1.0-py3-none-any.whl
.
File metadata
- Download URL: coopgame-1.0-py3-none-any.whl
- Upload date:
- Size: 102.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 638627ebe6d97c36618cc644c3086e12795eb759d1de37a58e1cca893603e82a |
|
MD5 | a106b1e7dba480ffa15054758a29d0f6 |
|
BLAKE2b-256 | 637753527a204a7401ffaa00f8f692abaeddc234e4d89d13b34965a161418334 |