本文整理汇总了C++中Tetris::generateTimer方法的典型用法代码示例。如果您正苦于以下问题:C++ Tetris::generateTimer方法的具体用法?C++ Tetris::generateTimer怎么用?C++ Tetris::generateTimer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tetris
的用法示例。
在下文中一共展示了Tetris::generateTimer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
int
Tetris::gameNew(GtkAction *action, void *d)
{
Tetris *t = (Tetris*) d;
if (t->timeoutId)
{
g_source_remove(t->timeoutId);
t->timeoutId = 0;
/* Catch the case where we started a new game without
* finishing the old one. */
if ((t->scoreFrame->getScore() > 0) && t->inPlay)
t->high_scores->add (t->scoreFrame->getScore());
}
t->inPlay = true;
int level = t->cmdlineLevel ? t->cmdlineLevel : t->startingLevel;
t->fastFall = false;
t->scoreFrame->setLevel(level);
t->scoreFrame->setStartingLevel(level);
t->field->setUseTarget (t->useTarget);
t->generateTimer (level);
t->field->emptyField(t->line_fill_height,t->line_fill_prob);
t->scoreFrame->resetScore();
t->paused = false;
t->field->generateFallingBlock();
t->field->redraw();
t->preview->previewBlock(blocknr_next, rot_next, color_next);
gtk_widget_queue_draw(t->preview->getWidget());
gtk_action_set_visible(t->pause_action, TRUE);
gtk_action_set_visible(t->resume_action, FALSE);
gtk_action_set_sensitive(t->pause_action, TRUE);
gtk_action_set_sensitive(t->end_game_action, TRUE);
gtk_action_set_sensitive(t->preferences_action, FALSE);
t->field->hidePauseMessage();
t->field->hideGameOverMessage();
games_sound_play ("gnometris");
return TRUE;
}