Jump to content



0

Playfield Collision Problem


3 replies to this topic

#1 boski OFFLINE  

boski

    Space Invader

  • 13 posts
  • Location:Janesville, WI

Posted Thu Sep 15, 2011 8:21 PM

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!

Attached Files



#2 ScumSoft OFFLINE  

ScumSoft

    Moonsweeper

  • 331 posts
  • Location:Polysorbate 60

Posted Thu Sep 15, 2011 8:39 PM

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.

Attached Files



#3 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 20,923 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Thu Sep 15, 2011 9:50 PM

Check out this example program when you get a chance to see if it has anything you can use:

http://www.randomter...ss_coll_example

#4 boski OFFLINE  

boski

    Space Invader

  • 13 posts
  • Location:Janesville, WI

Posted Thu Sep 15, 2011 9:59 PM

Thank you so much for all your help. You've really taught me a lot. Can't tell you how much I appreciate it!




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users