v0.7.5: fixed layout issues and crashes with diamond goo rooms

This commit is contained in:
Evan Debenham 2019-09-21 17:08:03 -04:00
parent 15d1edff8c
commit 8e4e8f495c

View File

@ -33,7 +33,9 @@ public class DiamondGooRoom extends GooBossRoom {
public void paint(Level level) {
Painter.fill( level, this, Terrain.WALL );
int diamondWidth = 2 + width()%2;
//we want the end width to be width()-2, and the width will grow by a total of (height()-4 - height()%2)
int diamondWidth = width()-2 - (height()-4 - height()%2);
for (int i = 1; i < height(); i++){
Painter.fill( level, left + (width() - diamondWidth)/2, top+i, diamondWidth, height()-2*i, Terrain.EMPTY);
diamondWidth += 2;