void PlayerBrowser::draw(){
	
	s8 i = 0;
	
	PA_SetBrightness(0, -31); // all black
	PA_SetBrightness(1, -31); // all black	
  	
	PA_ResetSpriteSys();
	PA_Init16cBg(1, 0);
	PA_Init16cBg(0, 0);
	PA_LoadTiledBg(1, 1, bgplayer1);  
	PA_LoadTiledBg(0, 1, bgplayer0);  
	PA_LoadSpritePal(0, 1, (void*)pbutton_Pal); 
	PA_KeyboardOut();

	PA_CreateSprite(0, TERM_SCREEN, (void*)term_Sprite, OBJ_SIZE_64X32, 1, 1, 0, 0);  
	PA_CreateSprite(0, PLAYERS_SCREEN, (void*)players_Sprite, OBJ_SIZE_64X32, 1, 1, 64, 0);  
	PA_CreateSprite(0, GAMES_SCREEN, (void*)games_Sprite, OBJ_SIZE_64X32, 1, 1, 128, 0);  
	PA_CreateSprite(0, OPTIONS_SCREEN, (void*)options_Sprite, OBJ_SIZE_64X32, 1, 1, 192, 0);  

	PA_SetSpriteAnim(0, 11, 1);
	
	for(i = -31; i < 0 ; i++){
		PA_SetBrightness(0, i); 
		PA_SetBrightness(1, i); 
		PA_WaitForVBL();		   
	}  	
	PA_16cText(0, 6, 85, 80, 95, "NAMEXXXXXX", 1, 1, 100);
	PA_16cText(0, 88, 85, 127, 95, "[12k*]", 1, 1, 100);
	PA_16cText(0, 128, 85, 136, 95, "X", 1, 1, 100);
	
	PA_16cText(0, 6, 95, 80, 115, "NAMEXXXXXX", 1, 1, 100);
	PA_16cText(0, 88, 95, 127, 115, "[12k*]", 1, 1, 100);
	PA_16cText(0, 128, 95, 136, 115, "X", 1, 1, 100);	 
}
Esempio n. 2
0
void initMinimap(int selStage) {
	PA_ResetBgSysScreen(SUB_SCREEN);

	if(selStage == FINALDESTINATION) {
		PA_EasyBgLoad(SUB_SCREEN, 3, finaldestinationminimap);
	}
	else if(selStage == POKEMONSTADIUM) {
		PA_EasyBgLoad(SUB_SCREEN, 3, pokemonstadiumminimap);
	}
//	else if(selStage == CORNERIA) {
//		PA_EasyBgLoad(SUB_SCREEN, 3, corneria);
//	}
//	else if(selStage == CASTLESIEGE) {
//		PA_EasyBgLoad(SUB_SCREEN, 3, castleseige);
//	}

	PA_LoadSpritePal(SUB_SCREEN, 1, (void*)charminis_Pal);
	for(int n = 0; n < (int)players.size(); n++) {
		PA_CreateSprite(SUB_SCREEN, n+1, (void*)charminis, OBJ_SIZE_16X16, COLOR256, 1, -16, -16);
		if(players[n] -> name == "kirby") PA_StartSpriteAnimEx(SUB_SCREEN, n+1, KIRBY, KIRBY, 1, ANIM_LOOP, -1);
		else if(players[n] -> name == "mewtwo") PA_StartSpriteAnimEx(SUB_SCREEN, n+1, MEWTWO, MEWTWO, 1, ANIM_LOOP, -1);
		else if(players[n] -> name == "mario") PA_StartSpriteAnimEx(SUB_SCREEN, n+1, MARIO, MARIO, 1, ANIM_LOOP, -1);
		else if(players[n] -> name == "ike") PA_StartSpriteAnimEx(SUB_SCREEN, n+1, IKE, IKE, 1, ANIM_LOOP, -1);
	}
	PA_LoadSpritePal(SUB_SCREEN, 0, (void*)visibleminimap_Pal);
	PA_CreateSprite(SUB_SCREEN, 0, (void*)visibleminimap_Sprite, OBJ_SIZE_64X64, COLOR256, 0, -64, -64);
	// loads the sprite icons for the minimap
} // initializes the minimap display on the sub screen
Esempio n. 3
0
int main(void){

	PA_Init();
	PA_InitVBL();
	
	PA_InitText(1,0); // On the top screen

	PA_LoadSpritePal(0, 0, (void*)sprite0_Pal);
	
	// This'll be the movable sprite...
	PA_CreateSprite(0, 0,(void*)circle_Sprite, OBJ_SIZE_32X32,1, 0, 16, 16); 	
	s32 x = 16; s32 y = 16; // Sprite's center position
	
	// This will be the fixed circle
	PA_CreateSprite(0, 1,(void*)circle_Sprite, OBJ_SIZE_32X32,1, 0, 128-16, 96-16); 
	
	while(1)
	{
		if (PA_MoveSprite(0)){
			x = PA_MovedSprite.X;
			y = PA_MovedSprite.Y;
		}
		
		// Collision ?
		if (PA_Distance(x, y, 128, 96) < 32*32) PA_OutputText(1, 2, 10, "Collision !!");
		else PA_OutputText(1, 2, 10, "            ");

		PA_WaitForVBL();
	}
	return 0;
}
Esempio n. 4
0
// Function: main()
int main(int argc, char ** argv)
{
	u8 i;
	
	PA_Init();    // Initializes PA_Lib
	PA_InitVBL(); // Initializes a standard VBL
	
	
	// Load 8bit palettes for sprites...
	PA_LoadSpritePal(0,0,(void*)ds_Pal);
	PA_LoadSpritePal(0,1,(void*)giz_Pal);
	PA_LoadSpritePal(0,2,(void*)gp_Pal);
	PA_LoadSpritePal(0,3,(void*)psp_Pal);
	
	// Create sprites
	PA_CreateSprite(0,0,(void*)ds_Sprite,OBJ_SIZE_64X64,1,0,PA_Rand()%192,PA_Rand()%128);
	PA_CreateSprite(0,1,(void*)giz_Sprite,OBJ_SIZE_64X64,1,1,PA_Rand()%192,PA_Rand()%128);
	PA_CreateSprite(0,2,(void*)gp_Sprite,OBJ_SIZE_64X64,1,2,PA_Rand()%192,PA_Rand()%128);
	PA_CreateSprite(0,3,(void*)psp_Sprite,OBJ_SIZE_64X64,1,3,PA_Rand()%192,PA_Rand()%128);
	
	//Set the main palette
	BG_PALETTE[0] = PA_RGB(27,27,27); 
	// Infinite loop to keep the program running
	while (1)
	{
		PA_WaitForVBL();

		for(i=0;i<4;i++) PA_MoveSprite(i);
		
	}
	
	return 0;
} // End of main()
Esempio n. 5
0
int get_nb_players() {
    int i, nb=0, ok=false;

    PA_CreateSprite(0, // Screen
			0, // Sprite number
			(void*)btn_2_players, // Sprite name
			OBJ_SIZE_64X32, // Sprite size
			1, // 256 color mode
			0, // Sprite palette number
			16, 80); // X and Y position on the screen
    PA_CreateSprite(0, 1, (void*)btn_3_players, OBJ_SIZE_64X32, 1, 0, 96, 80);
    PA_CreateSprite(0, 2, (void*)btn_4_players, OBJ_SIZE_64X32, 1, 0, 176, 80);

    PA_OutputText(0, 7, 0, "Nombre de joueurs");

    while (!ok) {
        for (i=0; i<3; i++) {
            if (PA_SpriteTouched(i)) {
                nb = i+2;
                ok = true;
            }
        }

        PA_WaitForVBL();
    }

    PA_DeleteSprite(0, 0);
    PA_DeleteSprite(0, 1);
    PA_DeleteSprite(0, 2);
    clear_screen(0);

    return nb;
}
Esempio n. 6
0
// Main function
int main(void)	{

	PA_Init();
	PA_InitVBL();
	
	PA_InitText(1, 0);
	
	PA_LoadSpritePal(0, 0, (void*)sprite0_Pal);	// Load the sprite palette
	
	// Load a few sprites...
	u8 i = 0; 
	for (i = 0; i < 16; i++) PA_CreateSprite(0, i,(void*)mollusk_Sprite, OBJ_SIZE_32X32,1, 0, i << 3, i << 3);
	
	
	PA_InitSpriteExtPrio(1); // Enable extended priorities
	
	
	PA_OutputSimpleText(1, 0, 10, "Please move the sprites to see how their priorities change");
	
	while(1)
	{	
		// Now we'll test every sprite to see if we touch it...
		for (i = 0; i < 16; i++) {
			PA_MoveSprite(i);  // move the sprites. 
			s16 y = PA_GetSpriteY(0, i);  if (y > 192) y-=256; // if higher than 0...
			PA_SetSpriteExtPrio(0, i, 192-y); // Top priority when at the bottom !
		}

	
		PA_WaitForVBL();	
	}
	return 0;
}
Esempio n. 7
0
File: main.c Progetto: hl1itj/Team2
void StartScreen() {
	PA_LoadBackground(UP_SCREEN, BACKGROUND_UP, &UPSTARTSCREEN);
	PA_LoadSpritePal(DOWN_SCREEN, START_NUM, (void*) START_Pal);
	PA_CreateSprite(DOWN_SCREEN, START_NUM, (void*) START_Sprite,
		OBJ_SIZE_64X32, 1, START_NUM, 96, 50);
	PA_StartSpriteAnim(DOWN_SCREEN, START_NUM, 0, 1, 2);
	while (1) {
		PA_WaitForVBL();
		if (Stylus.Newpress) {
			if (PA_SpriteTouched(START_NUM)) {
				PA_DeleteBg(UP_SCREEN, BACKGROUND_UP);
				PA_DeleteSprite(DOWN_SCREEN, START_NUM);
				PA_LoadBackground(UP_SCREEN, BACKGROUND_UP, &UPGAMESCREEN);
				PA_LoadBackground(DOWN_SCREEN, BACKGROUND_DOWN,
						&DOWNGAMESCREEN);
				break;
			}
		}
		if (Pad.Newpress.Start) {
			PA_DeleteBg(UP_SCREEN, BACKGROUND_UP);
			PA_DeleteSprite(DOWN_SCREEN, START_NUM);
			PA_LoadBackground(UP_SCREEN, BACKGROUND_UP, &UPGAMESCREEN);
			PA_LoadBackground(DOWN_SCREEN, BACKGROUND_DOWN, &DOWNGAMESCREEN);
			break;
		}
	}
	AS_SoundDefaultPlay((u8*)bgm, (u32)bgm_size, 127, 64, true, 0);
}
Esempio n. 8
0
//Fonction principale du code
int main(void){

	PA_Init(); //Initialision of PAlib
	PA_InitVBL();
	
	PA_InitText(0,0);
	
	PA_LoadSpritePal(0, // Screen
					0, // Palette number
					(void*)sprite0_Pal);	// Palette name
	
	//Create the sprite
	PA_CreateSprite(0, 0,(void*)vaisseau_Sprite, OBJ_SIZE_32X32,1, 0, 0, 0);
	
	
	while(1){ // Main loop
		
		// Update the position according to the keypad...
		x += Pad.Held.Right - Pad.Held.Left;
		y += Pad.Held.Down - Pad.Held.Up;
		
		// Set the sprite's position
		PA_SetSpriteXY(0, // screen
					   0, // sprite
					   x, // x position
					   y); // y...
		
		PA_WaitForVBL();
	}
	return 0;
}
Esempio n. 9
0
int main(void){

	PA_Init(); //PAlib inits
	PA_InitVBL();
	
	PA_InitText(1, 0);
	
	PA_OutputSimpleText(1, 2, 6, "BinFile example");
	
	PA_LoadSpritePal(0, // Screen
					0, // Palette number
					(void*)sprite0_Pal);	// Palette name
					
	PA_CreateSprite(0, // Screen
					0, // Sprite number
					(void*)vaisseau_Sprite, // Sprite name
					OBJ_SIZE_32X32, // Sprite size
					1, // 256 color mode
					0, // Sprite palette number
					50, 50); // X and Y position on the screen
				

	while (1) // Infinite loop
	{
		PA_WaitForVBL();
	}
	
return 0;
}
Esempio n. 10
0
File: main.c Progetto: hl1itj/Team8
/* 게임메인 */
int scr_Main() {
	/* 화면초기화  및 갱신 */
	UnLoad_Screen();
	PA_Init();
	PA_InitVBL();
	PA_LoadBackground(UP_SCREEN, BG1, &up_main); // 상단 디스플레이-타이틀화면 설정.
	PA_LoadBackground(DOWN_SCREEN, BG1, &down_main); // 하단 디스플레이-타이틀화면 설정.

	PA_LoadSpritePal(UP_SCREEN, BG2, (void*) GameName_Pal);
	PA_CreateSprite(UP_SCREEN, BG2, (void*) GameName_Sprite, OBJ_SIZE_64X32, 1,
			BG2, 74, 135);
	PA_StartSpriteAnim(UP_SCREEN, BG2, 0, 1, 1);

	PA_LoadSpritePal(DOWN_SCREEN, BG2, (void*) START_Pal);
	PA_CreateSprite(DOWN_SCREEN, BG2, (void*) START_Sprite, OBJ_SIZE_64X32, 1,
			BG2, 50, 100);

	PA_LoadSpritePal(DOWN_SCREEN, BG3, (void*) EXIT_Pal);
	PA_CreateSprite(DOWN_SCREEN, BG3, (void*) EXIT_Sprite, OBJ_SIZE_64X32, 1,
			BG3, 140, 100);

	if ( ismain==FALSE ) {
			AS_SoundDefaultPlay((u8*)start, (u32)start_size, 127, 64, TRUE, 0);
			ismain = TRUE;
		}

	while (1) {
		if (Stylus.Newpress) {
			if (PA_SpriteTouched(BG2)) {
				PA_DeleteBg(UP_SCREEN, BG1);
				PA_DeleteBg(DOWN_SCREEN, BG1);
				PA_DeleteSprite(DOWN_SCREEN, BG2);
				PA_DeleteSprite(DOWN_SCREEN, BG3);
				PA_DeleteSprite(UP_SCREEN, BG2);
				PA_LoadBackground(UP_SCREEN, BG1, &up);
				PA_LoadBackground(DOWN_SCREEN, BG1, &down);
				break;
			}
			if (PA_SpriteTouched(BG3)) {
				return GAMEEXIT;
			}
		}
		PA_WaitForVBL();
	}
	return 0;
}
Esempio n. 11
0
// Function: main()
int main(int argc, char ** argv){

	PA_Init();    // PA Init...
	PA_InitVBL();	// VBL Init...
	
	// Init the sound system
	AS_Init(AS_MODE_SURROUND | AS_MODE_16CH);
	AS_SetDefaultSettings(AS_PCM_8BIT, 11025, AS_SURROUND);
	
	PA_SetBgColor(0, PA_RGB(31, 31, 31)); // White background color

	// First, convert the gif to a sprite format...
	u8 *spritegfx = PA_GifToTiles((void*)Mollusk, // Gif file
											spritepal); // our palette
	
	// Next, load the sprite...
	PA_CreateSprite(0, 0, spritegfx, OBJ_SIZE_64X64, 1, 0, 64, 64);  // Just like plain sprites !
	PA_LoadSpritePal(0, 0, spritepal);  // Just like plain palettes !

	// spritegfx can be used over and over again to load other sprites... 
	// If you do not need it anymore, use free(spritegfx); to free the memory it uses !

	s32 spritex = -64;  // Sprite position
	s32 pan = 0;   // Audio panning
	
	PA_SetSpriteHflip(0, 0, 1); // Turn sprite around...	again...	
	
  while(1)  {  
  		int channel0 = PA_PlaySimpleSound(Zoom); // Play sound...

		for (spritex = -64; spritex < 256; spritex +=2){
			pan = spritex/2; 
			if (pan < 0) pan = 0; if (pan > 127) pan = 127; // Limit range...
			
			PA_SetSpriteX(0, 0, spritex);
			PA_SetSoundChannelPan(channel0, pan);
			PA_WaitForVBL();
		}
		
		PA_SetSpriteHflip(0, 0, 0); // Turn sprite around...
		
		int channel1 = PA_PlaySimpleSound(Zoom);
 
 		for (spritex = 256; spritex > -65; spritex -=2){
			pan = spritex/2; 
			if (pan < 0) pan = 0; if (pan > 127) pan = 127; // Limit range...
			
			PA_SetSpriteX(0, 0, spritex);
			PA_SetSoundChannelPan(channel1, pan);
			PA_WaitForVBL();
		} 
		
		PA_SetSpriteHflip(0, 0, 1); // Turn sprite around...	again...	
  
	}
		
	return 0;
} // End of main()
Esempio n. 12
0
//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
void sObject::create(int sprite_id)
{
  m_sprite_id = sprite_id;
  PA_CreateSprite(0, m_sprite_id, m_sprite, OBJ_SIZE_16X16, 1, m_palette_index, m_x-m_w, m_y-m_h);
  if(m_dead)
    begin_animation(1);
  else
    begin_animation(0);
}
Esempio n. 13
0
int main(void) {

    PA_Init();
    PA_InitVBL();

    PA_InitText(1,0); // On the top screen

    PA_DualLoadSpritePal(0, (void*)sprite0_Pal);

    // This'll be the movable sprite...
    PA_CreateSprite(0, 0,(void*)circle_Sprite, OBJ_SIZE_32X32,1, 0, 16, 16);
    s32 x = 16;
    s32 y = 16; // Sprite's center position

    // This will be the hit circle
    PA_DualCreateSprite(1,(void*)circle_Sprite, OBJ_SIZE_32X32,1, 0, 128-16, 96-16);
    puck.x = 128;
    puck.y = 96+192+SCREENHOLE; // central position on bottom screen
    puck.vx = 0;
    puck.vy = 0; // No speed


    while(1)
    {
        if (PA_MoveSprite(0)) {
            x = PA_MovedSprite.X;
            y = PA_MovedSprite.Y;
        }

        // Collision ?
        if (PA_Distance(x, y, puck.x, puck.y-192-SCREENHOLE) < 32*32) {
            // Collision, so we'l change the pucks speed to move it out of our 'raquette'
            u16 angle = PA_GetAngle(x, y, puck.x, puck.y-192-SCREENHOLE); // New direction angle
            u16 speed = (32*32-PA_Distance(x, y, puck.x, puck.y-192-SCREENHOLE))/32; // The closer they are, the harder the hit was...
            puck.vx = (PA_Cos(angle)*speed)>>8;
            puck.vy = -(PA_Sin(angle)*speed)>>8;
        }

        puck.x += puck.vx;
        puck.y += puck.vy;

        // If the sprite touches the left or right border, flip the horizontal speed
        if ((puck.x -16 <= 0) && (puck.vx < 0)) puck.vx = -puck.vx;
        else if ((puck.x + 16 >= 256)&&(puck.vx > 0)) puck.vx = - puck.vx;

        // Same thing, for top and bottom limits...
        if ((puck.y -16 <= 0) && (puck.vy < 0)) puck.vy = -puck.vy;
        else if ((puck.y + 16 >= 192 + 192 + SCREENHOLE)&& (puck.vy > 0)) puck.vy = - puck.vy;
        // The bottom limit is at the bottom of the bottom screen, so that would be 2 screen heights, plus the space in between...
        PA_DualSetSpriteXY(1, puck.x-16, puck.y-16);



        PA_WaitForVBL();
    }
Esempio n. 14
0
CDeck::CDeck(void) {
  PA_LoadSpritePal(1, PALETTE_NB_CARD, (void*)card_Pal);
  
  PA_CreateSprite(1, SPRITE_NB_BACKCARD_PART1, (void*)backcard_Sprite,
                  OBJ_SIZE_64X64, 1, PALETTE_NB_CARD, 67, 1);
  PA_CloneSprite(1, SPRITE_NB_BACKCARD_PART2, SPRITE_NB_BACKCARD_PART1);
  PA_SetSpriteVflip(1, SPRITE_NB_BACKCARD_PART2, 1);
  PA_SetSpriteXY(1, SPRITE_NB_BACKCARD_PART2, 67, 1+26);
  
  PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1, (void*)emptycard_Sprite,
                  OBJ_SIZE_64X64, 1, PALETTE_NB_CARD, 129, 1);
  PA_CloneSprite(1, SPRITE_NB_EMPTYCARD_PART2, SPRITE_NB_EMPTYCARD_PART1);
  PA_SetSpriteVflip(1, SPRITE_NB_EMPTYCARD_PART2, 1);
  PA_SetSpriteXY(1, SPRITE_NB_EMPTYCARD_PART2, 129, 1+26);
  
  PA_SetSpritePrio (1, SPRITE_NB_BACKCARD_PART1, 2);
  PA_SetSpritePrio (1, SPRITE_NB_BACKCARD_PART2, 2);
  PA_SetSpritePrio (1, SPRITE_NB_EMPTYCARD_PART1, 2);
  PA_SetSpritePrio (1, SPRITE_NB_EMPTYCARD_PART2, 2);
}
Esempio n. 15
0
File: main.c Progetto: hl1itj/Team8
/* 블락 보여주기*/
void view_block() {
	int i, j;
	int k = 0; // 스프라이트 넘버.
	for (i = 0; i < SIZE; i++) {
		for (j = 0; j < SIZE; j++) {
			PA_CreateSprite(DOWN_SCREEN, k, (void*) Block_Sprite,
					OBJ_SIZE_32X32, 1, BLOCKPAL, (40 * i) + 52, (40 * j) + 20);
			PA_SetSpriteAnim(DOWN_SCREEN, k, uinfo.userBlock[j][i]); // 블록배열의 값을 스프라이트에 반영.
			k++;
		}
	}
}
Esempio n. 16
0
File: main.c Progetto: hl1itj/Team8
/* 메인 화면 */
int scr_Main() {
	UnLoad_Screen();
	PA_Init();
	PA_InitVBL();
	PA_LoadBackground(UP_SCREEN, BG1, &up_main); 		// 상단 디스플레이-타이틀화면 설정.
	PA_LoadBackground(DOWN_SCREEN, BG1, &down_main);	// 하단 디스플레이-타이틀화면 설정.

	PA_LoadSpritePal(UP_SCREEN, BG2, (void*) GameName_Pal);	// 상단에 팔레트 생성
	PA_CreateSprite(UP_SCREEN, BG2, (void*) GameName_Sprite, OBJ_SIZE_64X32, 1,
			BG2, 74, 140);
	PA_StartSpriteAnim(UP_SCREEN, BG2, 0, 1, 1);// 애니메이션 동작 실행

	PA_LoadSpritePal(DOWN_SCREEN, BG2, (void*) START_Pal);// 하단에 START 팔레트 생성
	PA_CreateSprite(DOWN_SCREEN, BG2, (void*) START_Sprite, OBJ_SIZE_64X32, 1,
			BG2, 55, 103);

	PA_LoadSpritePal(DOWN_SCREEN, BG3, (void*) EXIT_Pal);// 하단에 EXIT 팔레트 생성
	PA_CreateSprite(DOWN_SCREEN, BG3, (void*) EXIT_Sprite, OBJ_SIZE_64X32, 1,
			BG3, 145, 103);

	AS_SoundDefaultPlay((u8*) start, (u32) start_size, 127, 64, TRUE, 0);//start 배경음 시작

	while (1) {
		if (Stylus.Newpress) {			// 화면이 눌렸을 때
			if (PA_SpriteTouched(BG2)) {// BG2의 sprite 가 눌렸을 때(START)
				UnLoad_Sound();
				UnLoad_Screen();
				AS_SoundDefaultPlay((u8*) clk, (u32) clk_size, 50, 64, FALSE,0);
				PA_LoadBackground(UP_SCREEN, BG1, &up);
				PA_LoadBackground(DOWN_SCREEN, BG1, &down);
				break; // 화면의 출력된 모든 파일들 정리 후 일반 게임 배경 출력 후 break
			}
			if (PA_SpriteTouched(BG3)) // BG3의 sprite 가 눌렸을 때(EXIT)
				return GAMEEXIT;
		}
		PA_WaitForVBL();
	}
	return 0;
}
Esempio n. 17
0
File: main.c Progetto: hl1itj/Team2
void fireCreate(mapTile map[][MAX_MAP_Y_LENGTH]){
	u8 x;
	u8 y;
	do{
		x = xTaskGetTickCount()%MAX_MAP_X_LENGTH;
		y = xTaskGetTickCount()%MAX_MAP_Y_LENGTH;
	}while(map[x][y].state!=MAP_STATE_NULL);
	map[x][y].state = MAP_STATE_WALL;
	PA_CreateSprite(DOWN_SCREEN, FIREINMAP + fireCount, (void*) fire_Sprite, OBJ_SIZE_16X16, TRUE,
		FIRE_PAL,  map[x][y].x, map[x][y].y);
	PA_StartSpriteAnim(DOWN_SCREEN, FIREINMAP + fireCount, 0, 5, 3);
	fireCount++;
}
Esempio n. 18
0
int main(void){

	PA_Init(); //PAlib inits
	PA_InitVBL();
	
	PA_LoadSpritePal(0, // Screen
					0, // Palette number
					(void*)sprite0_Pal);	// Palette name
					
	// We'll create 2 sprites
	PA_CreateSprite(0, 0, (void*)mollusk_Sprite, OBJ_SIZE_32X32, 1, 0, 0, 50); 
	PA_CreateSprite(0, 1, (void*)mollusk_Sprite, OBJ_SIZE_32X32, 1, 0, 64, 50); 

	PA_SetSpriteMode(0, // Screen
					0, // Sprite
					1); // Alphablending
	
	s16 alpha = 7; // Transparency level

	// Enable the alpha-blending
	PA_EnableSpecialFx(0, // Screen
						SFX_ALPHA, // Alpha blending mode
						0, // Nothing
						SFX_BG0 | SFX_BG1 | SFX_BG2 | SFX_BG3 | SFX_BD); // Everything normal


	while(1) // Infinite loops
	{
		alpha += Pad.Newpress.Up - Pad.Newpress.Down;
		PA_SetSFXAlpha(0, // Screen
						alpha, // Alpha level, 0-15
						15); // Leave this to 15
		
		PA_WaitForVBL();
	}
	
return 0;
}
Esempio n. 19
0
void SpecialBox::show()
{
	/// SpecialBox
	PA_CreateSprite(
	      mScreenNum // screen
		, mSpriteNum	// Sprite number (auto generated)
		, const_cast<unsigned char*>(mName)
		, OBJ_SIZE_64X32 // Sprite size
		, k256colors // 256 colormode
		, pallet_num() //Sprite palette number
		, mPoint.get_mX(), mPoint.get_mY());
		
	PA_SetSpriteAnim(mScreenNum, mSpriteNum, mFrame);
}
Esempio n. 20
0
void CheckBox::show()
{
	/// CheckBox
	PA_CreateSprite(
	      mScreenNum // screen
		, mSpriteNum	// Sprite number (auto generated)
		, (void*)CheckBox_Sprite // Sprite mName (changes based off of class being called from)
		, OBJ_SIZE_16X16 // Sprite size
		, k256colors // 256 colormode
		, pallet_num() //Sprite palette number
		, mPoint.get_mX(), mPoint.get_mY());
	
	/// title
	PA_CreateSprite(
		  mScreenNum
		, mTitleSpriteNum
		, const_cast<unsigned char*>(mName)
		, OBJ_SIZE_64X32
		, k256colors
		, titlepallet_num()
		, mPoint.get_mX()-70, mPoint.get_mY()-8);
		
	PA_SetSpriteAnim(mScreenNum, mSpriteNum, mFrame);
}
Esempio n. 21
0
File: main.c Progetto: hl1itj/Team2
void initMap(mapTile map[][MAX_MAP_Y_LENGTH]) {
	//int count=0;
	int i, j, wallCount=0;
	PA_LoadSpritePal(DOWN_SCREEN, FIRE_PAL, (void*) fire_Pal);
	for (i = 0; i < MAX_MAP_X_LENGTH; i++)
		for (j = 0; j < MAX_MAP_Y_LENGTH; j++) {
			map[i][j].x = i * BOX_X_SIZE;
			map[i][j].y = j * BOX_Y_SIZE;
			map[i][j].state = MAP_STATE_NULL;
			if (i == 0 || i == (MAX_MAP_X_LENGTH - 1) || j == 0
					|| j == (MAX_MAP_Y_LENGTH - 1)) {
				map[i][j].state = MAP_STATE_WALL;
				PA_CreateSprite(DOWN_SCREEN, FIRE + wallCount, (void*) fire_Sprite, OBJ_SIZE_16X16, TRUE,
						FIRE_PAL,  map[i][j].x, map[i][j].y);
				PA_StartSpriteAnim(DOWN_SCREEN, FIRE + wallCount, 0, 3, ((i+j)%6)+1);
				wallCount++;
			}
		}
}
Esempio n. 22
0
// Main function
int main(void)	{
	// PAlib init
	PA_Init();
	PA_InitVBL();
	
	PA_InitText(1, 0);

	PA_LoadSpritePal(0, 0, (void*)sprite0_Pal);	// Palette....	

	s32 x = 120; s32 y = 64;

	PA_CreateSprite(0, 0,(void*)som_Sprite, OBJ_SIZE_16X32,1, 0, x, y); // Sprite
	
	while(1)
	{
		// Animation code...
		if(Pad.Newpress.Up) PA_StartSpriteAnim(0, 0, 0, 3, 4);
		if(Pad.Newpress.Down) PA_StartSpriteAnim(0, 0, 8, 11, 4);		
		
		if(Pad.Newpress.Right) {
			PA_StartSpriteAnim(0, 0, 4, 7, 4);	
			PA_SetSpriteHflip(0, 0, 0);
		}
		if(Pad.Newpress.Left) {
			PA_StartSpriteAnim(0, 0, 4, 7, 4);	
			PA_SetSpriteHflip(0, 0, 1);
		}

		
		if(!((Pad.Held.Left)||(Pad.Held.Up)||(Pad.Held.Down)||(Pad.Held.Right))) PA_SpriteAnimPause(0, 0, 1);
	
	
		// Moving Code
		y += Pad.Held.Down - Pad.Held.Up;
		x += Pad.Held.Right - Pad.Held.Left;		
		PA_SetSpriteXY(0, 0, x, y);
	
		PA_WaitForVBL();
	}
	
	return 0;
}
Esempio n. 23
0
File: main.c Progetto: hl1itj/Team2
portTASK_FUNCTION(Item_Task, pvParameters ) {
		int i,j;
		u8 itemOnMap;
		portTickType xLastWakeTime = xTaskGetTickCount();
		portTickType rand;
		PA_LoadSpritePal(DOWN_SCREEN, ITEM_PAL, (void*)ITEM_Pal);

		while(1)
		{
			if(length<MAX_BODY_LENGTH)
			{
				int itemOnMap = FALSE;
				for(i=0; i<MAX_MAP_X_LENGTH; i++)
					for(j=0; j<MAX_MAP_Y_LENGTH; j++)
						if(map[i][j].state==MAP_STATE_ITEM)
							itemOnMap = TRUE;

				if(itemOnMap==FALSE)
				{
					u8 x;
					u8 y;
					do{
						x = xTaskGetTickCount()%MAX_MAP_X_LENGTH;
						y = xTaskGetTickCount()%MAX_MAP_Y_LENGTH;
					}while((map[x][y].state!=MAP_STATE_NULL)|| (x==1) || x==(MAX_MAP_X_LENGTH-2)
							|| (y==1) || y==(MAX_MAP_Y_LENGTH-2));

					map[x][y].state = MAP_STATE_ITEM;
					PA_CreateSprite(DOWN_SCREEN, ITEM,
						  (void*)ITEM_Sprite, OBJ_SIZE_32X16,
						  TRUE, ITEM_PAL, map[x][y].x-8, map[x][y].y);
					rand = xTaskGetTickCount();
					rand = (rand%2)*2; //0 or 2
					PA_StartSpriteAnim(DOWN_SCREEN, ITEM, rand, rand+1, 1);
					map[x][y].itemSpriteNum = ITEM;
				}
			}
			vTaskDelayUntil(&xLastWakeTime, MSEC2TICK(5555));
		}
}
Esempio n. 24
0
File: main.c Progetto: hl1itj/Team2
portTASK_FUNCTION(Screen_Task, pvParameters) {
	PA_LoadSpritePal(UP_SCREEN, UPSCR_BODY_PAL, (void*) man_Pal);
	PA_LoadSpritePal(UP_SCREEN, NUM_PAL, (void*) number_Pal);
	PA_LoadSpritePal(UP_SCREEN, WORD_PAL, (void*) word_Pal);

	PA_CreateSprite(UP_SCREEN, WORD, (void*) word_Sprite,
				        OBJ_SIZE_32X32, TRUE, WORD_PAL, 8, 22);
	PA_CreateSprite(UP_SCREEN, WORD+1, (void*) word_Sprite,
					        OBJ_SIZE_32X32, TRUE, WORD_PAL, 40, 22);
	PA_CreateSprite(UP_SCREEN, WORD+2, (void*) number_Sprite,
						        OBJ_SIZE_32X32, TRUE, NUM_PAL, 72, 22);
	PA_CreateSprite(UP_SCREEN, WORD+3, (void*) number_Sprite,
						        OBJ_SIZE_32X32, TRUE, NUM_PAL, 97, 22);

	PA_SetSpriteAnim (UP_SCREEN, WORD, 2);
	PA_SetSpriteAnim (UP_SCREEN, WORD+1, 3);
	PA_SetSpriteAnim (UP_SCREEN, WORD+2, MAX_BODY_LENGTH/10);
	PA_SetSpriteAnim (UP_SCREEN, WORD+3, MAX_BODY_LENGTH%10);

	PA_CreateSprite(UP_SCREEN, UPSCRBODY, (void*) man_Sprite,
						OBJ_SIZE_16X32, TRUE, UPSCR_BODY_PAL, 12, 52);
	PA_CreateSprite(UP_SCREEN, UPSCRNUM, (void*) number_Sprite,
							OBJ_SIZE_32X32, TRUE, NUM_PAL, 30, 58);
	PA_SetSpriteAnim (UP_SCREEN, UPSCRNUM, 10);
	PA_CreateSprite(UP_SCREEN, UPSCRNUM+1, (void*) number_Sprite,
								OBJ_SIZE_32X32, TRUE, NUM_PAL, 55, 58);
	PA_CreateSprite(UP_SCREEN, UPSCRNUM+2, (void*) number_Sprite,
								OBJ_SIZE_32X32, TRUE, NUM_PAL, 80, 58);
	PA_StartSpriteAnim(UP_SCREEN,UPSCRBODY,8, 10, 3);


	while (1) {
		PA_SetSpriteAnim (UP_SCREEN, UPSCRNUM+1, length/10);
		PA_SetSpriteAnim (UP_SCREEN, UPSCRNUM+2, length%10);
		vTaskDelay(MSEC2TICK(100));
	}
}
Esempio n. 25
0
File: main.c Progetto: hl1itj/Team2
void dropshipCreate(mapTile map[][MAX_MAP_Y_LENGTH]){
	u8 i, j;
	u8 x, y;
	for(i=0; i<fireCount; i++)
		PA_DeleteSprite(DOWN_SCREEN, FIREINMAP + i);
	for(i=0; i<MAX_MAP_X_LENGTH; i++)
		for(j=0; j<MAX_MAP_Y_LENGTH; j++)
		{
			if (i != 0 && i != (MAX_MAP_X_LENGTH - 1) && j != 0
								&& j != (MAX_MAP_Y_LENGTH - 1))
			map[i][j].state = MAP_STATE_NULL;
		}
	x = MAX_MAP_X_LENGTH / 2 - 2;
	y = MAX_MAP_Y_LENGTH / 2 - 2;
	PA_LoadSpritePal(DOWN_SCREEN, DROPSHIP_PAL, (void*) dropship_Pal);
	PA_CreateSprite(DOWN_SCREEN, DROPSHIP, (void*) dropship_Sprite, OBJ_SIZE_64X64, TRUE,
			DROPSHIP_PAL,  map[x][y].x, map[x][y].y);
	PA_StartSpriteAnimEx (DOWN_SCREEN, DROPSHIP, 0, 4, 3, ANIM_UPDOWN, -1);
	for(i=1; i<3; i++)
		for(j=1; j<3; j++)
			map[x+i][y+j].state = MAP_STATE_EXIT;
	AS_SoundQuickPlay(dropship);
}
Esempio n. 26
0
int main(void){

	PA_Init();
	PA_InitVBL();
	
	PA_InitText(1,0); // On the top screen

	PA_LoadSpritePal(0, 0, (void*)sprite0_Pal);

	PA_CreateSprite(0, 0,(void*)vaisseau_Sprite, OBJ_SIZE_32X32,1, 0, 128-16, 96-16); // Create the ship in the center...
	PA_SetSpriteRotEnable(0,0,0);// Enable rotations and use Rotset 0... 
	
	s32 x = (128) << 8; // ship x position in 8bit fixed point
	s32 y = (96) << 8; // Y
	u16 angle = 0; // direction in which to move !
	
	

	while(1)
	{
		angle = PA_GetAngle(x>>8, y>>8, Stylus.X, Stylus.Y);
		PA_SetRotsetNoZoom(0, 0, angle); // Turn the ship in the correct direction
		
		if (Stylus.Held){ // Move forward
			x += PA_Cos(angle);
			y -= PA_Sin(angle);
		}

		PA_OutputText(1, 5, 10, "Angle : %d  ", angle);
	
		PA_SetSpriteXY(0, 0, (x>>8)-16, (y>>8)-16); // Sprite position converted to normal...
		
		PA_WaitForVBL();

	}
	return 0;
}
Esempio n. 27
0
int main()
{
	int heroX=0;
	srand(time(NULL));
	Dong dong1={rand()%255,0};
	Dong dong2={rand()%255,0};
	Dong dong3={rand()%255,0};
	Dong dong4={rand()%255,0};
	Dong dong5={rand()%255,0};
	Dong dong6={rand()%255,0};
	Dong dong7={rand()%255,0};


	PA_Init();    // Initializes PA_Lib
	PA_InitVBL(); // Initializes a standard VBL

	PA_InitSound();
	PA_PlayMod(modfile);



	// Infinite loop to keep the program running
	while (1)
	{
		int score=0;
		static int scoreRank1=0, scoreRank2=0, scoreRank3=0;
		PA_EasyBgLoad(UP_SCREEN, BG2, mainup);
		PA_EasyBgLoad(DOWN_SCREEN, BG2, Menu);

		int selnum=0;

		selnum = sel_menu();


		if(selnum == 1){
GAMESTART:
			//��������
			PA_EasyBgLoad(UP_SCREEN, BG2, backgroundUp);
			PA_EasyBgLoad(DOWN_SCREEN, BG2, backgroundDown);
			PA_WaitForVBL();
			//ij���� ����
			PA_LoadSpritePal(DOWN_SCREEN,0,(void*)frames_Pal);
			PA_CreateSprite(DOWN_SCREEN,0,(void*)frames_Sprite, OBJ_SIZE_16X32, 1, 0, 128-16, 192-32);

			PA_DualLoadSpritePal(2,(void*)dong_Pal);
			PA_DualLoadSpritePal(3,(void*)dong_Pal);
			PA_DualLoadSpritePal(4,(void*)dong_Pal);
			PA_DualLoadSpritePal(5,(void*)dong_Pal);
			PA_DualLoadSpritePal(6,(void*)dong_Pal);
			PA_DualLoadSpritePal(7,(void*)dong_Pal);
			PA_DualLoadSpritePal(8,(void*)dong_Pal);

			PA_DualCreateSprite(2,(void*)dong_Sprite, OBJ_SIZE_16X16,1,2,0,0);
			PA_DualCreateSprite(3,(void*)dong_Sprite, OBJ_SIZE_16X16,1,3,0,0);
			PA_DualCreateSprite(4,(void*)dong_Sprite, OBJ_SIZE_16X16,1,4,0,0);
			PA_DualCreateSprite(5,(void*)dong_Sprite, OBJ_SIZE_16X16,1,5,0,0);
			PA_DualCreateSprite(6,(void*)dong_Sprite, OBJ_SIZE_16X16,1,6,0,0);
			PA_DualCreateSprite(7,(void*)dong_Sprite, OBJ_SIZE_16X16,1,6,0,0);
			PA_DualCreateSprite(8,(void*)dong_Sprite, OBJ_SIZE_16X16,1,6,0,0);

			/* �ؽ�Ʈ ���� �κ� */
			PA_InitText(UP_SCREEN, BG0);
			PA_SetTextTileCol(UP_SCREEN, 9);

			PA_OutputText(DOWN_SCREEN, 1, 21, "test");
			
			//PA_DualSetSpriteAnim(2,2);
			//PA_DualSetSpriteAnim(3,3);

			while(true){
				if(Pad.Held.Right && heroX<256-16){
					PA_SetSpriteAnim(0,0,1);
					heroX+=10;
				}
				if(Pad.Held.Left && heroX>0){
					PA_SetSpriteAnim(0,0,3);
					heroX-=10;
				}
				PA_SetSpriteXY(DOWN_SCREEN,0,heroX,192-32);
				PA_WaitForVBL();
				//---------------------------------------------------------------
				dong1.y+=10;
				if(dong1.y>410){
					score+=100;
					dong1.y=0;
					dong1.x =rand()%255;

				}
				dong2.y+=11;
				if(dong2.y>410){
					score+=100;
					dong2.y=0;
					dong2.x =rand()%255;

				}
				dong3.y+=12;
				if(dong3.y>410){
					score+=100;
					dong3.y=0;
					dong3.x =rand()%255;

				}
				dong4.y+=13;
				if(dong4.y>410){
					score+=100;
					dong4.y=0;
					dong4.x =rand()%255;

				}
				dong5.y+=14;
				if(dong5.y>410){
					score+=100;
					dong5.y=0;
					dong5.x =rand()%255;

				}
				dong6.y+=15;
				if(dong6.y>410){
					score+=100;
					dong6.y=0;
					dong6.x =rand()%255;

				}
				dong7.y+=16;
				if(dong7.y>410){
					score+=100;
					dong7.y=0;
					dong7.x =rand()%255;

				}
				PA_OutputText(UP_SCREEN, 0, 0, "score = %d",score);


				PA_WaitForVBL();
				PA_DualSetSpriteXY(2,dong1.x,dong1.y);
				PA_WaitForVBL();
				PA_DualSetSpriteXY(3,dong2.x,dong2.y);
				PA_WaitForVBL();
				PA_DualSetSpriteXY(4,dong3.x,dong3.y);
				PA_WaitForVBL();
				PA_DualSetSpriteXY(5,dong4.x,dong4.y);
				PA_WaitForVBL();
				PA_DualSetSpriteXY(6,dong5.x,dong5.y);
				PA_WaitForVBL();
				PA_DualSetSpriteXY(7,dong6.x,dong6.y);
				PA_WaitForVBL();
				PA_DualSetSpriteXY(8,dong7.x,dong7.y);

				if(dong1.y>390 && (heroX+16)>dong1.x && heroX<(dong1.x+16))
					break;
				if(dong2.y>390 && (heroX+16)>dong2.x && heroX<(dong2.x+16))
					break;
				if(dong3.y>390 && (heroX+16)>dong3.x && heroX<(dong3.x+16))
					break;
				if(dong4.y>390 && (heroX+16)>dong4.x && heroX<(dong4.x+16))
					break;
				if(dong5.y>390 && (heroX+16)>dong5.x && heroX<(dong5.x+16))
					break;
				if(dong6.y>390 && (heroX+16)>dong6.x && heroX<(dong6.x+16))
					break;
				if(dong7.y>390 && (heroX+16)>dong7.x && heroX<(dong7.x+16))
					break;



			}
			PA_WaitForVBL();
			PA_EasyBgLoad(UP_SCREEN, BG2, gameoverUp); //����ȭ�� gameover
			PA_EasyBgLoad(DOWN_SCREEN, BG2, gameoverDown); //����ȭ�� gameover
			PA_DeleteSprite(DOWN_SCREEN, 0); //���� ������
			PA_DualDeleteSprite(2);  //��������
			PA_DualDeleteSprite(3);  //��������
			PA_DualDeleteSprite(4);  //��������
			PA_DualDeleteSprite(5);  //��������
			PA_DualDeleteSprite(6);  //��������
			PA_DualDeleteSprite(7);  //��������
			PA_DualDeleteSprite(8);  //��������
			PA_InitText(UP_SCREEN, BG0); //�ؽ�Ʈ �ʱ�ȭ
			PA_SetTextTileCol(UP_SCREEN, 9); //�ؽ�Ʈ �� ������ ����
			PA_OutputText(UP_SCREEN, 10, 13, "score = %d",score);
			ret_next(); //�Է´���
			
			//--------�ʱ�ȭ
			if(score>=scoreRank1){ //1��
				scoreRank3=scoreRank2;
				scoreRank2=scoreRank1;
				scoreRank1=score;
			}
			else if(score>=scoreRank2){//2��
				scoreRank3=scoreRank2;
				scoreRank2=score;
			}
			else if(score>=scoreRank3){//3��
				scoreRank3=score;
			}
			score=0;
			dong1.x=rand()%255; dong1.y=0;
			dong2.x=rand()%255; dong2.y=0;
			dong3.x=rand()%255; dong3.y=0;
			dong4.x=rand()%255; dong4.y=0;
			dong5.x=rand()%255; dong5.y=0;
			dong6.x=rand()%255; dong4.y=0;
			dong7.x=rand()%255; dong5.y=0;
			PA_InitText(UP_SCREEN, BG0); //�ؽ�Ʈ �ʱ�ȭ
			PA_WaitForVBL();


		}
		else if(selnum == 2){ //��ũ ȭ��
			PA_WaitForVBL();
			PA_EasyBgLoad(UP_SCREEN, BG2, rankingUp); //����ȭ�� rankingUp
			PA_EasyBgLoad(DOWN_SCREEN, BG2, rankingDown); //����ȭ�� rankingDown
			PA_InitText(UP_SCREEN, BG0); //�ؽ�Ʈ �ʱ�ȭ
			PA_SetTextTileCol(UP_SCREEN, 9); //�ؽ�Ʈ �� ������ ����
			PA_OutputText(UP_SCREEN, 10, 13, "Rank 1! = %d",scoreRank1);
			PA_OutputText(UP_SCREEN, 10, 15, "Rank 2! = %d",scoreRank2);
			PA_OutputText(UP_SCREEN, 10, 17, "Rank 3! = %d",scoreRank3);
			ret_next(); //�Է´���
			PA_InitText(UP_SCREEN, BG0); //�ؽ�Ʈ �ʱ�ȭ
			goto GAMESTART;


		}
		else
			;
		PA_WaitForVBL();
	}

	return 0;
}
Esempio n. 28
0
File: main.c Progetto: hl1itj/Team2
portTASK_FUNCTION(Unit_Task, pvParameters ) {
	body bd[MAX_BODY_LENGTH];
	int i;
	u8 x = 5;
	u8 y = 5;
	unit.x = 5;
	unit.y = 5;
	u8 pfx;
	u8 pfy;
	u8 pfDirection;
	u8 tempx;
	u8 tempy;
	u8 tempDirection;
	unit.direction = D_DOWN;
	portTickType xLastWakeTime = xTaskGetTickCount();
	PA_LoadSpritePal(DOWN_SCREEN, C_PAL, (void*) C_Pal);
	PA_LoadSpritePal(DOWN_SCREEN, BODY_PAL, (void*) man_Pal);
	PA_CreateSprite(DOWN_SCREEN, C, (void*) C_Sprite, OBJ_SIZE_32X32, TRUE,
			C_PAL,  map[unit.x][unit.y].x-8, map[unit.x][unit.y].y-16);

	while (1) {
		x = unit.x;
		y = unit.y;
		switch (unit.direction) {
		case D_UP:
			y--;
			break;
		case D_DOWN:
			y++;
			break;
		case D_LEFT:
			x--;
			break;
		case D_RIGHT:
			x++;
			break;
		default:
			break;
		}
		if ((map[x][y].state == MAP_STATE_NULL)
				|| (map[x][y].state == MAP_STATE_ITEM)) {
			pfx = unit.x;
			pfy = unit.y;
			pfDirection = unit.direction;
			if ((map[x][y].state == MAP_STATE_ITEM)) {
				if (length < MAX_BODY_LENGTH) // to max length
				{
					length++;
					fireCreate(map);
				}
				if (length == MAX_BODY_LENGTH)
				{
					dropshipCreate(map);
				}
				map[x][y].state = MAP_STATE_NULL;
				PA_StopSpriteAnim(DOWN_SCREEN,map[x][y].itemSpriteNum);
				PA_DeleteSprite(DOWN_SCREEN, map[x][y].itemSpriteNum);
				PA_CreateSprite(DOWN_SCREEN, BODY + (length-1), (void*) man_Sprite,
					OBJ_SIZE_16X32, TRUE, BODY_PAL, 0, 0);
			}
			unit.x = x;
			unit.y = y;
			PA_SetSpriteXY(DOWN_SCREEN, C, map[unit.x][unit.y].x - 8,
					map[unit.x][unit.y].y - 16);
			for (i = 0; i < length; i++) {
				tempx = bd[i].x;
				tempy = bd[i].y;
				tempDirection = bd[i].direction;
				map[tempx][tempy].state = MAP_STATE_NULL;
				bd[i].x = pfx;
				bd[i].y = pfy;
				map[pfx][pfy].state = MAP_STATE_C_BODY;
				bd[i].direction = pfDirection;
				pfx = tempx;
				pfy = tempy;
				pfDirection = tempDirection;
				PA_SetSpriteXY(DOWN_SCREEN, BODY + i, map[bd[i].x][bd[i].y].x,
						(map[bd[i].x][bd[i].y].y)-16);
				if(pfDirection!=bd[i].direction)
					PA_StartSpriteAnim(DOWN_SCREEN, BODY + i, bd[i].direction, bd[i].direction+2, 7);
			}
		}
		if((map[x][y].state == MAP_STATE_WALL) || map[x][y].state == MAP_STATE_C_BODY) //실패
		{
			AS_SoundQuickPlay(die);
			PA_ResetSpriteSys ();
			PA_ResetBgSysScreen (DOWN_SCREEN);
			PA_LoadBackground(DOWN_SCREEN, 3, &FAILSCREEN);
			vTaskSuspend(NULL);
		}
		if(map[x][y].state == MAP_STATE_EXIT)      //클리어
		{
			PA_ResetSpriteSys ();
			PA_ResetBgSysScreen (DOWN_SCREEN);
			PA_LoadBackground(DOWN_SCREEN, 3, &CLEARSCREEN);
			vTaskSuspend(NULL);
		}
		vTaskDelayUntil(&xLastWakeTime, MSEC2TICK(300-(length*10)) );
	}
}
Esempio n. 29
0
void CDeck::discardCard(const typecard card, const bool discarded) {
  m_cardfrequency[card]++;
  // Delete the previously played card sprite at the top screen
  PA_DeleteSprite(1, SPRITE_NB_EMPTYCARD_PART2);
  PA_DeleteSprite(1, SPRITE_NB_EMPTYCARD_PART1);
  // Create a sprite for the card that has been discarded at the top screen
  switch (card.first) {
    case 0:
      switch (card.second) {
        case 0:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)attack1_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1, (void*)attack1_1_Sprite,
                             OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                             129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2, (void*)attack1_2_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1+45);
          break;
        case 1:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)attack2_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1, (void*)attack2_1_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2, (void*)attack2_2_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1+45);
          break;
        case 2:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)attack3_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1, (void*)attack3_1_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2, (void*)attack3_2_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1+45);
          break;
        case 3:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)attack4_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1, (void*)attack4_1_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2, (void*)attack4_2_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1+45);
          break;
        case 4:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)attack5_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1, (void*)attack5_1_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2, (void*)attack5_2_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1+45);
          break;
        case 5:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)attack6_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1, (void*)attack6_1_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2, (void*)attack6_2_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD, 
                          129, 1+45);
          break;
        case 6:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)attack7_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1, (void*)attack7_1_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2, (void*)attack7_2_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1+45);
          break;
        case 7:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)attack8_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1, (void*)attack8_1_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2, (void*)attack8_2_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1+45);
          break;
        case 8:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)attack9_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1, (void*)attack9_1_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2, (void*)attack9_2_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1+45);
          break;
        case 9:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)attack10_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1,
                          (void*)attack10_1_Sprite, OBJ_SIZE_64X64, 1,
                          PALETTE_NB_LAST_PLAYED_CARD, 129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2,
                          (void*)attack10_2_Sprite, OBJ_SIZE_64X64, 1,
                          PALETTE_NB_LAST_PLAYED_CARD, 129, 1+45);
          break;
        default:
          PA_OutputText(1,0,0,"This card number does not exist.");
          break;
      }
      break;
    case 1:
      switch (card.second) {
        case 0:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)defense1_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1,
                          (void*)defense1_1_Sprite, OBJ_SIZE_64X64, 1,
                          PALETTE_NB_LAST_PLAYED_CARD, 129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2,
                          (void*)defense1_2_Sprite, OBJ_SIZE_64X64, 1,
                          PALETTE_NB_LAST_PLAYED_CARD, 129, 1+45);
          break;
        case 1:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)defense2_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1,
                          (void*)defense2_1_Sprite, OBJ_SIZE_64X64, 1,
                          PALETTE_NB_LAST_PLAYED_CARD, 129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2,
                          (void*)defense2_2_Sprite, OBJ_SIZE_64X64, 1,
                          PALETTE_NB_LAST_PLAYED_CARD, 129, 1+45);
          break;
        case 2:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)defense3_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1,
                          (void*)defense3_1_Sprite, OBJ_SIZE_64X64, 1,
                          PALETTE_NB_LAST_PLAYED_CARD, 129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2,
                          (void*)defense3_2_Sprite, OBJ_SIZE_64X64, 1,
                          PALETTE_NB_LAST_PLAYED_CARD, 129, 1+45);
          break;
        case 3:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)defense4_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1,
                          (void*)defense4_1_Sprite, OBJ_SIZE_64X64, 1,
                          PALETTE_NB_LAST_PLAYED_CARD, 129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2,
                          (void*)defense4_2_Sprite, OBJ_SIZE_64X64, 1,
                          PALETTE_NB_LAST_PLAYED_CARD, 129, 1+45);
          break;
        case 4:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)defense5_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1,
                          (void*)defense5_1_Sprite, OBJ_SIZE_64X64, 1,
                          PALETTE_NB_LAST_PLAYED_CARD, 129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2,
                          (void*)defense5_2_Sprite, OBJ_SIZE_64X64, 1,
                          PALETTE_NB_LAST_PLAYED_CARD, 129, 1+45);
          break;
        case 5:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)defense6_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1,
                          (void*)defense6_1_Sprite, OBJ_SIZE_64X64, 1,
                          PALETTE_NB_LAST_PLAYED_CARD, 129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2,
                          (void*)defense6_2_Sprite, OBJ_SIZE_64X64, 1,
                          PALETTE_NB_LAST_PLAYED_CARD, 129, 1+45);
          break;
        case 6:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)defense7_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1,
                          (void*)defense7_1_Sprite, OBJ_SIZE_64X64, 1,
                          PALETTE_NB_LAST_PLAYED_CARD, 129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2,
                          (void*)defense7_2_Sprite, OBJ_SIZE_64X64, 1,
                          PALETTE_NB_LAST_PLAYED_CARD, 129, 1+45);
          break;
        case 7:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)defense8_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1,
                          (void*)defense8_1_Sprite, OBJ_SIZE_64X64, 1,
                          PALETTE_NB_LAST_PLAYED_CARD, 129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2,
                          (void*)defense8_2_Sprite, OBJ_SIZE_64X64, 1,
                          PALETTE_NB_LAST_PLAYED_CARD, 129, 1+45);
          break;
        case 8:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)defense9_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1,
                          (void*)defense9_1_Sprite, OBJ_SIZE_64X64, 1,
                          PALETTE_NB_LAST_PLAYED_CARD, 129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2,
                          (void*)defense9_2_Sprite, OBJ_SIZE_64X64, 1,
                          PALETTE_NB_LAST_PLAYED_CARD, 129, 1+45);
          break;
        case 9:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD,
                           (void*)defense10_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1,
                          (void*)defense10_1_Sprite, OBJ_SIZE_64X64, 1,
                          PALETTE_NB_LAST_PLAYED_CARD, 129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2,
                          (void*)defense10_2_Sprite, OBJ_SIZE_64X64, 1,
                          PALETTE_NB_LAST_PLAYED_CARD, 129, 1+45);
          break;
        default:
          PA_OutputText(1,0,0,"This card number does not exist.");
          break;
      }
      break;
    case 2:
      switch (card.second) {
        case 0:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)magic1_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1, (void*)magic1_1_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2, (void*)magic1_2_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1+45);
          break;
        case 1:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)magic2_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1, (void*)magic2_1_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2, (void*)magic2_2_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD, 129,
                          1+45);
          break;
        case 2:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)magic3_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1, (void*)magic3_1_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2, (void*)magic3_2_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1+45);
          break;
        case 3:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)magic4_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1, (void*)magic4_1_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2, (void*)magic4_2_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1+45);
          break;
        case 4:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)magic5_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1, (void*)magic5_1_Sprite,
                            OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                            129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2, (void*)magic5_2_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1+45);
          break;
        case 5:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)magic6_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1, (void*)magic6_1_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2, (void*)magic6_2_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1+45);
          break;
        case 6:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)magic7_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1, (void*)magic7_1_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2, (void*)magic7_2_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1+45);
          break;
        case 7:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)magic8_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1, (void*)magic8_1_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2, (void*)magic8_2_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1+45);
          break;
        case 8:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)magic9_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1, (void*)magic9_1_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2, (void*)magic9_2_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1+45);
          break;
        case 9:
          PA_LoadSpritePal(1, PALETTE_NB_LAST_PLAYED_CARD, (void*)magic10_Pal);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART1, (void*)magic10_1_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1);
          PA_CreateSprite(1, SPRITE_NB_EMPTYCARD_PART2, (void*)magic10_2_Sprite,
                          OBJ_SIZE_64X64, 1, PALETTE_NB_LAST_PLAYED_CARD,
                          129, 1+45);
          break;
        default:
          PA_OutputText(1,0,0,"This card number does not exist.");
          break;
      }
      break;
    default:
      PA_OutputText(1,0,0,"This card type does not exist.");
      break;
  }
  PA_SetSpritePrio (1, SPRITE_NB_BACKCARD_PART1, 2);
  PA_SetSpritePrio (1, SPRITE_NB_BACKCARD_PART2, 2);
  PA_SetSpritePrio (1, SPRITE_NB_EMPTYCARD_PART1, 2);
  PA_SetSpritePrio (1, SPRITE_NB_EMPTYCARD_PART2, 2);
  // Set the sprite's mode to alpha blending if the card is discarded
  if (discarded) {
    PA_SetSpriteMode(1, SPRITE_NB_EMPTYCARD_PART1, 1);
    PA_SetSpriteMode(1, SPRITE_NB_EMPTYCARD_PART2, 1);
  }
  else {
    PA_SetSpriteMode(1, SPRITE_NB_EMPTYCARD_PART1, 0);
    PA_SetSpriteMode(1, SPRITE_NB_EMPTYCARD_PART2, 0);
  }
}
Esempio n. 30
0
/**
 * Inits things for the game
 */
void init()
{
	// Init PA
	PA_Init();
	PA_InitVBL();
	
    // Init Sound
    PA_InitSound();
    
	// Init Text
	PA_InitText(SCREEN_TOP, 0);
	
//	debug();
	
	// Roll pre-game credits
	if(false)
	{
		// Code I wish I could put into rollPreCredits();
		u8 counter=0; // used to count till timeout
		
		// Text
		clear_text();
		print(5,3,PRECREDITS);
		
		// logo on bottom screen
		PA_EasyBgLoad(SCREEN_BOTTOM,3, splash_pong);
		
		// Wait & fade out
		counter = 0;
		PA_WaitFor(Pad.Newpress.A || Pad.Newpress.Start || Stylus.Newpress || counter++>IDLETIME);
		fadeOut();
		
		// run DSX/Comp screen
		PA_EasyBgLoad(SCREEN_TOP,	3, splash_comp);
		PA_EasyBgLoad(SCREEN_BOTTOM,3, splash_comp2);
		
		// Wait & fade out
		counter = 0;
		PA_WaitFor(Pad.Newpress.A || Pad.Newpress.Start || Stylus.Newpress || counter++>IDLETIME);
		fadeOut();
		
		// run PA_Lib & Eclipse screens
		PA_EasyBgLoad(SCREEN_TOP,	3, splash_palib);
		PA_EasyBgLoad(SCREEN_BOTTOM,3, splash_eclipse);
		
		// Wait & fade out
		counter = 0;
		PA_WaitFor(Pad.Newpress.A || Pad.Newpress.Start || Stylus.Newpress || counter++>IDLETIME);
		fadeOut();
		//rollPreCredits();
	}
	
	PA_InitText(SCREEN_TOP, 0);
	PA_SetTextCol(SCREEN_TOP, 0, 0, 0);
	
	// Some variables
	game.smartAI	= 0;
	game.score		= 0;
	game.lives		= 3;
	game.rank		= "";
	game.gameover	= false;
	
	// Load Palletes
	PA_LoadSpritePal(SCREEN_TOP,	1,	(void*)ball_Pal);
	PA_LoadSpritePal(SCREEN_BOTTOM,	2,	(void*)ball_Pal);
	PA_LoadSpritePal(SCREEN_TOP,	3,	(void*)paddle_a_Pal);
	PA_LoadSpritePal(SCREEN_BOTTOM,	4,	(void*)paddle_b_Pal);
	
	// create sprites
	PA_CreateSprite(SCREEN_BOTTOM,	BALL_BOTTOM,	(void*)ball_Sprite,		OBJ_SIZE_16X16, 1, 1, 	-BALL_WIDTH,	-BALL_HEIGHT);
	PA_CreateSprite(SCREEN_TOP,		BALL_TOP,		(void*)ball_Sprite,		OBJ_SIZE_16X16, 1, 2, 	-BALL_WIDTH,	-BALL_HEIGHT);
	PA_CreateSprite(SCREEN_BOTTOM,	PADDLE1,		(void*)paddle_a_Sprite,	OBJ_SIZE_32X16, 1, 3,	-PADDLE_WIDTH,	-PADDLE_HEIGHT);
	PA_CreateSprite(SCREEN_TOP,		PADDLE2,		(void*)paddle_b_Sprite,	OBJ_SIZE_32X16, 1, 4,	-PADDLE_WIDTH,	-PADDLE_HEIGHT);
	
	// create backgrounds
	PA_EasyBgLoad(SCREEN_TOP,		2, background_top);
	PA_EasyBgLoad(SCREEN_BOTTOM,	2, background_bottom);
	
	// Init high score to 0. (Should probably read from a save)
	highscore.points	= 0;
	highscore.name		= "No one";
	highscore.submitted	= false;
}