Multi-ball powerup and smart collision detection

tylergarrisontylergarrison Member Posts: 1
edited March 2012 in Working with GS (Mac)
Hi, all.

I'm prototyping a 3/4 view side scrolling game that revolves around the mechanic of lane swapping to avoid obstacles and collect powerups. There are three lanes, and the ball can travel within the boundaires of those three lanes with the press of an up or down button, with Y movement being restricted to set increments needed to maintain center position in each lane.

I've got a bit of a complicated problem (at least to me) that involves a multi-ball powerup being collected, (in this case, an invisible actor stretched across the lanes that has a "collides with ball, spawn actors above and below current actor" rule) which then spawns a set of three balls on my game course, one ball in each lane. I have an invisible actor (let's call it "hazard") put on top of my obstacle graphics and have set my ball to destroy and switch to a "you lose" screen any time it collides with a hazard.

The problem is, when the multi-ball activates, the game will look at all three balls (since they are the same actor) and watch out for any and all collisions. Of course, there will be collisions within the first few seconds of using the multi-ball so the game will end prematurely even though there are 1-2 balls still in play.

Is there any way to set up some "smart" rules by saying "Ok, two of you can hit things and be destroyed...that's fine, but once you've done that, the last ball remaining becomes the focus again and anything that ball hits will end the level."

Any help would be much appreciated. Thanks to this forum and Tshirtbooth's youtube videos, I actually sort of feel like I know what I'm doing with Gamesalad now and it feels pretty dang awesome!

Comments

  • HappyKat78HappyKat78 Member, BASIC Posts: 173
    edited March 2012
    Just a thought... how about having a global attribute i.e. BallCount (integer) that's initially set to 1 and depletes by 1 when an actor is destroyed. When you get the 3-ball powerup you change BallCount to 3 so then as each of the balls gets destroyed it takes the BallCount back down by 1. You only fail the level when BallCount = 0.
Sign In or Register to comment.