Problems with collisions, recycling, & booleans???
DrGlickert
Member Posts: 1,135
I'm working on "recycling" some actors (we'll call them blocks) for my game. I'd like for the blocks to be "shot" then move out of the screen, only to return later.
What's the best way to set this up? I'm having problems with this;
I have an attribute on the block; self.InPlay = false
When it enters the visible screen I have it set to change to true in a rule (comes in from the top so when self.position.Y < 480 change attribute self.InPlay to TRUE OTHERWISE change attribute self.InPlay to false.
Followed by a rule that if InPlay = true then to collide with other blocks, shots, and walls (I'm assuming that the otherwise would be that it doesn't collide - this is my problem**)
If the block is hit by a shot I have a rule that does the following;
change self.InPlay to false, set alpha to 0, move to a random position above the scene, add to the score, then a timer that turns the alpha back on after a few seconds.
My problem is that the collisions are still there the blocks are now invisible but still colliding. Where am i going wrong here?!?! Am I wrong about the collisions not being turned off? If so, how do I turn collisions off?
What's the best way to set this up? I'm having problems with this;
I have an attribute on the block; self.InPlay = false
When it enters the visible screen I have it set to change to true in a rule (comes in from the top so when self.position.Y < 480 change attribute self.InPlay to TRUE OTHERWISE change attribute self.InPlay to false.
Followed by a rule that if InPlay = true then to collide with other blocks, shots, and walls (I'm assuming that the otherwise would be that it doesn't collide - this is my problem**)
If the block is hit by a shot I have a rule that does the following;
change self.InPlay to false, set alpha to 0, move to a random position above the scene, add to the score, then a timer that turns the alpha back on after a few seconds.
My problem is that the collisions are still there the blocks are now invisible but still colliding. Where am i going wrong here?!?! Am I wrong about the collisions not being turned off? If so, how do I turn collisions off?
Comments
but thats just me
also make sure u check the "otherwise" sections. sometimes putting this in there can mess things up
qbanyto @ gmail dot com