//---------------------------------------- // Methods //---------------------------------------- void StateStory::init() { m_bmpBackground.loadBackground("images/Story.png"); m_bmpBackground.disableTransparentColour(); m_bmpBackground.setPosition(Vector2di(0, 0)); m_IsEnd = false; m_Counter = 64; }
//----------------------------- // Constructor & Destructor //----------------------------- StateDarkTreasure::StateDarkTreasure() { m_Engine = new Raycast(); m_Engine->init(32, 32, 480, 320); m_Engine->loadTexture("images/DarkTreasure/Textures/1.png"); m_Engine->loadTexture("images/DarkTreasure/Textures/2.png"); m_Border.loadBackground("images/DarkTreasure/Border.png"); m_Border.setUseHardware(true); m_Border.setTransparentColour(MAGENTA); m_Border.setPosition(Vector2di(0,0)); m_Music.loadMusic("music/Arena/Music.ogg"); m_Music.setLooping(true); //m_Music.play(); }
//---------------------------------------- // Methods //---------------------------------------- void StateTitle::init() { SOUNDSYSTEM->init(); m_CurrentScreen = 0; m_Counter = 0; m_bmpBackgroundArr[0].loadBackground("images/Astolat.png"); m_bmpBackgroundArr[1].loadBackground("images/Penjin.png"); m_bmpBackgroundArr[2].loadBackground("images/Title_Background.png"); m_bmpTitle.loadSprite("images/Title_Logo.png"); m_bmpTitle.setPosition(0, 0); m_bmpPressStart.loadSprite("images/Title_PressStart.png"); m_bmpPressStart.setAlpha(0); m_bmpPressStart.setPosition(320, 368); m_IsEnd = false; m_FadeDir = 5; for(int i = 0; i < 3; i += 1) { m_bmpBackgroundArr[i].disableTransparentColour(); m_bmpBackgroundArr[i].setPosition(Vector2di(0, 0)); } m_mscAmbient.loadMusic("sounds/Rain.ogg"); m_mscAmbient.setLooping(true); m_mscAmbient.play(); m_mscAmbient.setVolume(20); m_mscTitle.loadSound("music/Title.ogg"); m_mscTitle.setLoops(-1); m_rctThunder.setColour(WHITE); m_rctThunder.setPosition(0, 0); m_rctThunder.setDimensions(800, 480); m_rctThunder.setAlpha(0); m_ThunderAlpha = 0; EFFECTSYSTEM->fadeIn(8); }
void StateCredits::unlimitedUpdate() { // camSprite.update(); if((unsigned int)timer.getScaledTicks() >= 120250/NumberUtility::getSize(CREDITS)) { // Get the latest credit line from the file by increasing currentLine if(currentLine < NumberUtility::getSize(CREDITS)-1) { ++currentLine; string ext = ".png"; string path = "images/"; logo.setAlpha(255); if(strstr(CREDITS[currentLine].c_str(), "PandoraPanic")) { logo.clear(); logo.loadSprite(path+"menu/pp_logo_small"+ext); } else if(strstr(CREDITS[currentLine].c_str(), "Penjin")) { logo.clear(); logo.loadSprite(path+"penjin"+ext); } else if(strstr(CREDITS[currentLine].c_str(), "pirate-games") || strstr(CREDITS[currentLine].c_str(), "Pirate Games")) { logo.clear(); logo.loadSprite(path+"pirategames"+ext); } else if(strstr(CREDITS[currentLine].c_str(), "GP32X")) { logo.clear(); logo.loadSprite(path+"gp32x.gif"); } else if(strstr(CREDITS[currentLine].c_str(), "GUI")) { logo.clear(); logo.loadSprite(path+"pp_start"+ext); } else if(strstr(CREDITS[currentLine].c_str(), "Losing")) { logo.clear(); logo.loadSprite(path+"pp_fail"+ext); } else if(strstr(CREDITS[currentLine].c_str(), "Winning")) { logo.clear(); logo.loadSprite(path+"pp_win"+ext); } else if(strstr(CREDITS[currentLine].c_str(), "Invaders")) { logo.clear(); logo.loadSprite(path+"SpaceInvaders/alien"+ext); } else if(strstr(CREDITS[currentLine].c_str(), "Spelling")) { logo.clear(); logo.loadSprite(path+"SpellingContest/girl_stand"+ext); } else if(strstr(CREDITS[currentLine].c_str(), "BadVista")) { logo.clear(); logo.loadSprite(path+"BadVista/bvLogo"+ext); } else if(strstr(CREDITS[currentLine].c_str(), "Panic Attack")) { logo.clear(); logo.loadSprite(path+"PanicAttack/bigRedX"+ext); logo.setTransparentColour(Vector2di(60,30)); } else if(strstr(CREDITS[currentLine].c_str(), "Wrestler")) { logo.clear(); logo.loadSprite(path+"MadWrestlerPunch/kick"+ext); //logo.setTransparentColour(WHITE); } else if(strstr(CREDITS[currentLine].c_str(), "Pong")) { logo.clear(); logo.loadSprite(path+"Pong/ball"+ext); logo.setTransparentColour(BLACK); } else if(strstr(CREDITS[currentLine].c_str(), "Pang")) { logo.clear(); logo.loadSprite(path+"Pang/player"+ext); //logo.setTransparentColour(BLACK); } /*else if(strstr(CREDITS[currentLine].c_str(), "DoubleNub")) { logo.clear(); logo.loadSprite(path+"DoubleNubTrouble/target"+ext); logo.setTransparentColour(MAGENTA); }*/ else if(strstr(CREDITS[currentLine].c_str(), "joust - Dragons_Slayer")) { logo.clear(); logo.loadSprite(path+"PanJoust/heroframe"+ext); //logo.setTransparentColour(MAGENTA); } else if(strstr(CREDITS[currentLine].c_str(), "PanJoust")) { logo.clear(); logo.loadSprite(path+"PanJoust/birdrider"+ext); } else if(strstr(CREDITS[currentLine].c_str(), "Distracted Maths")) { logo.clear(); logo.loadSprite(path+"DistractedMaths/4"+ext); //logo.setTransparentColour(Vector2di(0,0)); } else if(strstr(CREDITS[currentLine].c_str(), "Reflex")) { logo.clear(); logo.loadSprite(path+"Reflex/circle"+ext); } else if(strstr(CREDITS[currentLine].c_str(), "SDL")) { logo.clear(); logo.loadSprite(path+"sdl.gif"); logo.disableTransparentColour(); } else if(strstr(CREDITS[currentLine].c_str(), "Rocket")) { logo.clear(); logo.loadSprite(path+"RocketEscape/rocket"+ext); } else if(strstr(CREDITS[currentLine].c_str(), "Niqk")) { logo.clear(); logo.loadSprite(path+"Jumper/robot"+ext); //logo.setTransparentColour(MAGENTA); } else if(strstr(CREDITS[currentLine].c_str(), "Jumper - MarkoeZ")) { logo.clear(); logo.loadSprite(path+"Jumper/blobevil"+ext); //logo.setTransparentColour(MAGENTA); } else if(strstr(CREDITS[currentLine].c_str(), "Maze")) { logo.clear(); logo.loadSprite(path+"Maze/hero"+ext); //logo.setTransparentColour(MAGENTA); } else if(strstr(CREDITS[currentLine].c_str(), "Plander - Poke")) { logo.clear(); logo.loadSprite(path+"RocketEscape/platform"+ext); //logo.setUseHardware(false); } else if(CREDITS[currentLine].find("Rotating Turret") != string::npos) { logo.clear(); logo.loadSprite(path+"RotDef/bomb"+ext); } else if(CREDITS[currentLine].find("Memory Blocks") != string::npos) { logo.clear(); logo.loadSprite(path+"MemoryBlocks/purple_block"+ext); } else if(strstr(CREDITS[currentLine].c_str(), "PuttPutt")) { logo.clear(); logo.loadSprite(path+"PuttPutt/Ball"+ext); //logo.setTransparentColour(MAGENTA); } else if(strstr(CREDITS[currentLine].c_str(), "Birthday")) { logo.clear(); logo.loadSprite(path+"BirthdayCake/candles"+ext); //logo.setTransparentColour(MAGENTA); } else if(strstr(CREDITS[currentLine].c_str(), "Arena")) { logo.clear(); logo.loadSprite(path+"Arena/Hero/HeroStandingDown"+ext); //logo.setTransparentColour(MAGENTA); } else if(strstr(CREDITS[currentLine].c_str(), "Beer")) { logo.clear(); logo.loadSprite(path+"SnatchABeer/beer"+ext); //logo.setTransparentColour(MAGENTA); } else if(CREDITS[currentLine].find("Test Your Sight") != string::npos) { logo.clear(); logo.loadSprite(path+"TestYourSight/coin"+ext); } else if(CREDITS[currentLine].find("Pickle - debug") != string::npos) { logo.clear(); logo.loadSprite(path+"Fire/pickle"+ext); } else if(strstr(CREDITS[currentLine].c_str(), "Count")) { logo.clear(); logo.loadSprite(path+"TheCountJob/circle_g"+ext); //logo.setTransparentColour(MAGENTA); } else if(strstr(CREDITS[currentLine].c_str(), "Fire")) { logo.clear(); logo.loadSprite(path+"Fire/fire"+ext); //logo.setTransparentColour(MAGENTA); } else if(strstr(CREDITS[currentLine].c_str(), "Bandit")) { logo.clear(); logo.loadSprite(path+"OneButtonBandit/diamond"+ext); //logo.setTransparentColour(Vector2di(0,0)); } else if(strstr(CREDITS[currentLine].c_str(), "Mariela")) { logo.clear(); logo.loadSprite(path+"OneButtonBandit/heart"+ext); //logo.setTransparentColour(Vector2di(0,0)); } else if(strstr(CREDITS[currentLine].c_str(), "OpenPandora")) { logo.clear(); logo.loadSprite(path+"pandora"+ext); //logo.setTransparentColour(MAGENTA); } else logo.setAlpha(0); logo.setPosition((GFX::getXResolution() - logo.getWidth())*0.5f,GFX::getYResolution() * 0.66f); } else setNextState(STATE_TITLE); // Check if it is the last credit item and begin to fade the music. if(currentLine == NumberUtility::getSize(CREDITS)-1) { music.fade(120250/NumberUtility::getSize(CREDITS)); } timer.start(); } }
void StateCredits::init() { // We will use this to progress the current credit line. currentLine = 0; // Setup timer for credits scrolling timer.start(); timer.setMode(MILLI_SECONDS); // Setup randomNumbers for colours Random::setLimits(0,255); // Load music string dir = "music/"; music.loadMusic(dir+"credits.ogg"); music.setLooping(false); music.play(); // Load sprites dir = "images/"; string ext = ".png"; logo.loadSprite(dir+"menu/pp_logo_small"+ext); //logo.setAlpha(0); pand.loadFrames(dir+"pandora"+ext,4,1); pand.setTransparentColour(Vector2di(0,0)); SDL_Rect bounds; bounds.x = bounds.y = 0; bounds.w = GFX::getXResolution(); bounds.h = GFX::getYResolution(); pandStartPos = Vector2di((bounds.w - 196) *0.5f,bounds.h * 0.1f); initPandora(pandStartPos); logo.setPosition((bounds.w - logo.getWidth()) *0.5f,bounds.h * 0.66f); // Setup SDL Text Handler text.loadFont("font/foo.ttf", 24); text.setRelativity(false); // We will control all positions of text manually text.setBoundaries(bounds); text.setAlignment(TextClass::CENTRED); text.setPosition(0,bounds.h*0.5f); text.setColour(Colour(WHITE)); /* emit.resize(3); emit[0].setMax(800); emit[0].setInvisible(750); emit[0].setLooping(true); emit[0].setPosition(Vector2df(bounds.w*0.5f,bounds.h-1.0f)); emit[0].setMaxVelocity(Vector2df(2.3f,5.9f)); emit[0].setColour(WHITE); emit[0].setDeviation(1.2f); emit[0].setAcceleration(Vector2df(0.0f,-0.0009f)); emit[0].setGravity(0.001f); emit[0].setBoundaries(bounds); emit[1].setMax(500); emit[1].setLifeTime(805); emit[1].setLooping(false); emit[1].setPosition(Vector2df(160,120)); emit[1].setMaxVelocity(Vector2df(4.5f,4.5f)); emit[1].setColour(Colour(ORANGE)); emit[1].shouldFadeColour(true); emit[1].setDeviation(2.6f); emit[1].setGravity(Vector2df(0.0f,0.001f)); emit[1].setBoundaries(bounds); emit[2].setMax(500); emit[2].setLifeTime(800); emit[2].setLooping(false); emit[2].setPosition(Vector2df(140,90)); emit[2].setMaxVelocity(Vector2df(4.2f,4.2f)); emit[2].setColour(Colour(BLUE)); emit[2].shouldFadeColour(true); emit[2].setDeviation(2.5f); emit[2].setGravity(Vector2df(0.0f,0.001f)); emit[2].setBoundaries(bounds);*/ input->setDeadZone(Vector2di(4000,4000)); input->setScaler(0.000001f); GFX::setClearColour(BLACK); }