// FIELD FUNCTIONS void Field::create() { if (is_debugging) cout << "Calling Field::create()\n"; addBombs(); initNumbers(); VA = sf::VertexArray(sf::Quads, 4*size.x*size.y); initVertex(); makeRandomSpecial(); m_state = INITIALIZED; cout << "Bombs left: " << no_bombs << endl; }
int InitLemm( void ) { int i; #ifdef USEX FBFlushGrafic(); #endif FBFillRect( 0, 0, 720, 576, STEELBLUE ); FBFillRect( 60, 448, 300, 100, BLACK ); if ( !bgImage ) { FBDrawString(64,482,32,"Initialize...",WHITE,0); FBDrawFx2Logo( 320, 486 ); #ifdef USEX FBFlushGrafic(); #endif initNumbers(); if ( LoadPics() == -1 ) return -1; bgImage=malloc(1600*160); SoundStart(); } if ( !bgImage ) return -1; for( i=0; i<12; i++ ) svdimage[i]=malloc(32*48); for( i=0; i<320; i+=32 ) inSc( 19, 0, i+main_x, 352, 1 ); inSc( 29, 0, 66+main_x, 370, 1 ); inSc( 29, 1, 100+main_x, 372, 1 ); inSc( 8, 0, 134+main_x, 372, 0 ); // explosion inSc( 4, 10, 166+main_x, 374, 1 ); // lemming2 inSc( 29, 2, 200+main_x, 368, 1 ); inSc( 29, 3, 234+main_x, 368, 1 ); inSc( 29, 4, 264+main_x, 372, 1 ); inSc( 5, 2, 292+main_x, 368, 1 ); inSc( 20, 0, 320+main_x, 352, 1 ); FBDrawString(44,390,48,"-",GREEN,0); FBDrawString(76,390,48,"+",GREEN,0); return 0; }
void initGame(oogame* g) { g->fatPixelWidth = (ooint)((g->output->graphic.width)/CG_BG_GRID_WIDTH); if(g->fatPixelWidth<0) { g->fatPixelWidth = 1; } g->fatPixelHeight = (ooint)(g->output->graphic.height/CG_BG_GRID_HEIGHT); if(g->fatPixelHeight<0) { g->fatPixelHeight = 1; } g->smallPixelWidth = g->fatPixelWidth/4; if(g->smallPixelWidth <0) { g->smallPixelWidth = 1; } g->smallPixelHeight = g->fatPixelHeight/4; if(g->smallPixelHeight<0) { g->smallPixelHeight = 1; } initBGGrid(g); initTankShape(g); initNumbers(g); g->tank1.keyLeft = 'A'; g->tank1.keyRight = 'D'; g->tank1.keyForward = 'W'; g->tank1.keyFire = 'S'; g->tank1.colour = 0xff0000ff; g->tank1.gamePadIndex = 0; g->tank2.keyLeft = 'J'; g->tank2.keyRight = 'L'; g->tank2.keyForward = 'I'; g->tank2.keyFire = 'K'; g->tank2.colour = 0xff00ff00; g->tank2.gamePadIndex = 1; setInitialPositions(g); g->init = ootrue; }