Skip to content

D0d0ka/whale-engine

Repository files navigation

whale-engine

Whale Engine is a game engine for Python.

developed by dodo_k

Documentation

Full documentation is available in documentation.md. For practical examples look at the examples/ folder.

Quick start

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

How it works

  • Create a windowAPI and pass it to WhaleEngine.
  • Add plugins you need (InputSystem, MouseSystem, SoundSystem, etc.) — only init what your game uses.
  • Create a Renderer2D to draw things on screen.
  • Place Entity2D objects into the scene with a texture, position and scale.
  • Define an update(dt) function and assign it to app.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.

Rendering backends

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)

Notes

  • API is still evolving.
  • README and documentation might not be up to date.

Screenshots

Releases

No releases published

Packages

 
 
 

Contributors