e2

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2022 License: MIT Imports: 19 Imported by: 0

README

E2

E2 logo

E2 is an experimental game framework built on top of Ebiten, primarily being designed for narrative-driven games (though other styles may also possible).

Goals

  • Lightweight enough to run on weak or outdated hardware*
  • Fast and (relatively) easy to build games with

*definitions of "weak" and "outdated" to be figured out eventually...

v1.0 Roadmap

  • ECS package see pkg/wecqs
  • more complete set of components & systems
  • system and component registry
  • scripting interface
  • well documented/commented examples:
    • tile rendering?
    • input handling?
    • simple collisions?
  • coverage tests
  • package tests
  • changelog file

Thanks to...

License

The main e2 package and all subpackages in this repository (see cmd/, examples/, pkg/, internal/) are distributed under the MIT License. See the license file or this page on opensource.org for more details.

The contents of any "assets" folders in this repository (i.e. assets/ or any of the "assets" folders in cmd/ or examples/) are released into the public domain under CC0 "No Rights Reserved". Feel free to use them in your own projects for whatever purpose you want. No attribution required!

Documentation

Overview

Package e2 is a 3D isometric game framework.

Index

Constants

View Source
const Name = "E2"
View Source
const Version = "0.2.0"

Variables

View Source
var (
	ErrInvalidIconFormat = errors.New("invalid icon format")
	ErrNoActiveWorld     = errors.New("no active world")
	ErrNoActiveScene     = errors.New("no active scene")
)

Functions

func ActiveScene

func ActiveScene() *wecqs.Scene

ActiveScene returns the currently active Scene.

func ActiveWorld

func ActiveWorld() *wecqs.World

ActiveWorld returns the currently active World.

func AddAuthor

func AddAuthor(s string)

AddAuthor adds an author. Given author strings be in the following formats: - a name (e.g. "Jai") - a name and an email (e.g. "Jai <jai@nonexistent.net>") - an email (e.g. "jai@nonexistent.net")

func AddIconData

func AddIconData(raw []byte)

AddIconData adds some image data to use as an icon.

func AddIconPath

func AddIconPath(iconPath string)

AddIconPath adds a given icon path.

func AddWorld

func AddWorld(ws ...*wecqs.World) error

AddWorld adds the given worlds to the game.

func NewWorld

func NewWorld(name string) (*wecqs.World, error)

NewWorld creates a new World with the given name.

func PostSystems added in v0.2.0

func PostSystems() *wecqs.SystemManager

PostSystems returns the post-world SystemManager.

func PreSystems added in v0.2.0

func PreSystems() *wecqs.SystemManager

PreSystems returns the pre-world SystemManager.

func RemoveWorld

func RemoveWorld(name string) error

RemoveWorld removes a world with the given name.

func Run

func Run() error

Run game.

func SetDescription

func SetDescription(description string)

SetDescription sets the game description.

func SetMaxTPS

func SetMaxTPS(maxTPS int)

SetMaxTPS sets the maximum tick rate (TPS).

func SetName

func SetName(name string)

SetName sets the game name.

func SetResolution added in v0.2.0

func SetResolution(width, height int)

SetResolution sets the game resolution.

func SetVersion

func SetVersion(version string)

SetVersion sets the game version.

func SetVsync

func SetVsync(enabled bool)

SetVsync can be used to enable or disable vsync.

func SetWindowSize

func SetWindowSize(width, height int)

SetWindowSize sets the default window size.

func SwitchWorld

func SwitchWorld(name string) error

SwitchWorld switches to a different world with the given name.

func Undersample added in v0.2.0

func Undersample(i int)

Undersample applies a basic pixelation effect by reducing the internal resolution of the game.

func World

func World(name string) *wecqs.World

World returns the World with the given game.

func Worlds

func Worlds() *wecqs.WorldManager

Worlds returns the WorldManager.

Types

type Author

type Author struct {
	Name  string `json:"name"`
	Email string `json:"email"`
}

func Authors added in v0.2.0

func Authors() []Author

Authors returns all the authors of the game.

Directories

Path Synopsis
examples
fps
pkg
components
Package components provides a standard set of components for E2.
Package components provides a standard set of components for E2.
log
systems
Package systems provides a standard set of systems for E2.
Package systems provides a standard set of systems for E2.
wecqs
Package wecqs provides the ECS (Entity-Component-System) structure for E2, built around Ebiten.
Package wecqs provides the ECS (Entity-Component-System) structure for E2, built around Ebiten.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL