gosprite64

package module
v0.0.0-...-1c47ec7 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2025 License: MIT Imports: 7 Imported by: 0

README

GoSprite64
GoSprite64

a 2D retro gamedev library for Nintendo64 using Go!

License CI Go Report Card Publish docs Dependabot Updates

visit gosprite64.dev for the full documentation, examples and guides.

✨ Features

GoSprite64 embraces the flat world of tilemaps, palettes, and framebuffers — without the complexity of 3D pipelines.

"You only need X and Y."

  • 🕹️ Built on embedded-go to provide Go idiomatic experience.

  • 🎮 Powered by clktmr/n64 to make things possible directly on real N64 hardware.

  • 🧠 Clean and idiomatic Go API inspired from Ebitengine, Raylib and PICO-8

  • 💾 Runs on real N64 consoles (via EverDrive or SummerCard64)

  • 🔧 Great for retro homebrew, demoscene, or nostalgic experiments

Contributing

If you are interested in contributing to GoSprite64, read about our Contributing guide

License

This project is licensed under the MIT license. See the LICENSE file for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(g Gamelooper) error

Run starts the game loop with default video settings (NTSC 320x240, no interlacing). It will initialize the display, then repeatedly call Update() and Draw().

Types

type Gamelooper

type Gamelooper interface {
	// Update is called every frame to update game logic.
	// Return an error to exit the game loop, nil to continue.
	Update() error

	// Draw is called every frame to render the game.
	// The screen is already initialized and ready for drawing.
	Draw(screen *Screen)
}

Gamelooper represents a game instance that can be updated and drawn.

type Screen

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

Screen represents the display surface that can be drawn to.

func Init

func Init(preset VideoPreset) *Screen

Init initializes display with the specified video preset. It sets up the framebuffer and renderer for drawing.

func (*Screen) BeginDrawing

func (s *Screen) BeginDrawing()

BeginDrawing prepares for a new frame by swapping the framebuffer.

func (*Screen) Clear

func (s *Screen) Clear(c color.Color)

Clear clears the screen with the specified color.

func (*Screen) EndDrawing

func (s *Screen) EndDrawing()

EndDrawing finalizes the frame by flushing the renderer.

type VideoPreset

type VideoPreset int

VideoPreset represents a predefined video configuration

const (
	// LowRes is the most common setup: 320x240 without interlacing
	LowRes VideoPreset = iota
	// HighRes is 640x480 with interlacing
	HighRes
)

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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