Change size of player w/ boolean??
DrGlickert
Member Posts: 1,135
So I'd like for my character to change sizes for a few seconds if they overlap/collide with another actor.
So here is how I have it structured now. Actor 1 (player) and actor 2 (powerup), boolean attribute of PlayerSizeIncrease = set to false.
Player overlaps/collides with Powerup. Powerup has a behavior of: Rule: If overlap with player then; Timer FOR 10 seconds change PlayerSizeIncrease to True.
Actor has a Rule: If PlayerSizeIncrease is true then; Change attribute self.sizeX = 20, Change attribute self.sizeY = 20.
My player stays at the size of 20 by 20. How do I get player to return to original size. (I'd also like to do this with shrinking the player, I'd imagine it's just the same but with different numbers). Maybe I'm using my boolean statements incorrectly or something? Any thoughts?
So here is how I have it structured now. Actor 1 (player) and actor 2 (powerup), boolean attribute of PlayerSizeIncrease = set to false.
Player overlaps/collides with Powerup. Powerup has a behavior of: Rule: If overlap with player then; Timer FOR 10 seconds change PlayerSizeIncrease to True.
Actor has a Rule: If PlayerSizeIncrease is true then; Change attribute self.sizeX = 20, Change attribute self.sizeY = 20.
My player stays at the size of 20 by 20. How do I get player to return to original size. (I'd also like to do this with shrinking the player, I'd imagine it's just the same but with different numbers). Maybe I'm using my boolean statements incorrectly or something? Any thoughts?
Comments
Rule... if actor overlaps with another actor
self.width=2x
self.height=2x
Otherwise
self.width=X
self.height=X
I'd like for a Player Actor to interact with an actor that serves as a PowerUp/PowerDown function which will then effect the size of a 3rd Actor.
So, the Player collides/overlaps with the PowerUp/PowerDown actor which then effects the bullet/projectile size of the player. What's the best way to accomplish this? The way that I have it set up now is this;
1) PowerUp has a RULE where if it collides/overlaps with the Player then; TIMER: FOR 10 seconds set Boolean Attribute to True.
20 In the projectile/bullet actor it has a RULE if Boolean Attribute = true then; Change Attribute self.SizeX to 20, Change Attribute self.SizeY to 20.
Now, my bullet projectile won't go back to the original size after the 10 seconds. Not sure how to get it set back to the original size...
http://gamesalad.com/forums/topic.php?id=17368&replies=1#post-132079
I reposted with a question asked better.