nSnake
A ncurses implementation of the classic Snake game
src/engine.h
Go to the documentation of this file.
00001 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
00002  * nSnake - The classic snake game with ncurses.                              *
00003  * Copyright (C) 2011-2012  Alexandre Dantas (kure)                           *
00004  *                                                                            *
00005  * This file is part of nSnake.                                               *
00006  *                                                                            *
00007  * nSnake is free software: you can redistribute it and/or modify             *
00008  * it under the terms of the GNU General Public License as published by       *
00009  * the Free Software Foundation, either version 3 of the License, or          *
00010  * any later version.                                                         *
00011  *                                                                            *
00012  * This program is distributed in the hope that it will be useful,            *
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
00015  * GNU General Public License for more details.                               *
00016  *                                                                            *
00017  * You should have received a copy of the GNU General Public License          *
00018  * along with this program.  If not, see <http://www.gnu.org/licenses/>.      *
00019  *                                                                            *
00020  * homepage: http://sourceforge.net/projects/nsnake/                          *
00021  *                                                                            *
00022 \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
00023 
00030 #ifndef ENGINE_DEFINED
00031 #define ENGINE_DEFINED
00032 
00033 
00036 struct screen_t
00037 {
00038         int width;  
00039         int height; 
00040         int delay;  
00041 };
00042 
00043 
00045 extern struct screen_t screen;
00046 
00047 
00048 void draw_background ();
00049 void draw_borders ();
00050 void draw_fruit ();
00051 void draw_fruit_bonus ();
00052 void draw_player ();
00053 void draw_score ();
00054 
00055 void engine_exit ();
00056 void engine_init ();
00057 void engine_show_game_over ();
00058 void engine_show_main_menu ();
00059 void engine_show_pause ();
00060 void engine_show_screen ();
00061 
00062 int  get_main_menu_input (int* current_option);
00063 void engine_get_game_input ();
00064 void get_game_over_input ();
00065 void get_pause_input ();
00066 
00067 void start_atrribute (int attr);
00068 
00069 #endif
 All Data Structures Files Functions Variables Enumerations Defines