Esempio n. 1
0
void endOfGame()
{
	SplashInit();
	SplashUpdate("continue");
	SplashRender();
	IwGxLightingOn();
	gameFinalRender();
	IwGxFlush();
	IwGxSwapBuffers();

	while(!s3eDeviceCheckQuitRequest())
	{
		int64 start = s3eTimerGetMs();
		while ((s3eTimerGetMs() - start) < MS_PER_FRAME)
        {
			
            int32 yield = (int32) (MS_PER_FRAME - (s3eTimerGetMs() - start));
            if (yield<0)
                break;
            s3eDeviceYield(yield);
        }
		if (g_Input.getTouchCount() != 0)
		{
			s3eResult g_result = s3eOSExecExecute("http://www.facebook.com/Baconbb10", true);
		}
	}
}
Esempio n. 2
0
/*
* Class:     java_awt_SplashScreen
* Method:    _update
* Signature: (J[IIIIII)V
*/
JNIEXPORT void JNICALL
Java_java_awt_SplashScreen__1update(JNIEnv * env, jclass thisClass, 
                                    jlong jsplash, jintArray data, 
                                    jint x, jint y, jint width, jint height, 
                                    jint stride)
{
    Splash *splash = (Splash *) jlong_to_ptr(jsplash);
    int dataSize;

    if (!splash) {
        return;
    }
    SplashLock(splash);
    dataSize = (*env)->GetArrayLength(env, data);
    if (splash->overlayData) {
        free(splash->overlayData);
    }
    splash->overlayData = malloc(dataSize * sizeof(rgbquad_t));
    if (splash->overlayData) {
        /* we need a copy anyway, so we'll be using GetIntArrayRegion */
        (*env)->GetIntArrayRegion(env, data, 0, dataSize, 
            (jint *) splash->overlayData);
        initFormat(&splash->overlayFormat, 0xFF0000, 0xFF00, 0xFF, 0xFF000000);
        initRect(&splash->overlayRect, x, y, width, height, 1, 
            stride * sizeof(rgbquad_t), splash->overlayData, 
            &splash->overlayFormat);
        SplashUpdate(splash);
    }
    SplashUnlock(splash);
}
Esempio n. 3
0
void gameOver()
{
	initMenu = false;
	if (g_Input.getSound())
		g_Input.stopSong();
	SplashInit();
	SplashUpdate("go");
	SplashRender();
	IwGxLightingOn();
	gameOverRender();
	IwGxFlush();
	IwGxSwapBuffers();

	while(!s3eDeviceCheckQuitRequest())
	{
		int64 start = s3eTimerGetMs();
		while ((s3eTimerGetMs() - start) < MS_PER_FRAME)
        {
			
            int32 yield = (int32) (MS_PER_FRAME - (s3eTimerGetMs() - start));
            if (yield<0)
                break;
            s3eDeviceYield(yield);
        }
		if (g_Input.getTouchCount() != 0)
		{
			int x = g_Input.getTouch(0)->x;
			int y = g_Input.getTouch(0)->y;

			if (x <= 380 && x >= 70 && y <= 730 && y >= 650)
			{
				g_Input.setCoins(0);
				g_Input.setLifes(5);
				corazon->setX(-400);
				for (int i=0; i<10; i++)
				{
					garras[i]->setX(-400);
				}
				maxiCoin->setX(-400);
				for (int j=0; j<20; j++)
				{
					miniCoins[j]->setX(-400);
				}
				for (int i=0; i<10; i++)
				{
					tnts[i]->setX(-400);
				}
				tank->setX(-600);
				chuletas->setX(-800);
				g_Input.part =1;
				g_Input.velAdvance = 10;
				chuletasStep = 2;
				tankStep = 2;
				g_Input.initTimer();
				g_Input.setTotalTime();
				g_Input.part = 1;
				g_Input.setVelocity(10000);
				//SplashShutDown();
				//SplashInit();
				if (g_Input.getSound())
				g_Input.playSong();
				SplashShutDown();
				break;
			}
			else if (x <= 1215 && x >= 650 && y <= 730 && y >= 650)
			{
				g_Input.setCoins(0);
				g_Input.setLifes(5);
				corazon->setX(-400);
				for (int i=0; i<10; i++)
				{
					garras[i]->setX(-400);
				}
				maxiCoin->setX(-400);
				for (int j=0; j<20; j++)
				{
					miniCoins[j]->setX(-400);
				}
				for (int i=0; i<10; i++)
				{
					tnts[i]->setX(-400);
				}
				tank->setX(-600);
				chuletas->setX(-800);
				g_Input.part =1;
				g_Input.velAdvance = 10;
				chuletasStep = 2;
				tankStep = 2;
				g_Input.initTimer();
				g_Input.setTotalTime();
				g_Input.part = 1;
				g_Input.setVelocity(10000);
				//------------------------------------------
				//------------------------------------------
				/*spriteManager->removeSprite(corazon);
				delete corazon;
				for (int i=0; i<15; i++)
				{
					spriteManager->removeSprite(garras[i]);
					delete garras[i];
					spriteManager->removeSprite(tnts[i]);
					delete tnts[i];
				}
				for (int i=0; i<25; i++)
				{
					spriteManager->removeSprite(miniCoins[i]);
					delete miniCoins[i];
				}
				delete tank;
				spriteManager->removeSprite(maxiCoin);
				delete maxiCoin;
				delete chuletas;*/
				menuB = true;
				SplashShutDown();
				break;
			}
		}
	}
}
Esempio n. 4
0
void menu()
{
	MenuInit();
	//MusicInit("./textures/musicOn.jpg");
	g_Input.gameOff();
	MenuRender();
	MusicRender();

	while(!g_Input.getGame())
	{
		int64 start = s3eTimerGetMs();
		while ((s3eTimerGetMs() - start) < MS_PER_FRAME)
        {
			
            int32 yield = (int32) (MS_PER_FRAME - (s3eTimerGetMs() - start));
            if (yield<0)
                break;
            s3eDeviceYield(yield);
        }
		if (g_Input.getTouchCount() != 0)
		{
			int x = g_Input.getTouch(0)->x;
			int y = g_Input.getTouch(0)->y;

			if (x <= 750 && x >= 500 && y <= 400 && y >= 200)
			{
				if (g_Input.getSound())
				{
					MusicShutDown();
					MusicInit("./textures/musicOf.jpg");
					MusicRender();
					g_Input.soundOff();
				}
				else
				{
					MusicShutDown();
					MusicInit("./textures/musicOn.jpg");
					MusicRender();
					g_Input.soundOn();
				}
			}

			if (x <= 1270 && x >= 500 && y <= 190 && y >= 10)
				g_Input.gameOn();
		}
	}
	//MusicShutDown();
	//MenuShutDown();
    IwGxSetColClear(0xff, 0xff, 0xff, 0xff);
    IwGxPrintSetColour(128, 128, 128);
	g_Input.initTimer();	
	g_Input.setTotalTime();
	g_Input.setPosInitY(g_Input.getAccelerometerY());
	
	SplashInit();
	SplashUpdate("loading");
	SplashRender();
	MenuShutDown();
	if (initMenu)
	{
		//Creating objects
		corazon = new corazones("corazones", 64, 64, -100, 1,2,false);
		for (int i=0; i<10; i++)
		{
			garras[i] = new claws("claws", 128, 128, -150,1,2,false);
		}
		maxiCoin = new Coin("./textures/monedas200pts.png", 128, 128, -150,1,2,false);
		for (int j=0; j<20; j++)
		{
			miniCoins[j] = new MiniCoin("coins", 64, 64, -100,1,2,true);
		}
		for (int i=0; i<10; i++)
		{
			tnts[i] = new Tnt("tnts", 128, 128, -150,1,2,false);
		}
		tank = new Tank();
		tank->Init("./textures/tank.png", 256, 256, -300,1,2,false);
		chuletas = new Chuletas();
		chuletas->Init("./textures/chuletas.png", 512, 512, -600,1,2,false);
	}
	SplashShutDown();
	//SplashInit();
	//SplashUpdate("go");
	ciclo();
}