Help Counting Remaining pieces.

Hi, I'm trying to make a game sort-of like Zombie Drop or Doodle Destroy but i can't figure out how to make it so that the player has too get rid of all of the "bad blocks" before he can advance to the next level. Thanks!
`--Duplicate topics merged, Title edited to be more descriptive--tenrdrmer`
`--Duplicate topics merged, Title edited to be more descriptive--tenrdrmer`
Comments
So create an attribute like numberOfBadBlocks. In each object you want to track, at the start, before all the other rules, put a change attribute numberOfBadBlocks to numberOfBadBlocks+1, that way you don't have to manually change the attribute for each level.
Then, in the rule that destroy the bad blocks, put a change attribute numberOfBadBlocks to numberOfBadBlocks-1. That way, when all the bad blocks are destroyed, the attribute will be 0. Just check for it to be 0, and set the level finished behaviours there (:
Ok this is what you do. Make an attribute called Bad Blocks Left or whatever and set it to however many block will be in the level. Lets say there are 10 block to get rid of in a level. For each block make a rule that when the block is destroyed, change attribute Bad Blocks left to -1. So after ten blocks are destroyed, it = 0. So when you make the rule to advance to the next level, put in all of your conditions like the zombie has to be dead etc. and then make a condition that Bad Blocks left must = 0 also.
Email me for further explanation. redsox360blog@gmail.com - I may be able to make a youtube video on how to do this if you still don't get it.
Then in each level you put an actor say this
Change bad blocks to ? whatever number of bad blocks there are in that level
Then on the blocks that get destroyed say
touch is pressed
change attribute bad blocks -1
destroy actor
Then on the main character say overlaps or collides with good platform
attribute bad blocks=0 then change scene
There you go
Cheers, Weswog
Harryh1515
Member
Hi, I'm trying to make a game sort-of like Zombie Drop or Doodle Destroy but i can't figure out how to make it so that the player has too get rid of all of the "bad blocks" before he can advance to the next level, and that the "good block has to still be on the platform. Thanks!
56 minutes ago# Edit Quote comment
I like this
Weswog
Sous Chef
First you create an integer attribute thats called bad blocks
Then in each level you put an actor say this
Change bad blocks to ? whatever number of bad blocks there are in that level
Then on the blocks that get destroyed say
touch is pressed
change attribute bad blocks -1
destroy actor
Then on the main character say overlaps or collides with good platform
attribute bad blocks=0 then change scene
There you go
Cheers, Weswog
How would I access the bad blocks attribute through a rule for the good character???
Edit - QS - i've merged your two posts - please refrain from making new posts about the same subject when the original post is already very near the top. It clutters up the forum. Please use your original post (this one, in this case)
Good luck with your game
Matt.
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Edit: QS got it
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left