How do I make certain actors invincible to the enemy?

AcevPAcevP Member Posts: 1
edited November 2016 in Working with GS (Mac)

Hi everyone,

Firstly, I am new to GameSalad and the forum, this is my first post and I apologise if it is in the wrong category.

The first game I am currently working on involves shapes of different kinds moving vertically down the middle of the screen one after the other. As a shape moves down you have to press the right type of shape from the bottom panel so that the shape in the middle matches up.

The part I am stuck on is when an incorrect shape is matched up. I want the game to continue when the correct shapes are being matched, but as soon as the wrong shape is matched up I want the game to be over. I cannot figure out how to continue when matching correct shapes and discontinue when the incorrect shape collides/overlaps.

Any help will be appreciated.

Thanks.

Answers

  • JapsterJapster Member Posts: 672
    edited November 2016

    @AcevP said:

    The first game I am currently working on involves shapes of different kinds moving vertically down the middle of the screen one after the other. As a shape moves down you have to press the right type of shape from the bottom panel so that the shape in the middle matches up.

    The part I am stuck on is when an incorrect shape is matched up. I want the game to continue when the correct shapes are being matched, but as soon as the wrong shape is matched up I want the game to be over. I cannot figure out how to continue when matching correct shapes and discontinue when the incorrect shape collides/overlaps.

    Hmmm... I'm not sure that your post title matches what you're asking, but I will say that there are many ways of achieving this in GS...

    I'd advise against unlocking actors to get at other actor's attributes, this early on in your GS exploits (it's a bad coding habit to get into, and tends to come back and bite you (lost code, bad habits, etc) if it gets abused), but rather create a game attribute (Match_Shape_ID, etc...)...

    I'd then have your 'match' shape at the bottom set this attribute when it's set up/changes (even something as basic as an ID (probably better), or even the current image name), and then your moving shapes can check their own ID / Image against game attribute this once pressed. if it's a match, score! - if not, game over - maybe even jump to a pause/summary screen.

    But essentially, it's as easy as that to check - I'd write a quick project example to show you, but I'm at work in my day job, and someone else (Socks, Armelline, etc) will probably beat me to it with a better, more elegant one anyway! ;)

  • IceboxIcebox Member Posts: 1,485
    edited November 2016

    Hello @AcevP I attached a demo hope it helps , you can do it in different ways

  • JapsterJapster Member Posts: 672

    Ha ha! - Nice one @Icebox - Knew someone would get in there... :smiley:

Sign In or Register to comment.