Discussions

SmileBASIC Community

Chickens32Chickens32

11/19/2016 3:23 PM ·Spoilers

Open Closed

Help! Collision!

O.K., I know collision, such as fighting or talking with people, but how do I make it so that if I were to run into, say, a building (screenshot) I wouldn't run through/over it? Is there any solution?

Advertisement

Comment

This post has no comments.

  • im just starting with smilebasic today myself, but does your bg objects have bounding boxes? im assuming your player will, lets say your bg object does, and that you bg objects bounding box would be checking y+1(bbox_bottom) and your player would be checking y-1(bbox_top). anyways if these two are true i would set your vspeed to 0, hspeed dont change and add an else statement for moving down

    Yeahs0
    Played
  • so the logic would be if player bbox_top and bbox_bottom wall and up and !down, vspeed equal 0 else if down, vspeed equals -2 or whatever

    Yeahs0
    Played
  • The higher a sprite number, the more on top it's going to be.

    Yeahs0
    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-EJ9-9E2M-978-3E9K

Report Violation to Miiverse Administrators

You cannot report posts made automatically by a software title.

Edit Post

Select an action: