fixed pc in wall problem; switched to ebiten
This commit is contained in:
parent
9b8f7f04b1
commit
e5df2a83ad
2
go.mod
2
go.mod
|
@ -3,6 +3,6 @@ module steel
|
|||
go 1.12
|
||||
|
||||
require (
|
||||
github.com/kettek/goro v0.0.0-20190712064943-f2e60f211651
|
||||
github.com/kettek/goro v0.0.0-20190713012409-1029522674ba
|
||||
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb // indirect
|
||||
)
|
||||
|
|
8
go.sum
8
go.sum
|
@ -3,6 +3,7 @@ github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdk
|
|||
github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
|
||||
github.com/gdamore/tcell v1.1.2 h1:Afe8cU6SECC06UmvaJ55Jr3Eh0tz/ywLjqWYqjGZp3s=
|
||||
github.com/gdamore/tcell v1.1.2/go.mod h1:h3kq4HO9l2On+V9ed8w8ewqQEmGCSSHOgQ+2h8uzurE=
|
||||
github.com/go-gl/glfw v0.0.0-20181213070059-819e8ce5125f h1:7MsFMbSn8Lcw0blK4+NEOf8DuHoOBDhJsHz04yh13pM=
|
||||
github.com/go-gl/glfw v0.0.0-20181213070059-819e8ce5125f/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||
github.com/gofrs/flock v0.7.0/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
|
||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
|
||||
|
@ -13,6 +14,7 @@ github.com/gopherjs/gopherwasm v0.1.1/go.mod h1:kx4n9a+MzHH0BJJhvlsQ65hqLFXDO/m2
|
|||
github.com/gopherjs/gopherwasm v1.0.0/go.mod h1:SkZ8z7CWBz5VXbhJel8TxCmAcsQqzgWGR/8nMhyhZSI=
|
||||
github.com/gopherjs/gopherwasm v1.1.0/go.mod h1:SkZ8z7CWBz5VXbhJel8TxCmAcsQqzgWGR/8nMhyhZSI=
|
||||
github.com/hajimehoshi/bitmapfont v1.1.1/go.mod h1:Hamfxgney7tDSmVOSDh2AWzoDH70OaC+P24zc02Gum4=
|
||||
github.com/hajimehoshi/ebiten v1.9.3 h1:YijWGMBwH2XA1ZytUQFy33UDHeCSS6d4JZKH1wq38O0=
|
||||
github.com/hajimehoshi/ebiten v1.9.3/go.mod h1:XxiJ4Eltvb1KmcD0i6F81eIB1asJhK47y5DC+FPkyso=
|
||||
github.com/hajimehoshi/go-mp3 v0.2.0/go.mod h1:4i+c5pDNKDrxl1iu9iG90/+fhP37lio6gNhjCx9WBJw=
|
||||
github.com/hajimehoshi/oto v0.1.1/go.mod h1:hUiLWeBQnbDu4pZsAhOnGqMI1ZGibS6e2qhQdfpwz04=
|
||||
|
@ -26,6 +28,12 @@ github.com/kettek/goro v0.0.0-20190628090227-a35769c6cfe8 h1:cRIFgXj8H9M6ZggN/jF
|
|||
github.com/kettek/goro v0.0.0-20190628090227-a35769c6cfe8/go.mod h1:wwgugDvR3Lhzz0hvCpjEFbu12RmCvkLDDYSzM3ILeww=
|
||||
github.com/kettek/goro v0.0.0-20190712064943-f2e60f211651 h1:VhL5yVz0lSMXbO7eK+lJ7jUe0IJRSV+4sUabMrUyDtQ=
|
||||
github.com/kettek/goro v0.0.0-20190712064943-f2e60f211651/go.mod h1:fO57DVF4MXRm+AOQWrFN0CFCbihOO36HUn42vjr00fU=
|
||||
github.com/kettek/goro v0.0.0-20190713011743-4bf747a201fb h1:hAdYCvPQsrVw7LPBJpt4xdrfHs1eamu7dsL83ZaKM6w=
|
||||
github.com/kettek/goro v0.0.0-20190713011743-4bf747a201fb/go.mod h1:fO57DVF4MXRm+AOQWrFN0CFCbihOO36HUn42vjr00fU=
|
||||
github.com/kettek/goro v0.0.0-20190713012210-db6dc3381a1e h1:8UPf9Di15NxRSHdPi0ZbwAcf2c96vzwrAi3F30KO76g=
|
||||
github.com/kettek/goro v0.0.0-20190713012210-db6dc3381a1e/go.mod h1:fO57DVF4MXRm+AOQWrFN0CFCbihOO36HUn42vjr00fU=
|
||||
github.com/kettek/goro v0.0.0-20190713012409-1029522674ba h1:HFhcgGAbvE1IhToLKr6IDfI7B2isbYY2yzB6rxV/mwQ=
|
||||
github.com/kettek/goro v0.0.0-20190713012409-1029522674ba/go.mod h1:fO57DVF4MXRm+AOQWrFN0CFCbihOO36HUn42vjr00fU=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
|
|
12
main.go
12
main.go
|
@ -11,20 +11,20 @@ import (
|
|||
|
||||
func main() {
|
||||
// Initialize goro!
|
||||
if err := goro.InitTCell(); err != nil {
|
||||
if err := goro.InitEbiten(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
goro.Run(func(screen *goro.Screen) {
|
||||
// Screen configuration.
|
||||
screen.SetTitle("Steel Lord")
|
||||
screen.SetSize(80, 24)
|
||||
screen.SetSize(80, 40)
|
||||
|
||||
// Our initial variables.
|
||||
mapWidth, mapHeight := 80, 24
|
||||
mapWidth, mapHeight := 80, 40
|
||||
|
||||
colors := map[string]goro.Color{
|
||||
"darkWall": goro.ColorRed,
|
||||
"darkGround": goro.ColorBlue,
|
||||
"darkWall": goro.ColorGray,
|
||||
"darkGround": goro.ColorGreen,
|
||||
}
|
||||
|
||||
gameMap := mapping.GameMap{
|
||||
|
@ -36,7 +36,7 @@ func main() {
|
|||
|
||||
gameMap.MakeMap()
|
||||
|
||||
player := entity.NewEntity(screen.Columns/2, screen.Rows/2, '@', goro.Style{Foreground: goro.ColorWhite})
|
||||
player := entity.NewEntity(screen.Columns/2, screen.Rows/2+5, '@', goro.Style{Foreground: goro.ColorWhite})
|
||||
npc := entity.NewEntity(screen.Columns/2-5, screen. Rows/2, '@', goro.Style{Foreground: goro.ColorYellow})
|
||||
|
||||
entities := []*entity.Entity{
|
||||
|
|
Loading…
Reference in New Issue
Block a user