コード例 #1
0
void start()

{

	//Set window title
	dbSetWindowTitle("Peg/Square Game");

	//Set randomizer
	int seed = dbTimer();
	dbRandomize(seed);

}
コード例 #2
0
ファイル: Main.cpp プロジェクト: Tahrima/Labyrinth
void DarkGDK ( void )
{
	dbSetWindowPosition ( dbScreenWidth()/3 , dbScreenHeight()/6); 
	dbSyncOn   ( );
	dbSyncRate ( 60 );
	dbSetWindowSize (800, 600);	
	dbSetWindowTitle ( "Labyrinth V 1.0");

	dbDisableEscapeKey ( );
	dbRandomize ( dbTimer ( ) );
	dbCLS();
	//Play();
	Menu();
	//Mazemain(2);
	return;
}
コード例 #3
0
ファイル: drunkenbot.c プロジェクト: MEDVEDx64/TestStuff
void drunkenbotLoop()
{
    if(!currentLevel.DrunkenBots[0].isEnabled) return;

    switch(currentLevel.DrunkenBots[0].direction)
    {
        case DIR_UP:    currentLevel.DrunkenBots[0].posY--; break;
        case DIR_RIGHT: currentLevel.DrunkenBots[0].posX++; break;
        case DIR_DOWN:  currentLevel.DrunkenBots[0].posY++; break;
        case DIR_LEFT:  currentLevel.DrunkenBots[0].posX--; break;
    }

    mv_tick ++ ;

    if(mv_tick >= STEP)
    {
        mv_tick = 0;
        dbRandomize();
    }

    /* Slayin` the Player */
    static SDL_Rect db_rect;

    db_rect.x = currentLevel.DrunkenBots[0].posX;
    db_rect.y = currentLevel.DrunkenBots[0].posY;
    db_rect.w = STEP;
    db_rect.h = STEP;

    static SDL_Rect plr_rect;

    plr_rect.x = player.posX;
    plr_rect.y = player.posY;
    plr_rect.w = STEP;
    plr_rect.h = STEP;

    if(isRectsCrosses(plr_rect, db_rect))
    {
        fprintf(stderr, "Player contacted with DrunkenBot\n");
        playerSlay();
    }
}