SpaceBubble  v0.98
Functions | Variables
SpaceBubble.c File Reference

Wii SpaceBubble game core. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <math.h>
#include <ogcsys.h>
#include <gccore.h>
#include <gcmodplay.h>
#include <fcntl.h>
#include <unistd.h>
#include <time.h>
#include <asndlib.h>
#include <fat.h>
#include <mxml.h>
#include <sys/dir.h>
#include <mp3player.h>
#include <ogc/lwp_watchdog.h>
#include <stdarg.h>
#include "General.h"
#include "http.h"
#include "trace.h"
#include "settings.h"
#include "effect1_pcm.h"
#include "effect2_pcm.h"
#include "effect3_pcm.h"
#include "track1_mod.h"
#include "track2_mod.h"
#include "track3_mod.h"
#include "track4_mod.h"
#include "track5_mod.h"
#include "track6_mod.h"
#include "track7_mod.h"
#include "track8_mod.h"
#include "track9_mod.h"
#include "font_ttf.h"

Functions

char getLetter (char letter, bool up)
 
void doPowerOff (void)
 
void doPadPowerOff (s32 chan)
 
void saveLocalHighScoreFile (char *filename)
 
void loadTodayHighScore (char *buffer)
 
void loadGlobalHighScore (char *buffer)
 
void loadLocalHighScoreFile (char *filename)
 
void bubbleSuperShiftRight (void)
 
void bubbleShiftRight (void)
 
void bubbleShiftDown (void)
 
void bubbleMultiSelect3 (int nr)
 
void bubbleMultiSelect2 (int nr)
 
void bubbleHint (void)
 
void bubblePossibleOption (void)
 
void bubbleExplodeMove (void)
 
void bubbleRemove (void)
 
void bubbleMultiSelect (int nr)
 
int bubbleEnabledCount (void)
 
int bubbleSelectedCount (void)
 
int bubbleSelected (int x, int y)
 
int initMusicTrack (void)
 
void initSound (void)
 
void initThreads (void)
 
void initButtons (void)
 
void initImages (void)
 
void initTodayHighScore (void)
 
void initGlobalHighScore (void)
 
void initBubbles (void)
 
void initGameBoard (void)
 
void initExplodes (void)
 
void initLevel ()
 
void initGame ()
 
void initStateMachine (void)
 
void storeScore (void)
 
int buttonSelected (int x, int y, bool sound)
 
void button1x (void)
 
void button2y (void)
 
void buttonMinus (int index)
 
void buttonPlus (int index)
 
void buttonScroll (int x, int y)
 
void buttonExit (int index)
 
void buttonA (int x, int y)
 
void drawText (int x, int y, int type, const char *text,...)
 
void drawButtons ()
 
GRRLIB_texImg * imageBubble (bool selected, int color)
 
void drawGameboard (void)
 
void drawBubbles (void)
 
void drawExplodes (void)
 
void drawInfoBar (void)
 
void drawScreen (void)
 
int main ()
 

Variables

u32 * frameBuffer [1] = {NULL}
 
GXRModeObj * rmode = NULL
 
Mtx GXmodelView2D
 
char appl_user3 [MAX_LEN]
 
int yOffset = 0
 
int angle = 0
 
float size = 0
 
float wave1 = 0
 
float wave2 = 0
 
bool selected1 = false
 
bool selected2 = false
 
bool selectedA = false
 
int scrollIndex = 0
 
bool scrollEnabled = false
 
int stateMachine = stateIntro1
 
int prevStateMachine = stateNone
 
int maxLocalHighScore = 0
 
int maxTodayHighScore = 0
 
int maxGlobalHighScore = 0
 
int maxButtons = 0
 
int maxBubbles = 0
 
int maxGameboard = 0
 
int maxExplodes = 0
 
int selectedMusic = 1
 
int hintCount = 0
 
bool bPowerOff = false
 
bool gameResult = false
 
GRRLIB_ttfFont * myFont
 
const unsigned char pic4data []
 
int pic4length
 
const unsigned char pic5data []
 
int pic5length
 
const unsigned char pic10data []
 
int pic10length
 
const unsigned char pic11data []
 
int pic11length
 
const unsigned char pic12data []
 
int pic12length
 
const unsigned char pic13data []
 
int pic13length
 
const unsigned char pic14data []
 
const int pic14length
 
const unsigned char pic15data []
 
const int pic15length
 
const unsigned char pic16data []
 
const int pic16length
 
const unsigned char pic17data []
 
const int pic17length
 
const unsigned char pic18data []
 
const int pic18length
 
const unsigned char pic19data []
 
const int pic19length
 
const unsigned char pic20data []
 
const int pic20length
 
const unsigned char pic21data []
 
const int pic21length
 
const unsigned char pic22data []
 
const int pic22length
 
const unsigned char pic23data []
 
const int pic23length
 
const unsigned char pic24data []
 
const int pic24length
 
const unsigned char pic25data []
 
const int pic25length
 
const unsigned char pic26data []
 
const int pic26length
 
const unsigned char pic27data []
 
const int pic27length
 
const unsigned char pic28data []
 
const int pic28length
 
const unsigned char pic29data []
 
const int pic29length
 
const unsigned char pic30data []
 
const int pic30length
 
const unsigned char pic31data []
 
const int pic31length
 
const unsigned char pic32data []
 
const int pic32length
 
const unsigned char pic33data []
 
const int pic33length
 
const unsigned char pic34data []
 
const int pic34length
 
const unsigned char pic35data []
 
const int pic35length
 
const unsigned char pic36data []
 
const int pic36length
 
const unsigned char pic37data []
 
const int pic37length
 
const unsigned char pic38data []
 
const int pic38length
 
const unsigned char pic39data []
 
const int pic39length
 
const unsigned char pic40data []
 
const int pic40length
 
const unsigned char pic41data []
 
const int pic41length
 
const unsigned char pic42data []
 
const int pic42length
 
const unsigned char pic43data []
 
const int pic43length
 
const unsigned char pic44data []
 
const int pic44length
 
const unsigned char pic45data []
 
const int pic45length
 
const unsigned char pic46data []
 
const int pic46length
 
const unsigned char pic47data []
 
const int pic47length
 
const unsigned char pic48data []
 
const int pic48length
 
const unsigned char pic49data []
 
const int pic49length
 
const unsigned char pic1000data []
 
const int pic1000length
 

Detailed Description

Wii SpaceBubble game core.

Author
wplaat

Copyright (C) 2008-2010 PlaatSoft

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Function Documentation

int bubbleEnabledCount ( void  )

bubble Enabled count

void bubbleExplodeMove ( void  )

Explode bubble

void bubbleHint ( void  )

Set bubble hint

void bubbleMultiSelect ( int  nr)

Bubble multi selected

void bubbleMultiSelect2 ( int  nr)

Find all bubbles (same color) connected to each other

void bubbleMultiSelect3 ( int  nr)

Find all bubbles (same color) connected to each other

void bubblePossibleOption ( void  )

Calculate bubble movements

void bubbleRemove ( void  )

Remove bubble

int bubbleSelected ( int  x,
int  y 
)

Bubble selected

int bubbleSelectedCount ( void  )

bubble selected count

void bubbleShiftDown ( void  )

Bubble shift Down methode.

void bubbleShiftRight ( void  )

Bubble shift Right methode.

void bubbleSuperShiftRight ( void  )

Gameboard matrix (10x10) 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 Bubble Super Shift Right methode.

void button1x ( void  )
void button2y ( void  )
void buttonA ( int  x,
int  y 
)
void buttonExit ( int  index)
void buttonMinus ( int  index)
void buttonPlus ( int  index)
void buttonScroll ( int  x,
int  y 
)
int buttonSelected ( int  x,
int  y,
bool  sound 
)
void doPadPowerOff ( s32  chan)

PowerOff callback function for the Wii Remote power button.

void doPowerOff ( void  )

PowerOff callback function.

void drawBubbles ( void  )
void drawButtons ( )
void drawExplodes ( void  )
void drawGameboard ( void  )
void drawInfoBar ( void  )
void drawScreen ( void  )

Draw background

void drawText ( int  x,
int  y,
int  type,
const char *  text,
  ... 
)
char getLetter ( char  letter,
bool  up 
)

Get letter

GRRLIB_texImg* imageBubble ( bool  selected,
int  color 
)
void initBubbles ( void  )

initBubbles

void initButtons ( void  )

Init buttons

void initExplodes ( void  )
void initGame ( )

Init game parameters

void initGameBoard ( void  )

Init gameboard

void initGlobalHighScore ( void  )
void initImages ( void  )

Init Images

void initLevel ( )

Init Level

int initMusicTrack ( void  )

Init music track

void initSound ( void  )

init sound

void initStateMachine ( void  )
void initThreads ( void  )

init network threads

void initTodayHighScore ( void  )

init today highscore

void loadGlobalHighScore ( char *  buffer)

Load global highsore

void loadLocalHighScoreFile ( char *  filename)

Load localhighscore from disk

Parameters
filenameTHe filename of the local highscore.
void loadTodayHighScore ( char *  buffer)

Load today highscore

int main ( )
void saveLocalHighScoreFile ( char *  filename)

Save Local highscore to file

Parameters
filenameThe filename of the highscore
void storeScore ( void  )

Store score in on disk and internet

Variable Documentation

int angle = 0
char appl_user3[MAX_LEN]
bool bPowerOff = false
u32* frameBuffer[1] = {NULL}
bool gameResult = false
Mtx GXmodelView2D
int hintCount = 0
int maxBubbles = 0
int maxButtons = 0
int maxExplodes = 0
int maxGameboard = 0
int maxGlobalHighScore = 0
int maxLocalHighScore = 0
int maxTodayHighScore = 0
GRRLIB_ttfFont* myFont
const unsigned char pic1000data[]
const int pic1000length
const unsigned char pic10data[]
int pic10length
const unsigned char pic11data[]
int pic11length
const unsigned char pic12data[]
int pic12length
const unsigned char pic13data[]
int pic13length
const unsigned char pic14data[]
const int pic14length
const unsigned char pic15data[]
const int pic15length
const unsigned char pic16data[]
const int pic16length
const unsigned char pic17data[]
const int pic17length
const unsigned char pic18data[]
const int pic18length
const unsigned char pic19data[]
const int pic19length
const unsigned char pic20data[]
const int pic20length
const unsigned char pic21data[]
const int pic21length
const unsigned char pic22data[]
const int pic22length
const unsigned char pic23data[]
const int pic23length
const unsigned char pic24data[]
const int pic24length
const unsigned char pic25data[]
const int pic25length
const unsigned char pic26data[]
const int pic26length
const unsigned char pic27data[]
const int pic27length
const unsigned char pic28data[]
const int pic28length
const unsigned char pic29data[]
const int pic29length
const unsigned char pic30data[]
const int pic30length
const unsigned char pic31data[]
const int pic31length
const unsigned char pic32data[]
const int pic32length
const unsigned char pic33data[]
const int pic33length
const unsigned char pic34data[]
const int pic34length
const unsigned char pic35data[]
const int pic35length
const unsigned char pic36data[]
const int pic36length
const unsigned char pic37data[]
const int pic37length
const unsigned char pic38data[]
const int pic38length
const unsigned char pic39data[]
const int pic39length
const unsigned char pic40data[]
const int pic40length
const unsigned char pic41data[]
const int pic41length
const unsigned char pic42data[]
const int pic42length
const unsigned char pic43data[]
const int pic43length
const unsigned char pic44data[]
const int pic44length
const unsigned char pic45data[]
const int pic45length
const unsigned char pic46data[]
const int pic46length
const unsigned char pic47data[]
const int pic47length
const unsigned char pic48data[]
const int pic48length
const unsigned char pic49data[]
const int pic49length
const unsigned char pic4data[]
int pic4length
const unsigned char pic5data[]
int pic5length
int prevStateMachine = stateNone
GXRModeObj* rmode = NULL
bool scrollEnabled = false
int scrollIndex = 0
bool selected1 = false
bool selected2 = false
bool selectedA = false
int selectedMusic = 1
float size = 0
int stateMachine = stateIntro1
float wave1 = 0
float wave2 = 0
int yOffset = 0