/* Check if at squirted ladder up entry. */ uint8_t checkSpriteAtSquirtedLadderEntryUp(uint8_t slot) { /* Fail if not at exact tile coordinate. */ if (getSpriteX(slot) & 0x07) return 0; /* On an exact tile coordinate. Check ladder. */ if (getSpriteLadderTile(slot) == TILES0_LADDER_SQUIRTED_RIGHT) /* On ladder up entry. */ return 1; /* Not on a ladder up entry. */ return 0; }
/* Check if at ladder up entry. */ uint8_t checkSpriteAtLadderEntryUp(uint8_t slot) { /* Fail if not at exact tile coordinate. */ if (getSpriteX(slot) & 0x07) return 0; /* On an exact tile coordinate. Check ladder. */ switch (getSpriteLadderTile(slot)) { case TILES0_LADDER_RIGHT: case TILES0_LADDER_CLEANED_RIGHT: case TILES0_LADDER_TOP_RIGHT: case TILES0_LADDER_TOP_FLOOREND_RIGHT: /* On ladder up entry. */ return 1; default: /* Not on a ladder up entry. */ return 0; } }
/* Check if at ladder down entry. */ uint8_t checkSpriteAtLadderEntryDown(uint8_t slot) { /* Fail if not at exact tile coordinate. */ if (getSpriteX(slot) & 0x07) return 0; /* On an exact tile coordinate. Check floor. */ switch (getSpriteFloorTile(slot)) { case TILES0_LADDER_TOP_LEFT: case TILES0_LADDER_TOP_FLOOREND_LEFT: /* On ladder entry down if we are currently moving left. */ return ((GameSpriteSlots[slot].flags & SPRITE_FLAGS_DIRECTION_MASK) == SPRITE_FLAGS_DIRECTION_LEFT); case TILES0_LADDER_TOP_RIGHT: case TILES0_LADDER_TOP_FLOOREND_RIGHT: /* On ladder entry down if we are currently moving right. */ return ((GameSpriteSlots[slot].flags & SPRITE_FLAGS_DIRECTION_MASK) == SPRITE_FLAGS_DIRECTION_RIGHT); default: /* Not at a ladder down entry. */ return 0; } }
void LevelMenu::createLabel(){ label_ = LabelTTF::create(levelName_, "fonts/Mistral.ttf", 50); label_->setColor(Color3B(210, 160, 30)); label_->setPosition(Point(getSpriteX()+10,getSpriteY()-10)); }
PRectangle* LevelMenu::getRect(){ return new PRectangle(getSpriteX(), getSpriteY(), 80, 80); }