Skip to content

Commit

Permalink
16/8/21 12:18 PM
Browse files Browse the repository at this point in the history
  • Loading branch information
eboatwright committed Aug 16, 2021
1 parent 34f906e commit 2b16034
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions examples/0-emptyProject/main.go
Original file line number Diff line number Diff line change
@@ -1,30 +1,38 @@
package main


// Import Ebiten and Pearl (Ebiten not used in empty example)
import (
// "github.com/hajimehoshi/ebiten/v2"
"github.com/eboatwright/pearl"
)


// Define window size, scale and title
const (
WINDOW_WIDTH = 960
WINDOW_HEIGHT = 600
SCREEN_SCALE = 3
WINDOW_TITLE = "empty pearl"
)

// This isn't const because pearl.RGBA isn't a const initializer
var (
BACKGROUND_COLOR = pearl.RGBA(135, 206, 235, 255)
)


// Called when Pearl is ready
func onStart() {
// Create and load scene
gameScene := &pearl.Scene { ID: "game" }
pearl.LoadScene(gameScene)
}


// Entry point
func main() {
// Start Pearl with predefined constants
// Also, pass in function to be called on start
pearl.Start(WINDOW_WIDTH, WINDOW_HEIGHT, SCREEN_SCALE, WINDOW_TITLE, BACKGROUND_COLOR, onStart)
}

0 comments on commit 2b16034

Please sign in to comment.