Skip to main content
Module

x/caviar/mod.ts>World

⚡ Blazing fast, modern, Game Engine powered by WebGPU for Deno and the browser
Latest
class World
extends WebGLCanvas
import { World } from "https://deno.land/x/caviar@2.6.7/mod.ts";

Constructors

new
World(params: CreateWindowOptions, scenes: Array<Scene>)

Properties

currentScene: Scene

Current scene displayed

FPS: number

Frames displayed per second

keyManager: KeyManager

Manages Key Events

loadedPlugins: any

All plugins currently loaded

params: CreateWindowOptions

Window parameters

plugins: any

List of available plugins

renderer: WebGLRenderer2D

The WebGl renderer that powers the engine

reRender: boolean

Whether or not to rerender

scenes: Array<Scene>

Collection of scenes in the world

Methods

Disables the caviar launch banner

keyDown(e: WindowKeyboardEvent): boolean

Checks if a key is currently down

loadPlugin(name: string, plugin: any): void

Adds a plugin to the game

setBackground(color: string | RGBA): void

Sets the background to the given color

setFPS(fps: number): void

Sets the amount of Frames to render per second

setScene(id: number): void

Sets the current scene to the specified scene index

setScene(name: string): void

Sets the current scene to the specified scene with the given name

setup(): void

Sets up the current scene

start(): Promise<void>

Launches the World

Updates the program's life cycle

usePlugin(name: string): any

Uses an loaded plugin to the game

[_draw](): void
[_fps](): () => void
[_mouseDown](e: any): void