0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

GOKI2で広げる拡張性【ModRightClick/ModResult入門】右クリック機能の実装とスコア演出の作り方

0
Last updated at Posted at 2026-03-13

ダウンロード

Avalanches&GOKI2は以下サイトのリリースタグ(Avalanches release version 2.x.y.yという表記)からAssetsにあるAvalanches-Release2.x.y.y.zipのリンクから最新の環境をダウンロードできます。

ModRightClick

ModRightClick はいわゆる右クリック機能を実装します。
まずは、モジュールを読み込みます。

; 右クリック関連機能
@load_module name=ModRightClick

ModRightClickが実装しているタグはright_clickタグだけです。

; 右クリックされた時に*right_click_1にジャンプする
@right_click enabled jump storage=ModRightClickTest target=*right_click_1

右クリックでジャンプする設定は以上です。

@right_click enabled call storage=ModRightClickTest target=*right_click_2

右クリックでコールする設定は以上です。
コールする場合は元の位置に戻る事ができます。
returnタグを使って元の位置に戻ります。

*right_click_2
ここは右クリックサブルーチンの中です。[p]
@return

右クリック設定を解除する場合は以下スクリプトで実施できます。

@right_click !call !jump

リザルト画面

特定のゲームではスコアがあります。
スコアを表示するためのモジュールがModResultです。
まずはモジュールを読み込みます。

; リザルト画面
@load_module name=ModResult

これでリザルト画面が使えるようになりました。

@image layer=base page=fore storage=result_sample visible

ModImageの機能を使って背景を表示します。
続けてリザルト画面を表示します。

@result_score_layers count=1
@result layer=0 center_x=300 center_y=300 width=200 height=80 font_size=56 score=10000 caption_color=0xFF0000 count_up_sound_storage=得点加算
@result completed_target=*result_completed time=5000
@result show
@s

result_score_layersタグでスコアを表示するレイヤの数を指定します。
スコアが複数ある場合、ここでレイヤの数を調整してください。

resuleタグでスコアの表示位置などを指定します。
layer=0でレイヤ0の設定を行います。
center_x=300 center_y=300 width=200 height=80でレイヤの位置とサイズを指定しています。
font_size=56 score=10000 caption_color=0xFF0000でフォントサイズや文字色などを指定しています。
count_up_sound_storage=得点加算でカウントアップ時に再生する効果音を指定します。
result completed_target=result_completed time=5000でリザルトの表示効果が終わった時にresult_completedを実行します。
表示効果の時間はtime=5000で指定します。
最後にresult showでリザルト画面を表示しています。
表示とともにスコア効果が始まります。

最後に後始末は以下のようにします。

*result_completed
@clear_image layer=0
@next

スコア表示が終わったら背景をクリアして次へ進みます。

関連する記事の一覧

GOKI2の関連する記事一覧

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?