本文整理汇总了C++中Snake::GetSnakeCells方法的典型用法代码示例。如果您正苦于以下问题:C++ Snake::GetSnakeCells方法的具体用法?C++ Snake::GetSnakeCells怎么用?C++ Snake::GetSnakeCells使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Snake
的用法示例。
在下文中一共展示了Snake::GetSnakeCells方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: start_game
//.........这里部分代码省略.........
draw = true;
}
}
/* button conditions */
if (play_button.MouseOverButton(mouse_x, mouse_y) && !play_button.StillOverButton)
{
play_button.play_over_button_sound = true;
}
if (options_button.MouseOverButton(mouse_x, mouse_y) && !options_button.StillOverButton)
{
options_button.play_over_button_sound = true;
}
if (exit_button.MouseOverButton(mouse_x, mouse_y) && !exit_button.StillOverButton)
{
exit_button.play_over_button_sound = true;
}
/* KEYBOARD */
if (events.type == ALLEGRO_EVENT_KEY_UP)
{
switch (events.keyboard.keycode)
{
case ALLEGRO_KEY_ESCAPE:
{
done = true;
break;
}
case ALLEGRO_KEY_SPACE:
case ALLEGRO_KEY_ENTER:
{
/* STARTING GAME NOW */
new_direction = RIGHT;
speed_up = 0;
snake.ResetSnakeDetails();
apple.NewApple(snake.GetSnakeCells());
gameState = PlayGame;
}
}
break;
}
/* ------------ NOW DRAWING ------------ */
if (draw)
{
/* drawing wallpaper */
if (Fullscreen)
{
al_draw_scaled_bitmap(BigWallpaperBitmap, 0, 0, al_get_bitmap_width(BigWallpaperBitmap), al_get_bitmap_height(BigWallpaperBitmap), 0, 0, CurrentScreenWidth, CurrentScreenHeight, NULL);
}
else
{
al_draw_bitmap(SmallWallpaperBitmap, 0, 0, 0);
}
/* -- play button -- */
if (play_button.MouseOverButton(mouse_x, mouse_y))
{
play_button.SetButtonColor(LightBlue);
/* button pressed */
if (left_mouse_button_down)
{
play_button.pressed_button = true;
play_button.SetButtonColor(DarkBlue);
}
/* button released */
else if (left_mouse_button_up)
{