Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jossse69 committed Mar 20, 2024
1 parent d7271ed commit 5502e3e
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,49 +25,49 @@ here is a simple 'Hello World' example:
package main

import (
"github.com/jossse69/PUZZ/core" // import the core package
"github.com/jossse69/PUZZ/core" // import the core package
)

var game *core.Game // global game variable

func main() {
// low res of the screen of 320x240 for retro look. (this a recommended setting)
game = core.NewGame(220, 140, "Hello, World!")
// low res of the screen of 320x240 for retro look. (this a recommended setting)
game = core.NewGame(220, 140, "Hello, World!")

// setup the load, update and draw hooks
game.Load = load
game.Update = update
game.Draw = draw
// setup the load, update and draw hooks
game.Load = load
game.Update = update
game.Draw = draw

// finally, run the game
game.Run()
// finally, run the game
game.Run()
}

func load() {
// Load any game resources here
// Load any game resources here
}

func update(dt float32) {
// Update game logic here, use dt for time since last frame (useful for frame rate independent movement)
// Update game logic here, use dt for time since last frame (useful for frame rate independent movement)
}

func draw() {
// draw any elements here
// e.g. line for the game rect
// draw any elements here
// e.g. line for the game rect

// first clear the screen
game.Renderer.Fill(0)
// first clear the screen
game.Renderer.Fill(0)

// draw a line from 0,0 to the top right of the screen
game.Renderer.DrawLine(0, 0, int(game.Renderer.Target.Texture.Width), int(game.Renderer.Target.Texture.Height), 6) // id color of 6 is red
// draw a line from 0,0 to the top right of the screen
game.Renderer.DrawLine(0, 0, int(game.Renderer.Target.Texture.Width), int(game.Renderer.Target.Texture.Height), 6) // id color of 6 is red

// then a line from 0,0 to the right of the screen
game.Renderer.DrawLine(0, 0, int(game.Renderer.Target.Texture.Width), 0, 6)
// then a line from 0,0 to the right of the screen
game.Renderer.DrawLine(0, 0, int(game.Renderer.Target.Texture.Width), 0, 6)

// then a line from 0,0 to the top of the screen
game.Renderer.DrawLine(0, 0, 0, int(game.Renderer.Target.Texture.Height), 6)
// then a line from 0,0 to the top of the screen
game.Renderer.DrawLine(0, 0, 0, int(game.Renderer.Target.Texture.Height), 6)
}
```
```

want to know more? check out the [docs](https://github.com/jossse69/PUZZ/tree/master/docs) for more information! :D

Expand Down

0 comments on commit 5502e3e

Please sign in to comment.