1 /**********************************************************************************
2 * Copyright (c) 2008, 2009 Derek Yu and Mossmouth, LLC
3 * Copyright (c) 2010, Moloch
4 * Copyright (c) 2018, Ketmar Dark
6 * This file is part of Spelunky.
8 * You can redistribute and/or modify Spelunky, including its source code, under
9 * the terms of the Spelunky User License.
11 * Spelunky is distributed in the hope that it will be entertaining and useful,
12 * but WITHOUT WARRANTY. Please see the Spelunky User License for more details.
14 * The Spelunky User License should be available in "Game Information", which
15 * can be found in the Resource Explorer, or as an external file called COPYING.
16 * If not, please obtain a new copy of Spelunky from <http://spelunkyworld.com/>
18 **********************************************************************************/
19 class MapBackTile : MapEntity;
21 transient BackTileImage bgt;
23 // tile coords in `bgt`
27 //WARNING! destroying back tile WILL BREAK A LIST
28 MapBackTile next; // in various lists
30 override int width () { return w; }
31 override int height () { return h; }
34 override void onLoaded () {
37 //writeln("BGT: ", bgtName);
38 bgt = level.bgtileStore[bgtName];
43 override void drawWithOfs (int xpos, int ypos, int scale, float currFrameDelta) {
44 if (w < 1 || h < 1 || scale < 1) return;
47 bgt.tex.blitExt(xpos, ypos, xpos+w*scale, ypos+h*scale, tx0, ty0, tx0+w, ty0+h);
52 objName = 'oBackTile';
53 objType = 'oBackTile';
54 depth = 10100; // > is further