-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
eboatwright
committed
Aug 16, 2021
1 parent
34f906e
commit 2b16034
Showing
1 changed file
with
8 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |