File tree Expand file tree Collapse file tree 2 files changed +14
-12
lines changed
Expand file tree Collapse file tree 2 files changed +14
-12
lines changed Original file line number Diff line number Diff line change 33
44package pi
55
6+ import "github.com/elgopher/pi/image"
7+
8+ // Palette has all colors available in the game. Up to 256.
9+ // Palette is taken from loaded sprite sheet (which must be
10+ // a PNG file with indexed color mode). If sprite-sheet.png was not
11+ // found, then default 16 color palette is used.
12+ //
13+ // Can be freely read and updated when the game is running. Changes will be visible immediately.
14+ var Palette [256 ]image.RGB = defaultPalette
15+
616// Palette swapping variables. Use them to generate new graphics by swapping colors.
717var (
818 // Pal (draw palette) contains mapping of colors used to replace color with
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ import (
4040 "github.com/elgopher/pi/font"
4141)
4242
43- // User parameters
43+ // Game-loop function callbacks
4444var (
4545 // Update is a user provided function executed each frame (30 times per second).
4646 //
@@ -53,19 +53,11 @@ var (
5353 //
5454 // The purpose of this function is to draw on screen.
5555 Draw func ()
56-
57- // Palette has all colors available in the game. Up to 256.
58- // Palette is taken from loaded sprite sheet (which must be
59- // a PNG file with indexed color mode). If sprite-sheet.png was not
60- // found, then default 16 color palette is used.
61- //
62- // Can be freely read and updated when the game is running. Changes will be visible immediately.
63- Palette = defaultPalette
64-
65- // Camera has camera offset used for all subsequent draw operations.
66- Camera Position
6756)
6857
58+ // Camera has camera offset used for all subsequent draw operations.
59+ var Camera Position
60+
6961// Time returns the amount of time since game was run, as a (fractional) number of seconds
7062//
7163// Time is updated each frame.
You can’t perform that action at this time.
0 commit comments