Discussions

Petit computer 3 Community

ERRORzyangou289

10/26/2017 1:58 AM ·Spoilers

Open Closed

移動制限。

キャラクター同士の移動制限で 色々わからなくなってしまったのですが どうすればいいでしょうか?

Advertisement

Comment

This post has no comments.

  • 移動制限というか、平たく言うと当たり判定の取り方の事なんじゃないです? SPHITSP命令を使うとスプライト同士が重なってるけど当たっていない状態っていうのが判別し辛いので いっそのことSPOFS命令の引数に使っている座標情報から当たり判定をする処理を作ってみたらいいんじゃないです? もしくは見えてる絵とはサイズの違う「当たり判定専用」の透明なスプライトを作って、見えてる絵とSPOFSでの座標がリンクする様にSPLINK命令でセットにしちゃうとか。

    Yeahs1
    Played
  • 透明なスプライトを用意するのは面倒なので、ボクはSPHITRCを使いますね。

    Yeahs1
    Played
  • ボタンによってX,Yが変わる(95行目より)前に X1=X:Y1=Yとでもしておいて、 SP同士が当たったら、X=X1:Y=Y1として元の座標に戻せば移動制限ができそうです。 SPHITSP()は当たってないとき-1を返すので、そのままIF~THENに入れると当たってなくてもTRUEとなってしまうので僕は+1してます。 (もしつらら氏の言うように衝突判定の範囲を変えたいならSPCOLのヘルプの3ページ目が参考になると思います。) 色々書きましたが移動制限という言葉を勘違いしてしまってたらすみません(;'∀')

    Yeahs2
    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-2NLA-YFZ-RFY4

Report Violation to Miiverse Administrators

You cannot report posts made automatically by a software title.

Edit Post

Select an action: