Skip to content

Commit

Permalink
Major changes to game engine (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
mokiat authored Aug 11, 2024
1 parent 6d4d932 commit fd045f7
Show file tree
Hide file tree
Showing 243 changed files with 17,498 additions and 8,190 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Go

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22"

- name: Run Tests
run: go run github.com/onsi/ginkgo/v2/ginkgo -r -randomize-all
50 changes: 45 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,49 @@
# Lacking Game Engine [![Go Report Card](https://goreportcard.com/badge/github.com/mokiat/lacking)](https://goreportcard.com/report/github.com/mokiat/lacking) [![Go Reference](https://pkg.go.dev/badge/github.com/mokiat/lacking.svg)](https://pkg.go.dev/github.com/mokiat/lacking)
# Lacking Game Engine

![logo](logo.png)
[![Go Report Card](https://goreportcard.com/badge/github.com/mokiat/lacking)](https://goreportcard.com/report/github.com/mokiat/lacking)
[![Go Reference](https://pkg.go.dev/badge/github.com/mokiat/lacking.svg)](https://pkg.go.dev/github.com/mokiat/lacking)

A 3D game engine / game framework that lacks a lot of features (hence the name).
[![logo](docs/images/logo.png)](https://mokiat.com/lacking/)

This repository is a hobby project of mine that aims to support other hobby projects like [rally-mka](https://github.com/mokiat/rally-mka). There are no plans at the moment to have this become a serious project and as such it lacks proper testing and code cleanliness.
A 3D game engine / framework that lacks a lot of features, hence the name.

**WARNING:** If you do decide to base a project of yours off of this repository make sure you depend on a specific tagged version, as the `master` branch or new tagged versions are unlikely to be backward compatible.
**WARNING** This project is still not stable. I am playing around with the code a lot and trying stuff. Avoid using it if you are looking for something serious and reliable.

As I am quickly iterating over the code and making breaking changes all the time, avoid opening Pull Requests. The best you can do, if you want to contribute, is to open an Issue. Similarly, if you plan to use it for your own project, make sure to use a stable tag and be ready to face the consequences.


## Getting Started

To get a feel for how a game is structured and implemented using Lacking, have a look at the [source code](https://github.com/mokiat/rally-mka) of [Rally MKA](#rally-mka).

Otherwise, have a look at the official [web page](https://mokiat.com/lacking/) which contains information on how to set up a Hello World project.


## Examples

I have uploaded some example games made with this engine on `itch.io`.

### Rally MKA

Drive around in a car with no particular purpose except to zone out.
Best played with keyboard or mouse. The gamepad option is hard.

[![Rally MKA](docs/images/example-rally-mka.png)](https://mokiat.itch.io/rally-mka)

> This game was the initial reason for the lacking game engine.
### AI Suppression

A Game Jam entry. Use the keyboard to defend your ship from alien airships. Users of vim will have an easy time here.

[![AI Suppression](docs/images/example-ai-suppression.png)](https://mokiat.itch.io/ai-suppression)

> A solo 48h Sofia Game Jam (2023) entry.
### Dem Cows

Fly around in a plane and use a hanging club to pop cow balloons. As it uses semi-realistic physics it is best played with a gamepad and care should be taken regarding stall and speed. There wasn't enough time to balance this game. Winning it with keyboard is nearly impossible.

[![Dem Cows](docs/images/example-dem-cows.png)](https://mokiat.itch.io/dem-cows)

> A duo 48h Hardcore Game Jam (2024) entry.
3 changes: 2 additions & 1 deletion app/gamepad.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ type Gamepad interface {
// Pulse causes the Gamepad controller to vibrate with the specified
// intensity (0.0 to 1.0) for the specified duration.
//
// If the device does not have haptic feedback then this method does nothing.
// If the device does not have haptic feedback or if this API implementation
// does not support it then this method does nothing.
Pulse(intensity float64, duration time.Duration)
}
2 changes: 2 additions & 0 deletions audio/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package audio provides audio processing and playback functionality.
package audio
12 changes: 11 additions & 1 deletion audio/media.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,24 @@ import "time"
type MediaDataType int8

const (
// MediaDataTypeAuto indicates that the media data type should be
// automatically detected based on the data.
MediaDataTypeAuto MediaDataType = iota

// MediaDataTypeWAV indicates that the media data is in WAV format.
MediaDataTypeWAV

// MediaDataTypeMP3 indicates that the media data is in MP3 format.
MediaDataTypeMP3
)

// MediaInfo contains the necessary information to create a Media.
type MediaInfo struct {
Data []byte

// Data is the raw media data.
Data []byte

// DataType indicates the type of media data.
DataType MediaDataType
}

Expand Down
1 change: 1 addition & 0 deletions audio/nop.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package audio

import "time"

// NewNopAPI returns an API that does nothing.
func NewNopAPI() API {
return &nopAPI{}
}
Expand Down
1 change: 1 addition & 0 deletions audio/playback.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type PlayInfo struct {
Pan float64
}

// Playback represents the audio playback of a media file.
type Playback interface {

// Stop causes the playback to stop.
Expand Down
75 changes: 0 additions & 75 deletions data/json/level.go

This file was deleted.

Loading

0 comments on commit fd045f7

Please sign in to comment.