natureparkgame.h

来自「需要clanlib 库 这个改进版的 在linux 很好玩 但是一定要有cl」· C头文件 代码 · 共 68 行

H
68
字号
#ifndef NATUREPARKGAME_H#define NATUREPARKGAME_H// Include necessary CL header files#include <ClanLib/display.h>#include <ClanLib/core.h>#include <string>using namespace std;#include "NP_core.h"class NatureParkGame {    public:        NatureParkGame();        NatureParkGame(string _player1_name, string _player2_name);        ~NatureParkGame();        void load_graphics();	// Load the game graphics        void paint();			// Paint the board and moves        void run();             // Game loop        void handle_key_press();        void reset_game();		// Clear the board    private:        bool alive, playing;        CL_ResourceManager resources;        CL_Slot key_press;        CL_Surface background;        NP_board *b1;        NP_board *b2;        CL_FramerateCounter framerate;        CL_Font font_fps;        CL_Font font_player_name;        CL_Font font_score;        int fps;        int winner;        string player1_name;        string player2_name;        int player1_score;        int player2_score;        void on_send_bad_units_1(int x);        void on_get_score_1(int x);        void on_game_over_1();        void on_send_bad_units_2(int x);        void on_get_score_2(int x);        void on_game_over_2();        CL_Keyboard keyboard;        void on_key_down(const CL_InputEvent&);        void on_key_up(const CL_InputEvent&);        unsigned int down_time[65536];        unsigned int first_time[65536];        CL_SoundBuffer sample_background;        CL_SoundBuffer_Session sample_background_session;};#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?