2026年 6月 20日
PGGo = ペンギン号のプログラムの基本フレームを作る。
////////// PENGUIN号 //////////
; ペンギン号
#packopt runtime "hsp3dish.hrt" ; ウインドウズexe変換用
#include "hsp3dish.as" ; dish
#include "hspmath.as" ; 計算(round用)
gosub *main : end ; メインループ
#include "function.hsp" ; 関数
#include "save.hsp" ; save、load
#include "put.hsp" ; 表示
#include "sound.hsp" ; 音声
#include "shooting.hsp" ; シューティング
#include "strategy_map.hsp" ; 戦略マップ
#include "shop.hsp" ; 店
#include "option.hsp" ; オプション
#include "game_start.hsp" ; ゲームスタート
#include "title.hsp" ; タイトル
#include "initialize.hsp" ; 初期
*main
mainf=0 ; メインフラグ
while ;---------- メインルーチン ----------
switch mainf
case 0 : gosub *initialize : swbreak ; 初期
case 1 : gosub *opening : swbreak ; オープニング
case 2 : gosub *title_main : swbreak ; タイトル
case 3 : gosub *strategy_map : swbreak ; 戦略マップ
case 4 : gosub *shooting : swbreak ; シューティング
case 5 : gosub *shop : swbreak ; 店
case 6 : gosub *option : swbreak ; オプション
case 8 : gosub *game_over : swbreak ; ゲームオーバー
case 9 : gosub *ending : swbreak ; エンディング
swend
if mainf=10 : _break ; END
wend ;-------------------------------------
return
ワードプレスの Crayonと言うプログラムコードを表示するプラグインが使えなくなってしまって、と言うのも製作者の方が亡くなってるとか。
代わりのコード表示プラグインを使います、ソースコードが少し見難いと思うけど、ご容赦下さい。
基本フレームはずっと変わって無い。
gosub *main : end で一度だけメインルーチンを呼び出してる、戻ってきたら終わり。
メインルーチンは mainf メインフラグで管理、それぞれ処理に分岐する。
こんな感じでソースファイルを分けて #include(含む、その場所にファイルの記述を置き換える)して使う。
