Discussions

Petit computer 3 Community

はすのhotate12345

09/19/2017 1:58 PM ·Spoilers

Open Closed

選択肢の作り方が分かりません。

プチコン初心者です。選択肢を表示し十字キーで選択するところまでは出来たのですが、Aボタンで決定するプログラムで詰まってます…。Aボタンを押すと、選択肢に関わらず@MAINに行くプログラムしか分かりません…。@LBL3を選択するとゲーム(@MAIN)へ、@LBL2を選択するとゲームを閉じる といったものを作りたいのですが、この場合どうすればいいのでしょうか。

Advertisement

Comment

This post has no comments.

  • X=X-1 SPSHOW 3 SPSHOW 8 GOTO @LBL2 の区切りはスペースではなく「:」が正しいです エラーにはならないのはプチコンのバグと思ってください。混乱のもとになるのでよくないです。 X=X-1:SPSHOW 3:SPSHOW 8:GOTO @LBL2 あとは IF B==#LEFT THEN ~~~~~ は IF B==#LEFT THEN  ~~~~~ (複数行可能) ENDIF と複数行で書いて読みやすくすることもできます 横に長くなって辛いなら書き換えてみてください さて本題です、このプログラムはカーソルの位置がどちらにあるのか記憶されていません 最低限の書き換えで実現するなら、まず @LBL2 の下に「SEL=0」 @LBL3の下に「SEL=1」という行を追加します。SELという新しい変数にカーソルの位置を覚えさせます

    Yeahs3
    Played
  • そしてAボタンを押された際に、カーソル位置で分岐させます。「IF SEL==0」ならゲームを閉じて、「IF SEL==1」なら@MAINLOOP に飛ぶ、とすればうまくいくはずです

    Yeahs3
    Played
  • 解決しました!ありがとうございました。

    Yeahs1
    Played

Add a Comment

You must sign in to post a comment.

Sign in using a Nintendo Network ID to connect to users around the world by writing posts and comments and by giving Yeahs to other people's posts. You can create a Nintendo Network ID using your Wii U console or your system in the Nintendo 3DS family.

Use of Miiverse Details about Miiverse

Report Violation to Miiverse Administrators

You are about to report a post with content which violates the Miiverse Code of Conduct. This report will be sent to Nintendo's Miiverse administrators and not to the creator of the post.

Violation Type:

Post ID: 3DB-NBL7-DPU-2NL8-NPH-AH8E

Report Violation to Miiverse Administrators

You cannot report posts made automatically by a software title.

Edit Post

Select an action: