Fix layer 0 bug

This commit is contained in:
tkarrass 2016-02-08 23:30:20 +01:00
parent 5a5457ebde
commit 642c76daea
3 changed files with 16 additions and 2 deletions

View File

@ -69,7 +69,7 @@ func (lvl *Level) Height() int {
for _, l := range lvl.Layers { for _, l := range lvl.Layers {
for _, f := range l.Frames { for _, f := range l.Frames {
if (len(f) + l.V) > max { if (len(f) + l.V) > max {
max = len(f) max = len(f) + l.V
} }
} }
} }
@ -164,8 +164,10 @@ func (lvl *Level) GetFrame(o, w, maxW, frameNo int) (ret *Frame) {
lW := layer.Width() lW := layer.Width()
if !layer.Repeat { if !layer.Repeat {
lW += maxW lW += maxW
if layer.D != 0 {
off += maxW off += maxW
} }
}
for off < 0 { for off < 0 {
off += lW off += lW

View File

@ -31,6 +31,14 @@
"Speed": 2, "Speed": 2,
"Repeat": true, "Repeat": true,
"Transparent": " " "Transparent": " "
},
"overlay": {
"Z-Index": 10,
"Direction": 0,
"Speed": 0,
"Repeat": false,
"V-Offset": 25,
"Transparent" : " "
} }
} }
} }

View File

@ -0,0 +1,4 @@
.___________________.
| |
| gosl demo lvl |
|_________________|