kvasir

package module
v0.0.0-...-ea360a7 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2017 License: MIT Imports: 5 Imported by: 2

README

Kvasir-go

Welcome to this repository. This is an attempt at learning machine learning.

The idea

The idea was to create a game that a computer could learn. This game will be simple, just a dude running around with a gun. There will be spots to "hide" from enemies. Enemies will spawn in waves and there might be pickups.

Afterwards

I plan to make a machine learning algorithm that actually learns to play the game. Don't know exactly how yet. This section will be filled when I do know.

Build

go get github.com/eshumkv/kvasir-go
go run github.com/eshumkv/kvasir-go/main/kvasir-go

FighterML

This is basically a rewrite of the nim project FighterML.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Camera

type Camera struct {
	// contains filtered or unexported fields
}

Camera implements the parts.CameraInterface.

func (Camera) GetScreenLocation

func (camera Camera) GetScreenLocation(x, y float64) (int, int)

func (Camera) GetX

func (camera Camera) GetX() int32

func (Camera) GetY

func (camera Camera) GetY() int32

func (*Camera) SetX

func (camera *Camera) SetX(x int32)

func (*Camera) SetY

func (camera *Camera) SetY(y int32)

type Game

type Game struct {
	// contains filtered or unexported fields
}

Game struct that holds all relevant data

func NewGame

func NewGame(window *sdl.Window, renderer *sdl.Renderer) *Game

NewGame creates a new game.

func (*Game) BeforeUpdate

func (game *Game) BeforeUpdate(dt float64)

BeforeUpdate runs before the update-loop. Do things you only want to do once per game-loop/frame/...

func (*Game) HandleMessage

func (game *Game) HandleMessage(
	msg ecs.Message, data interface{}) interface{}

HandleMessage handles any messages that need to be dealt with.

func (*Game) IsRunning

func (game *Game) IsRunning() bool

func (*Game) Render

func (game *Game) Render(lag float64)

Render shows the gamestate on screen.

func (*Game) SetRunning

func (game *Game) SetRunning(state bool)

func (*Game) ToggleFullscreen

func (game *Game) ToggleFullscreen()

func (*Game) Update

func (game *Game) Update(dt float64)

Update updates the gamestate.

type World

type World struct {
	// contains filtered or unexported fields
}

World represents the world of the game

func NewWorld

func NewWorld(cols, rows int) World

NewWorld creates a new World object.

func (*World) GetColumns

func (world *World) GetColumns() int

func (*World) GetRows

func (world *World) GetRows() int

func (*World) GetTileHeight

func (world *World) GetTileHeight() int

func (*World) GetTileWidth

func (world *World) GetTileWidth() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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