File tree 2 files changed +14
-12
lines changed
2 files changed +14
-12
lines changed Original file line number Diff line number Diff line change 3
3
4
4
package pi
5
5
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
+
6
16
// Palette swapping variables. Use them to generate new graphics by swapping colors.
7
17
var (
8
18
// 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 (
40
40
"github.com/elgopher/pi/font"
41
41
)
42
42
43
- // User parameters
43
+ // Game-loop function callbacks
44
44
var (
45
45
// Update is a user provided function executed each frame (30 times per second).
46
46
//
@@ -53,19 +53,11 @@ var (
53
53
//
54
54
// The purpose of this function is to draw on screen.
55
55
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
67
56
)
68
57
58
+ // Camera has camera offset used for all subsequent draw operations.
59
+ var Camera Position
60
+
69
61
// Time returns the amount of time since game was run, as a (fractional) number of seconds
70
62
//
71
63
// Time is updated each frame.
You can’t perform that action at this time.
0 commit comments