Whale Engine is a game engine for Python.
Full documentation is available in documentation.md.
For practical examples look at the examples/ folder.
from WhaleEngine import *
from WhaleEngine.WindowAPI.OpenGL import windowAPI # or Vulkan / WebGL
window = windowAPI(title="Whale engine app")
app = WhaleEngine(window=window)
renderer = Renderer2D()
app.input = InputSystem()
textures = LoadTextures()
entity = Entity2D(texture=textures.dodo)
def update(dt):
if app.input.key_pressed(Keys.ESCAPE):
app.exit()
app.update = update
app.run()Another one:
AppBase.py
- Create a
windowAPIand pass it toWhaleEngine. - Add plugins you need (
InputSystem,MouseSystem,SoundSystem, etc.) — only init what your game uses. - Create a
Renderer2Dto draw things on screen. - Place
Entity2Dobjects into the scene with a texture, position and scale. - Define an
update(dt)function and assign it toapp.update— it is called every frame. - Call
app.run()to start the main loop.
World coordinates are centered: (0, 0) is the screen center, +x right, +y up.
Choose the graphics API that fits your needs:
| Backend | Notes |
|---|---|
| OpenGL | Most stable |
| Vulkan | Experimental |
| WebGL | Runs in a browser window |
from WhaleEngine.WindowAPI.OpenGL import windowAPI # or Vulkan / WebGL
window = windowAPI(title="My App", width=800, height=600)- API is still evolving.
- README and documentation might not be up to date.








