amore

package module
v0.0.0-...-7296e18 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2017 License: MIT Imports: 5 Imported by: 0

README

Amore

GoDoc

A game library for Go, inspired by Love 2D. Currently in Beta. This is a hobby library and support should not be expected.

Objectives

  • Enable making games easy, fast and fun
  • Making games portable
  • Single executable deployment strategy.

Aimed Platform Support:

  • OS X
  • Linux
  • Windows
  • iOS
  • Android

Installation

Install the amore package by running the go get command

go get -u github.com/tanema/amore/...
Requirements

Amore requires SDL2 to operate on PC. You can install it by doing the following.

Ubuntu 14.04 and above, type: apt-get install libsdl2-dev

Fedora 20 and above, type: yum install SDL2-devel

Arch Linux, type: pacman -S sdl2

Mac OS X, via Homebrew: brew install sdl2

Windows, via Msys2: pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2

Amore Command

Install the command line helper with the go install tool

go install github.com/tanema/amore/cmd
  • amore new will generate initial files for a game in the current folder
  • amore bundle will generate a file called asset_bundle.go with all the assets and config in ziped byte array to be included in the binary

Example

See more examples at github.com/tanema/amore-examples

// Basic hello world program
package main

import (
  "github.com/tanema/amore"
  "github.com/tanema/amore/gfx"
)

func main() {
  amore.Start(update, draw)
}

func update(deltaTime float32) {
}

func draw() {
  gfx.Print("Hello World",50, 50)
}

TODO

  • font rendering, especially spacing is bad
  • audio seeking broken
  • use runtime.SetFinalizer to release assets so that the develop does not have to manage volatiles.

Documentation

Overview

The base amore package is simply for stopping and starting your game. It will also automatically lock the os thread and set the application to use all available cpus.

Index

Constants

This section is empty.

Variables

View Source
var OnLoad func()

OnLoad will be called after the context is all setup but before the game loop has started. This is a good time to get information like screen size from the window and setup environment. Set this variable with amore.OnLoad = func() {}

Functions

func Quit

func Quit()

Quit will prepare the window to close at the end of the next game loop. This will allow a nice clean destruction of all object that are allocated in OpenGL, SDL, and OpenAl

func Start

func Start(update func(float32), draw func()) error

Start creates a window and context for the game to run on and runs the game loop. As such this function should be put as the last call in your main function. update and draw will be called synchronously because calls to OpenGL that are not on the main thread will crash your program.

Types

This section is empty.

Directories

Path Synopsis
The audio package is use for creating audio sources, managing/pooling resources, and playback of those audio sources.
The audio package is use for creating audio sources, managing/pooling resources, and playback of those audio sources.
al
decoding
Package decoding is used for converting familiar file types to data usable by OpenAL.
Package decoding is used for converting familiar file types to data usable by OpenAL.
cmd
amore
The amore command for bundling assets and helpers for quick project creation.
The amore command for bundling assets and helpers for quick project creation.
The event pacakge manages and delegates all the events in the gl context to thier respective handlers.
The event pacakge manages and delegates all the events in the gl context to thier respective handlers.
The file Package is meant to take care of all asset file opening so that file access is safe if trying to access a bundled file or a file from the disk
The file Package is meant to take care of all asset file opening so that file access is safe if trying to access a bundled file or a file from the disk
gfx
The gfx Pacakge is used largly to simplify OpenGL calls and to manage state of transformations.
The gfx Pacakge is used largly to simplify OpenGL calls and to manage state of transformations.
gl
The joystick Package handles any joystick or gamepad events on the gl context, it can be used for feedback and input.
The joystick Package handles any joystick or gamepad events on the gl context, it can be used for feedback and input.
The keyboard Pacakge handles the keyboard events on the gl context To capture events as they happen you can use the callbacks OnKeyDown, OnKeyUp, OnTextInput, and OnTextEdit.
The keyboard Pacakge handles the keyboard events on the gl context To capture events as they happen you can use the callbacks OnKeyDown, OnKeyUp, OnTextInput, and OnTextEdit.
The system Pacakge is a utility pacakge meant to interface with system operations like opening an application or setting the clipboard text
The system Pacakge is a utility pacakge meant to interface with system operations like opening an application or setting the clipboard text
The timer Package manages game timing by calling step so that the user can get FPS, and delta time from this pacakge
The timer Package manages game timing by calling step so that the user can get FPS, and delta time from this pacakge
The touch Pacakge handles touch events in the gl context To capture events as they happen you can use the callbacks OnTouchPress, OnTouchRelease, and OnTouchMove.
The touch Pacakge handles touch events in the gl context To capture events as they happen you can use the callbacks OnTouchPress, OnTouchRelease, and OnTouchMove.
The window Pacakge creates and manages the window and gl context.
The window Pacakge creates and manages the window and gl context.
surface
A simple package meant to load sdl surfaces without sdl_image.
A simple package meant to load sdl surfaces without sdl_image.

Jump to

Keyboard shortcuts

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