//////////////////////////////////////////////////////////////////// //Set up environment, Base Ints, Consts, Floats, Bools, Vars, etc.// //////////////////////////////////////////////////////////////////// const int SFX_ERROR = 65; //In case you want an error SFX const int SFX_SUBWEAPON = 66; //In case you want an error int healsfx = 39; //Sound effect to play when Link is healed int errorsfx = 65; //Sound effect to play when Link's HP is full or MP is empty const int LW_MISC_TIMEOUT = 7; int nextLifeScore = 0; LivesGainedFromPoints = 0; bool IsSolid; bool PressR; bool InputR; bool InputL; bool PressL; //////////////////////////////////////////////////////////////// // Engine Constants. /////////////////////////////////////////// //////////////////////////////////////////////////////////////// // Combo Flag for soft platforms. const int CF_SOFT = 98; //// Block Types. // An empty block. const int BLOCK_EMPTY = 0; // A fallthrough block. const int BLOCK_SOFT = 1; // A standard block. const int BLOCK_HARD = 2; //// Stair combo types. const int CT_NEG = 142; const int CT_CROSS = 143; const int CT_POS = 144; //// Custom Engine Constants. // Link's walk speed. const float LINK_WALK = 1.5; // Link's gravitic acceleration. const float LINK_GRAV = 0.16; // Link's terminal velocity. const float LINK_TERM = 3.2; //////////////////////////////////////////////////////////////// //// Global Variables ////////////////////////////////////////// //////////////////////////////////////////////////////////////// //////////////// //// Link's State //// How to handle Link's movement. // We're letting the ZC engine handle movement. const int LINK_MODE_ENGINE = 0; // We're dealing with Link's movement ourselves. const int LINK_MODE_CUSTOM = 1; // We're moving link accourding to the stair system. const int LINK_MODE_STAIR = 2; // Link's current movement mode. int LinkMode = LINK_MODE_ENGINE; // Link's Location. This is so we can have fractional movement. float LinkX = 0; float LinkY = 0; // Link's Vertical Velocity. float LinkVy = 0; // What Link is standing on. int LinkBlock = BLOCK_HARD; // Link's jump speed. float LinkJump = -4; // Link's hop speed. float LinkHop = -1; //// Fake input since we're cancelling it. bool InputJump = false; bool PressJump = false; //// Various parts of Link's state from last frame. // Link's Position. float OldLinkX = 0; float OldLinkY = 0; int OldLinkAction = LA_NONE; //// Stair State. // On a down-left up-right stair. const int STAIR_NEG = -1; // Not on any stairs. const int STAIR_NONE = 0; // On an up-left down-right stair. const int STAIR_POS = 1; //// Stair Positioning - where we are on a stair. // We're in the middle of the stair. const int STAIR_MIDDLE = 0; // We're anchored to the side of a stair. const int STAIR_BOTTOM = 1; // We're anchored to a stair diagonally. const int STAIR_TOP = 2; // The current kind of stair that Link is standing on. int StairMode = STAIR_NONE; // If the stairs were mounted this frame. bool StairMount = false; // The combo position fo the stair that Link is anchored to. int StairLoc = -1; // Where we are on the stair. int StairPos = STAIR_MIDDLE; // The x position of the edge of the stairs. int StairEdgeX = -1; // The left edge of the stairs that Link is on. int StairLeft = 0; // The right edge of the stairs that Link is on. int StairRight = 0; // If the anchored stair has another above it. bool StairAbove = false; // If the anchored stair has another below it. bool StairBelow = false; // The y offset of the current stair. int StairY = 0; ///////////////////////////////// //// Screen Change ////////////// ///////////////////////////////// //// Screen State on the previous frame. // DMap from last frame. int OldDMap = -1; // DMap Screen from last frame. int OldDScreen = -1; // If the dmap has changed from the last frame. bool DMapChanged = false; // If the screen has changed from the last frame. bool ScreenChanged = false; // Used so that ScreenChanged is only set on the first frame // of a scrolling screen change. bool _ScreenChanged_ScrollFlag = false; // The ScreenChange FFC sets this so that maze screens can be used. bool _ScreenChanged_ForceFlag = false; // If the screen change has been handled by custom code. bool ScreenChangeHandled = true; // We're pretty sure that the screen change was caused by a warp of // some sort. const int SCREEN_CHANGE_WARP = -1; // Best guess for which direction we changed screens in // based on Link's current position. int ScreenChangeDir = SCREEN_CHANGE_WARP;