Documentation ¶
Index ¶
- Constants
- type Col
- type Engine
- func (e *Engine) Btn(key Key) bool
- func (e *Engine) Btnp(key Key) bool
- func (e *Engine) Btnr(key Key) bool
- func (e *Engine) Camera(x, y int)
- func (e *Engine) Circ(xc, yc, r float64, col Col, fixed ...bool)
- func (e *Engine) CircFill(xc, yc, r float64, col Col, fixed ...bool)
- func (e *Engine) Clip(x, y, w, h int)
- func (e *Engine) Cls(col Col)
- func (e *Engine) Dget(name string) ([]byte, bool)
- func (e *Engine) DrawMouse(style int)
- func (e *Engine) Dset(name string, data []byte) error
- func (e *Engine) Fget(n, f int) bool
- func (e *Engine) FgetByte(n int) byte
- func (e *Engine) Frames() int
- func (e *Engine) Fset(n, f int, s bool)
- func (e *Engine) FsetByte(n int, b byte)
- func (e *Engine) Line(x1, y1, x2, y2 float64, col Col, fixed ...bool)
- func (e *Engine) LoadFlags(flags [0x200]byte)
- func (e *Engine) LoadMap(mapData [0x4800]byte)
- func (e *Engine) LoadSprs(sheet [0x3000]byte)
- func (e *Engine) Map(mx, my, mw, mh int, dx, dy float64, opts ...SOp)
- func (e *Engine) Mbtn(key MouseBtn) bool
- func (e *Engine) Mbtnp(key MouseBtn) bool
- func (e *Engine) Mbtnr(key MouseBtn) bool
- func (e *Engine) Mget(x, y int) int
- func (e *Engine) Mouse() (int, int)
- func (e *Engine) Mset(x, y, t int)
- func (e *Engine) PalA(pallet Pal)
- func (e *Engine) PalB(pallet Pal)
- func (e *Engine) PalGet() (Pal, Pal)
- func (e *Engine) Pget(x, y float64) Col
- func (e *Engine) Pset(x, y float64, col Col)
- func (e *Engine) RClip()
- func (e *Engine) Rect(x, y, w, h float64, col Col, fixed ...bool)
- func (e *Engine) RectFill(x, y, w, h float64, col Col, fixed ...bool)
- func (e *Engine) Run()
- func (e *Engine) SSpr(sx, sy, sw, sh int, dx, dy float64, opts ...SOp)
- func (e *Engine) Spr(n int, x, y float64, opts ...SOp)
- func (e *Engine) Text(x, y float64, text string, opts ...TOp)
- func (e *Engine) TextL(text string, opts ...TOp)
- func (e *Engine) TextR(text string, opts ...TOp)
- type Key
- type MouseBtn
- type Pal
- type SOp
- type TOp
Constants ¶
View Source
const ( ScreenHeight = 192 ScreenWidth = 192 )
Engine Screen Width and Height
View Source
const ( Col0 = Col(0b10000000) Col1 = Col(0b10000001) Col2 = Col(0b10000010) Col3 = Col(0b10000011) Col4 = Col(0b10000100) Col5 = Col(0b10000101) Col6 = Col(0b10000110) Col7 = Col(0b10000111) )
These are the pallet and color constants
View Source
const ( Pal0 = Pal(0b00000000) Pal1 = Pal(0b00000001) Pal2 = Pal(0b00000010) Pal3 = Pal(0b00000011) Pal4 = Pal(0b00000100) Pal5 = Pal(0b00000101) Pal6 = Pal(0b00000110) Pal7 = Pal(0b00000111) Pal8 = Pal(0b00001000) Pal9 = Pal(0b00001001) Pal10 = Pal(0b00001010) Pal11 = Pal(0b00001011) Pal12 = Pal(0b00001100) Pal13 = Pal(0b00001101) Pal14 = Pal(0b00001110) Pal15 = Pal(0b00001111) )
The list of all pallets
View Source
const ( Backspace = Key(8) Tab = Key(9) Enter = Key(13) Shift = Key(16) Ctrl = Key(17) Alt = Key(18) Break = Key(19) CapsLock = Key(20) Esc = Key(27) Space = Key(32) PageUp = Key(33) PageDown = Key(34) End = Key(35) Home = Key(36) LeftArrow = Key(37) UpArrow = Key(38) RightArrow = Key(39) DownArrow = Key(40) Insert = Key(45) Delete = Key(46) ZeroKey = Key(48) OneKey = Key(49) TwoKey = Key(50) ThreeKey = Key(51) FourKey = Key(52) FiveKey = Key(53) SixKey = Key(54) SevenKey = Key(55) EightKey = Key(56) NineKey = Key(57) AKey = Key(65) BKey = Key(66) CKey = Key(67) DKey = Key(68) EKey = Key(69) FKey = Key(70) GKey = Key(71) HKey = Key(72) IKey = Key(73) JKey = Key(74) KKey = Key(75) LKey = Key(76) MKey = Key(77) NKey = Key(78) OKey = Key(79) PKey = Key(80) QKey = Key(81) RKey = Key(82) SKey = Key(83) TKey = Key(84) UKey = Key(85) VKey = Key(86) WKey = Key(87) XKey = Key(88) YKey = Key(89) ZKey = Key(90) LeftWinKey = Key(91) RightWinKey = Key(92) Select = Key(93) NumPad0 = Key(96) NumPad1 = Key(97) NumPad2 = Key(98) NumPad3 = Key(99) NumPad4 = Key(100) NumPad5 = Key(101) NumPad6 = Key(102) NumPad7 = Key(103) NumPad8 = Key(104) NumPad9 = Key(105) NumPadMul = Key(106) NumPadPlus = Key(107) NumPadMinus = Key(109) NumPadDot = Key(110) NumPadDiv = Key(111) F1 = Key(112) F2 = Key(113) F3 = Key(114) F4 = Key(115) F5 = Key(116) F6 = Key(117) F7 = Key(118) F8 = Key(119) F9 = Key(120) F10 = Key(121) F11 = Key(122) F12 = Key(123) NumLock = Key(144) ScrollLock = Key(145) SemiColon = Key(186) Equals = Key(187) Comma = Key(188) Minus = Key(189) Period = Key(190) FSlash = Key(191) Tilda = Key(192) OpenBracket = Key(219) BSlash = Key(220) CloseBracket = Key(221) Quotes = Key(222) )
Golf Key Codes, Mirrors JS key code values
View Source
const ( LeftClick = MouseBtn(0) MiddleClick = MouseBtn(1) RightClick = MouseBtn(2) )
MouseKey codes
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct { RAM *[0xFFFF]byte Draw func() Update func() // contains filtered or unexported fields }
Engine is the golf engine
func NewEngine ¶
func NewEngine(update func(), draw func()) *Engine
NewEngine creates a new golf engine
func (*Engine) Map ¶
Map draws the map on the screen starting from tile mx, my with a size of mw and mh. The map is draw at screen coordinate dx, dy
func (*Engine) SSpr ¶
SSpr draw a rect from the sprite sheet to the screen sx, sy, sw, and sh define the rect on the sprite sheet dx, dy is the location to draw on the screen
Click to show internal directories.
Click to hide internal directories.