Skip to content

Commit

Permalink
added documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
oschijns committed Feb 25, 2018
1 parent 640a635 commit 3c2cf91
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
# GoGo
Go game made in Go lang
Go game made in Go language

to build, run:
## Play
You can read the rules of Go on [wikipedia](https://en.wikipedia.org/wiki/Rules_of_Go).
Simply click on a position of the Goban to place a stone.
The banner at the bottom show which player can play.

There is no end game yet.

## Compiling
You'll need the library [Ebiten by hajimehoshi](https://github.com/hajimehoshi/ebiten) to compile it.
to build, execute:
```
go build board.go liberty.go main.go vector.go window.go
go build board.go liberty.go main.go vector.go window.go -o gogo
```

to run, run:
to run, execute:
```
go run board.go liberty.go main.go vector.go window.go
```

TODO:
game is playable (but ugly)
still need to provide better graphics (pixel perfect)
resizable window with adaptative board resizing
## Side notes
The program has only been tested on Linux until now.
If you have trouble compiling it on Windows, I cannot provide help, sorry.
14 changes: 6 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ package main
import "fmt"

func main() {
fmt.Println("GO-GO running...")
fmt.Println("GoGo running...")

// build a board of size 19x19
board := MakeBoard(19)
/*
for i := 0; i < 19; i+=2 {
for j := 0; j < 19; j+=2 {
st := Stone{Vec2{int8(i), int8(j)}, i%4 == j%4}
board.Place(st)
}} // */

// make a window with library Ebiten to play the game
var window Window
window.Init(&board)
window.Start(&board)

fmt.Println("GoGo stopped.")
}
5 changes: 1 addition & 4 deletions window.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package main

import (
//"fmt"
"log"
"image"
//"image/color"
_ "image/png"

"github.com/hajimehoshi/ebiten"
"github.com/hajimehoshi/ebiten/ebitenutil"
)
Expand Down Expand Up @@ -40,7 +37,7 @@ type Window struct {
var window * Window

// initialize the window and run the game
func (win * Window) Init(board * Board) {
func (win * Window) Start(board * Board) {

// get the images to display
var err error
Expand Down

0 comments on commit 3c2cf91

Please sign in to comment.