-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsingleton.go
53 lines (46 loc) · 1.16 KB
/
singleton.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package kar
import (
"image"
"image/color"
"log"
"os"
"github.com/hajimehoshi/ebiten/v2"
"github.com/hajimehoshi/ebiten/v2/colorm"
"github.com/mlange-42/arche/ecs"
"github.com/setanarut/kamera/v2"
)
type ISystem interface {
Init()
Update()
Draw()
}
var (
DesktopPath string
WindowScale float64 = 2.0
ScreenW, ScreenH float64 = 500.0, 340.0
ItemCollisionDelay int = 10
RaycastDist int = 4 // block unit
DrawDebugHitboxesEnabled bool = false
DrawDebugTextEnabled bool = false
PlayerBestToolDamage = 5.0
PlayerDefaultDamage = 1.0
RenderArea image.Point = image.Point{
(int(ScreenW) / 20) + 3,
(int(ScreenH) / 20) + 3,
} // cam w/h blocks
BackgroundColor color.RGBA = color.RGBA{36, 36, 39, 255}
Screen *ebiten.Image
Camera *kamera.Camera
WorldECS = ecs.NewWorld()
ColorMDIO = &colorm.DrawImageOptions{}
ColorM = colorm.ColorM{}
// Debug
)
func init() {
// GlobalColorM.ChangeHSV(1, 0, 1)
homePath, err := os.UserHomeDir()
if err != nil {
log.Fatal(err)
}
DesktopPath = homePath + "/Desktop/"
}