天天看點

利用easyx實作C++飛機大戰【C++小項目】利用easyx實作C++飛機大戰【C++小項目】WarOfPlane

利用easyx實作C++飛機大戰【C++小項目】

代碼見 https://github.com/FLUENTYAN/WarOfPlane

利用easyx實作C++飛機大戰【C++小項目】利用easyx實作C++飛機大戰【C++小項目】WarOfPlane

​​​​​​​​​​​​​

WarOfPlane

該飛機大戰源碼由main.cpp以及遊戲中各類元素(飛機、子彈等)的類組成,main.cpp是遊戲的主邏輯,各種類的定義在各自的頭檔案中,類中成員函數的實作在與類頭檔案同名的cpp檔案中

  • enemyBullet.h 敵人子彈
  • enemyPlane.h 敵人飛機
  • playerBullet.h 玩家子彈
  • playerPlane.h 玩家飛機
  • interface.h 各個界面

interface.h 則是遊戲各個界面的函數聲明,實作在同名源檔案中

繼續閱讀