Initial commit
This commit is contained in:
commit
6c78a639f5
9 changed files with 110 additions and 0 deletions
BIN
0001-game-dev-fundamentals/0001-game-dev-fundamentals.odp
Normal file
BIN
0001-game-dev-fundamentals/0001-game-dev-fundamentals.odp
Normal file
Binary file not shown.
3
0001-game-dev-fundamentals/go.mod
Normal file
3
0001-game-dev-fundamentals/go.mod
Normal file
|
@ -0,0 +1,3 @@
|
|||
module helloworld
|
||||
|
||||
go 1.19
|
7
0001-game-dev-fundamentals/main.go
Normal file
7
0001-game-dev-fundamentals/main.go
Normal file
|
@ -0,0 +1,7 @@
|
|||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Println("Hello, world!")
|
||||
}
|
22
0002-getting-started-with-ebitengine/game.go
Normal file
22
0002-getting-started-with-ebitengine/game.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package main
|
||||
|
||||
import "github.com/hajimehoshi/ebiten/v2"
|
||||
|
||||
type game struct {
|
||||
}
|
||||
|
||||
func (g game) Update() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (g game) Draw(screen *ebiten.Image) {
|
||||
|
||||
}
|
||||
|
||||
func (g game) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int) {
|
||||
return outsideWidth, outsideHeight // Set viewport size to new window size.
|
||||
}
|
||||
|
||||
func newGame() *game {
|
||||
return &game{}
|
||||
}
|
14
0002-getting-started-with-ebitengine/go.mod
Normal file
14
0002-getting-started-with-ebitengine/go.mod
Normal file
|
@ -0,0 +1,14 @@
|
|||
module gettingstarted
|
||||
|
||||
go 1.19
|
||||
|
||||
require github.com/hajimehoshi/ebiten/v2 v2.7.8
|
||||
|
||||
require (
|
||||
github.com/ebitengine/gomobile v0.0.0-20240802043200-192f051f4fcc // indirect
|
||||
github.com/ebitengine/hideconsole v1.0.0 // indirect
|
||||
github.com/ebitengine/purego v0.7.1 // indirect
|
||||
github.com/jezek/xgb v1.1.1 // indirect
|
||||
golang.org/x/sync v0.8.0 // indirect
|
||||
golang.org/x/sys v0.23.0 // indirect
|
||||
)
|
15
0002-getting-started-with-ebitengine/go.sum
Normal file
15
0002-getting-started-with-ebitengine/go.sum
Normal file
|
@ -0,0 +1,15 @@
|
|||
github.com/ebitengine/gomobile v0.0.0-20240802043200-192f051f4fcc h1:76TYsaP1F48tiQRlrr71NsbfxBcFM9/8bEHS9/JbsQg=
|
||||
github.com/ebitengine/gomobile v0.0.0-20240802043200-192f051f4fcc/go.mod h1:RM/c3pvru6dRqgGEW7RCTb6czFXYAa3MxbXu3u8/dcI=
|
||||
github.com/ebitengine/hideconsole v1.0.0 h1:5J4U0kXF+pv/DhiXt5/lTz0eO5ogJ1iXb8Yj1yReDqE=
|
||||
github.com/ebitengine/hideconsole v1.0.0/go.mod h1:hTTBTvVYWKBuxPr7peweneWdkUwEuHuB3C1R/ielR1A=
|
||||
github.com/ebitengine/purego v0.7.1 h1:6/55d26lG3o9VCZX8lping+bZcmShseiqlh2bnUDiPA=
|
||||
github.com/ebitengine/purego v0.7.1/go.mod h1:ah1In8AOtksoNK6yk5z1HTJeUkC1Ez4Wk2idgGslMwQ=
|
||||
github.com/hajimehoshi/ebiten/v2 v2.7.8 h1:QrlvF2byCzMuDsbxFReJkOCbM3O2z1H/NKQaGcA8PKk=
|
||||
github.com/hajimehoshi/ebiten/v2 v2.7.8/go.mod h1:Ulbq5xDmdx47P24EJ+Mb31Zps7vQq+guieG9mghQUaA=
|
||||
github.com/jezek/xgb v1.1.1 h1:bE/r8ZZtSv7l9gk6nU0mYx51aXrvnyb44892TwSaqS4=
|
||||
github.com/jezek/xgb v1.1.1/go.mod h1:nrhwO0FX/enq75I7Y7G8iN1ubpSGZEiA3v9e9GyRFlk=
|
||||
golang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ=
|
||||
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
|
||||
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM=
|
||||
golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
20
0002-getting-started-with-ebitengine/main.go
Normal file
20
0002-getting-started-with-ebitengine/main.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/hajimehoshi/ebiten/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
ebiten.SetWindowTitle("TT0002: Getting Started with Ebitengine")
|
||||
ebiten.SetWindowResizingMode(ebiten.WindowResizingModeEnabled)
|
||||
ebiten.SetWindowSize(800, 600)
|
||||
ebiten.SetVsyncEnabled(true)
|
||||
ebiten.SetTPS(60)
|
||||
|
||||
err := ebiten.RunGame(newGame())
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
21
LICENSE
Normal file
21
LICENSE
Normal file
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2024 Trevor Slocum <trevor@rocket9labs.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
8
README.md
Normal file
8
README.md
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Trevor's Tutorials - Free programming tutorials
|
||||
[![Donate via LiberaPay](https://img.shields.io/liberapay/receives/rocket9labs.com.svg?logo=liberapay)](https://liberapay.com/rocket9labs.com)
|
||||
|
||||
Visit [**trevors-tutorials.com**](https://trevors-tutorials.com)
|
||||
|
||||
## Support
|
||||
|
||||
Please share issues and suggestions [here](https://code.rocket9labs.com/tslocum/trevors-tutorials.com/issues).
|
Loading…
Reference in a new issue