Fixed layer bound issue
This commit is contained in:
parent
937e824293
commit
6a342926b7
|
@ -168,7 +168,7 @@ func (lvl *Level) GetFrame(o, w, maxW, frameNo int) (ret *Frame) {
|
||||||
off += lW
|
off += lW
|
||||||
}
|
}
|
||||||
off %= lW
|
off %= lW
|
||||||
log.Println(lW, off, o, w, maxW, frameNo)
|
// log.Println(lW, off, o, w, maxW, frameNo)
|
||||||
if row < len(layer.Frames[f]) {
|
if row < len(layer.Frames[f]) {
|
||||||
r := layer.Frames[f][row][:]
|
r := layer.Frames[f][row][:]
|
||||||
for col := 0; col < w; col++ {
|
for col := 0; col < w; col++ {
|
||||||
|
@ -185,6 +185,12 @@ func (lvl *Level) GetFrame(o, w, maxW, frameNo int) (ret *Frame) {
|
||||||
//for col := 0
|
//for col := 0
|
||||||
//log.Println(len(layer.Frames[f][row]))
|
//log.Println(len(layer.Frames[f][row]))
|
||||||
//ret.Data[row] = append(ret.Data[row], (layer.Frames[f][row][off%w:])...)
|
//ret.Data[row] = append(ret.Data[row], (layer.Frames[f][row][off%w:])...)
|
||||||
|
} else {
|
||||||
|
if zli == 0 {
|
||||||
|
for col := 0; col < w; col++ {
|
||||||
|
ret.Data[row][col] = rune(' ')
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//}
|
//}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"FPS": 25,
|
"FPS": 25,
|
||||||
"Layers" : {
|
"Layers" : {
|
||||||
"locomotive": {
|
"locomotive": {
|
||||||
"Z-Index": 0,
|
"Z-Index": 2,
|
||||||
"Direction": 4,
|
"Direction": 4,
|
||||||
"Speed": 3,
|
"Speed": 3,
|
||||||
"Repeat": false,
|
"Repeat": false,
|
||||||
|
|
12
levels/locoworld/front/1.frame
Normal file
12
levels/locoworld/front/1.frame
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
* _o
|
||||||
|
| /
|
||||||
|
===v=================--=================-==============--======-===========-====
|
||||||
|
|
|
12
levels/locoworld/front/2.frame
Normal file
12
levels/locoworld/front/2.frame
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
O _x
|
||||||
|
| /
|
||||||
|
===v=================--=================-==============--======-===========-====
|
||||||
|
|
|
12
levels/locoworld/front/3.frame
Normal file
12
levels/locoworld/front/3.frame
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
o *
|
||||||
|
\ |
|
||||||
|
===v=================--=================-==============--======-===========-====
|
||||||
|
|
|
12
levels/locoworld/front/4.frame
Normal file
12
levels/locoworld/front/4.frame
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
X p
|
||||||
|
\ |
|
||||||
|
===v=================--=================-==============--======-===========-====
|
||||||
|
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
* _o
|
||||||
|
| /
|
||||||
=====================--=================-==============--======-===========-====
|
===v=================--=================-==============--======-===========-====
|
||||||
|
|
|
||||||
|
|
12
levels/locoworld/ground/2.frame
Normal file
12
levels/locoworld/ground/2.frame
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
O _x
|
||||||
|
| /
|
||||||
|
===v=================--=================-==============--======-===========-====
|
||||||
|
|
|
12
levels/locoworld/ground/3.frame
Normal file
12
levels/locoworld/ground/3.frame
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
o *
|
||||||
|
\ |
|
||||||
|
===v=================--=================-==============--======-===========-====
|
||||||
|
|
|
12
levels/locoworld/ground/4.frame
Normal file
12
levels/locoworld/ground/4.frame
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
X p
|
||||||
|
\ |
|
||||||
|
===v=================--=================-==============--======-===========-====
|
||||||
|
|
|
Loading…
Reference in New Issue
Block a user