void addMob(int t,float x,float y);
void addMob(int t,float x,float y,void (*hey)());
void addNPC(float x,float y);
-- void addObject(int, float, float);
+ void addObject(int, bool, char*, float, float);
-
-
- //void removeObjet(Object);
void update(Player *p,unsigned int delta);
}
#endif
-typedef enum {
- SUNNY = 0,
- DARK,
- RAIN
-} WEATHER;
-
-#define DAY_CYCLE 3000
-
-static WEATHER weather = SUNNY;
-static vec2 star[100];
-static unsigned char fadeIntensity = 0;
-
+extern WEATHER weather;
++static unsigned int fadeIntensity = 0;
/*******************************************************************************
* MAIN ************************************************************************
Mix_VolumeMusic(15); // Set the volume
Mix_PlayMusic( music, -1 ); // Play music forever
--
-- /*
-- * Load a temporary background image.
-- */
-
- /*bgDay =Texture::loadTexture("assets/bg.png" );
- bgNight =Texture::loadTexture("assets/bgn.png" );
- bgMtn =Texture::loadTexture("assets/bgFarMountain.png" );
- bgTreesFront =Texture::loadTexture("assets/bgFrontTreeTile.png" );
- bgTreesMid =Texture::loadTexture("assets/bgMidTreeTile.png" );
- bgTreesFar =Texture::loadTexture("assets/bgFarTreeTile.png" );*/
--
- bgDay =Texture::loadTexture("assets/bg.png" );
- bgNight =Texture::loadTexture("assets/bgn.png" );
- bgMtn =Texture::loadTexture("assets/bgFarMountain.png");
- bgTreesFront =Texture::loadTexture("assets/bgFrontTree.png" );
- bgTreesMid =Texture::loadTexture("assets/bgMidTree.png" );
- bgTreesFar =Texture::loadTexture("assets/bgFarTree.png" );
- invUI =Texture::loadTexture("assets/invUI.png" );
+
/*
* Load sprites used in the inventory menu. See src/inventory.cpp
*/
++
++ invUI = Texture::loadTexture("assets/invUI.png" );
- std::cout << "Before invSprites\n";
++ //std::cout << "Before invSprites\n";
initInventorySprites();
- std::cout << "After invSprites\n";
-
- /*
- * Generate coordinates for stars that are drawn at night.
- */
-
- unsigned int i;
- for(i=0;i<100;i++){
- star[i].x=getRand()%currentWorld->getTheWidth()-currentWorld->getTheWidth()/2;
- star[i].y=getRand()%SCREEN_HEIGHT+100;
- }
++ //std::cout << "After invSprites\n";
/**************************
**** GAMELOOP ****
test->addMob(MS_RABBIT,200,100);
test->addMob(MS_BIRD,-500,500);
-
- test->addObject(2, 500,200);
- currentWorld->addObject(SWORD_WOOD, 500,200);
++ currentWorld->addObject(SWORD_WOOD, false, NULL, 500,200);
+ currentWorld->addObject(FLASHLIGHT, true, "This looks important, do you want to pick it up?",600,200);
/*
* Link all the entities that were just created to the initial world, and setup a test AI function.
*/
entity.push_back(npc.back());
}
--void World::addObject(int i, float x, float y){
-- object.push_back(new Object(i));
- object.back()->spawn(x,y);
-
- entity.push_back(object.back());
-}
-
+ void World::addObject(int i, bool q, char *p, float x, float y){
+ object.push_back(new Object(i,q, p));
object.back()->spawn(x,y);
entity.push_back(object.back());