Skip to content

Switch Game - is an Engine to create games based on python. It supports many sprites like a StaticSprite, AnimatedSprite, AbsoluteSprite and many useful classes such as Image, Animation, Tileset and other. This project is in development, but you can already use it in your games.

License

Notifications You must be signed in to change notification settings

chebupelka8/SwitchGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Switch Game - is an Engine to create games based on python. It supports some sprites like a StaticSprite, AnimatedSprite and many useful classes such as Image, Animation, Tileset and other. This project is in development, but you can already use it in your games.

Wiki

Import

from SwitchGame import *

How to create window

from SwitchGame import *


app = WindowLoop(Vec2(1000, 600))

def main():
    while True: # mainloop
        app.update_display()


if __name__ == "__main__":
    main()

Basic class

from SwitchGame import *


class Main(WindowLoop):
    def __init__(self) -> None:
        super().__init__(Vec2(1000, 600), 165)
    
    def update_events(self, __event) -> None:
        if __event.type == KEYDOWN:
            print("key pressed")

        else:
            super().update_events(__event)
    
    def main(self) -> None:
        while True: # mainloop
            self.update_display()


if __name__ == "__main__":
    Main().main()

About

Switch Game - is an Engine to create games based on python. It supports many sprites like a StaticSprite, AnimatedSprite, AbsoluteSprite and many useful classes such as Image, Animation, Tileset and other. This project is in development, but you can already use it in your games.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages