Jump to content
IGNORED

Playfield Collision Problem


boski

Recommended Posts

Hey guys,

 

I've just about finished my game "Balloon Protest." The object is to fill the top of the building with balloons, without the badguy popping them along the way. The last thing I need to do is program the playfielf-player0 collision portion. I just can't seem to get this part right. My current version leaves the balloon stuck to the playfield. Hopefully it's a quick look and a quick fix. If someone could take a look, I'd really appreciate it. Thanks a lot!

Balloon Protest3.bas

Link to comment
Share on other sites

You need to move your collision code to after the drawscreen this way it knows when P0x and P0y were in a non-collision zone, and can reset player0x and player0y to those coordinates. If they happen after a collision and before drawscreen, then it resets the P0x and P0y into the wall causing constant collision.

 

It's not smooth as ice collision, but it works for now. I also fixed the hold reset issue and show how a simple debounce works.

BalloonProtest3.bas

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...