This commit is contained in:
tkarrass 2016-02-06 23:16:13 +01:00
parent 602949f1eb
commit f29cb4f8db
2 changed files with 21 additions and 13 deletions

View File

@ -1,6 +1,8 @@
package cmd // code.bitsetter.de/fun/gosl/cmd
import (
"bytes"
"encoding/gob"
"encoding/json"
"fmt"
"github.com/spf13/cobra"
@ -38,6 +40,7 @@ type LayerManifest struct {
D directionType `json:"Direction"`
S int `json:"Speed"`
T string `json:"Transparent"`
Repeat bool
Frames map[int]([][]rune)
}
@ -118,7 +121,10 @@ func compile(cmd *cobra.Command, args []string) {
}
}
}
obuf := &bytes.Buffer{}
enc := gob.NewEncoder(obuf)
enc.Encode(&lvlMan)
ioutil.WriteFile(levelFile, obuf.Bytes(), 0644)
}
func init() {

View File

@ -2,17 +2,19 @@
"Name": "The locomotive!",
"FPS": 10,
"Layers" : {
"locomotive": {
"Z-Index": 0,
"Direction": 6,
"Speed": 2,
"Transparent": "•"
},
"background": {
"Z-Index": 1,
"Direction": 6,
"Speed": 1,
"Transparent": "•"
}
"locomotive": {
"Z-Index": 0,
"Direction": 6,
"Speed": 2,
"Repeat": false,
"Transparent": "•"
},
"background": {
"Z-Index": 1,
"Direction": 6,
"Speed": 1,
"Repeat": true,
"Transparent": "•"
}
}
}