Allow flipping levels horizontally or vertically
When a special level is created, there's a chance it gets flipped horizontally and/or vertically. Add new level flags "noflip", "noflipx", and "noflipy" to prevent flipping the level. Add a wiz-mode command #wizlevelflip to test the flipping on current level - although this doesn't flip everything, as level flipping is meant to happen during level creation.
This commit is contained in:
26
src/worm.c
26
src/worm.c
@@ -921,4 +921,30 @@ int x, y;
|
||||
return res;
|
||||
}
|
||||
|
||||
void
|
||||
flip_worm_segs_vertical(worm, miny, maxy)
|
||||
struct monst *worm;
|
||||
int miny, maxy;
|
||||
{
|
||||
struct wseg *curr = wtails[worm->wormno];
|
||||
|
||||
while (curr) {
|
||||
curr->wy = (maxy - curr->wy + miny);
|
||||
curr = curr->nseg;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
flip_worm_segs_horizontal(worm, minx, maxx)
|
||||
struct monst *worm;
|
||||
int minx, maxx;
|
||||
{
|
||||
struct wseg *curr = wtails[worm->wormno];
|
||||
|
||||
while (curr) {
|
||||
curr->wx = (maxx - curr->wx + minx);
|
||||
curr = curr->nseg;
|
||||
}
|
||||
}
|
||||
|
||||
/*worm.c*/
|
||||
|
||||
Reference in New Issue
Block a user