Help Counting Remaining pieces.

Harryh1515Harryh1515 Member Posts: 17
edited November -1 in Working with GS (Mac)
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`

Comments

  • Harryh1515Harryh1515 Member Posts: 17
    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!
  • HachikoHachiko Member Posts: 330
    The logic behind it is to have a "counter" that check if the bad blocks in the level are equal to 0.
    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 (:
  • hman360hman360 Member Posts: 590
    First of all, please don't make two threads on the same topic.

    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.
  • hman360hman360 Member Posts: 590
    Hachiko beat me to it while I was typing.
  • Harryh1515Harryh1515 Member Posts: 17
    Thanks for all of the posts everyone!
  • Harryh1515Harryh1515 Member Posts: 17
    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!
  • Harryh1515Harryh1515 Member Posts: 17
    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!
  • WeswogWeswog Member Posts: 1,171
    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
  • Harryh1515Harryh1515 Member Posts: 17
    Thanks so much! The GameSalad community rocks!
  • Harryh1515Harryh1515 Member Posts: 17
    Wait how would I access the bad blocks attribute from the good block rule?
  • Harryh1515Harryh1515 Member Posts: 17
    Here is the context of my question:
    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)
  • Harryh1515Harryh1515 Member Posts: 17
    How would I access the bad blocks attribute through a rule for the good character???
  • DimensionGamesDimensionGames PRO Posts: 993
    Just to tell you your threads were merged as there was no need for two threads :) (wasn't me). I suggest you watch the cookbook video's and they will help you out. You just need to use the attribute browser and go under game and all the attributes are there (except of course self attributes)

    Good luck with your game :)

    Matt.
  • Harryh1515Harryh1515 Member Posts: 17
    I tried that but it isn't working. :( Some one please help me!
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    If it's no working then your doing something wrong. Post a screenshot of your rules if u can
  • Harryh1515Harryh1515 Member Posts: 17
    K
  • Harryh1515Harryh1515 Member Posts: 17
    How do i take a screen shot of my macbook screen?
  • quantumsheepquantumsheep Member Posts: 8,188
    Alt+shift+3

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Theres a keyboard shortcut but I'm my iPhone and forgot. So go into your apps go to utilities and open grab. Then at the top click capture screen

    Edit: QS got it ;)
  • Harryh1515Harryh1515 Member Posts: 17
    K i got the sceenshot using Command-Shift-3 but how do i post it here i tried already
  • Harryh1515Harryh1515 Member Posts: 17
    It worked!!!!! Thanks so much for all of the help everyone!!! GameSalad rules!
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Please stop making new threads with the same question. I have merged all three threads you started in the last 24 hours into one. Also please do not make threads with un descriptive titles. I have re named your thread with a descriptive title.
Sign In or Register to comment.