Heart Containers

butterbeanbutterbean Member Posts: 4,315
edited November -1 in Working with GS (Mac)
So I've decided instead of the health bar, to do the heart containers, only I've changed the graphic to a vegetable to represent the players health status.

I created a global game attribute: "player health" as integer, and placed 3 in as the number of health allotted

I created the image prototype for the player's health, and sized it down to 25/25, and named it player health.

I created a behavior within that icon, and did the following: Replication direction: 90 Copies: I clicked on game, and the attribute game.health, and for spacing I typed in 32

I then went into my Actor (main character) and created a rule:

When attribute changes: player collides with instance type: "enemy" (in this case a bird), game.health-1

What happens in game?

All 3 icons disappear once the actor hits the bird, and isn't destroyed after 3 hits

What am I doing wrong here?

I followed the "cave adventure" game demo on GameSalad and checked everything

Am I missing something?

Any help is appreciated! :)

Comments

  • JGary321JGary321 Member Posts: 1,246
    Did you do game.health = -1 or game.health = game.health-1??
  • butterbeanbutterbean Member Posts: 4,315
    I did game.health = game.health-1

    To raise my Blood pressure a few more points, and for kicks, I tried Game.Health = -1 and got the same results with a higher Blood pressure

    Still eliminates all 3 icons, and player is still allive after 3 hits:(

    I'm getting frustrated with this b/c I feel like it's something very basic I'm missing
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Does the bird get destroyed when it hits the player? If not, then there could be several collisions happening which will decrement the health each time.
  • butterbeanbutterbean Member Posts: 4,315
    It works now and here's what I did to fix it, I don't understand why it didn't work the other way, but nonetheless, it works!

    I kept all the attributes and rules the same, but I think dragging the image into a certain area on the screen made it work for some reason!

    I spent so much time on this, but feel accomplished that at least I tackled this one task which leant itself to be more difficult than I could have imagined!

    Thanks 4 your help everyone!
  • JGary321JGary321 Member Posts: 1,246
    Awesome that you go it done. When you gonna upload a sample of the game?
  • butterbeanbutterbean Member Posts: 4,315
    I wanted to finish some more graphics and animations since I've been focusing on the "difficult part" which is the game design and programming

    So fairly soon! I have 2 unfinished levels, and just trying to create the basics! :)
  • quantumsheepquantumsheep Member Posts: 8,188
    That's great news butterbean!

    I don't know if you'd find this useful, but generally, I try and get one level completed to as good as finished as it's going to be.

    It means less work in the long run I reckon as you only have to iron out the gameplay and bugs for one level. Other levels can be built on top of that (as in, if your basic game mechanics work, new levels can introduce new enemies).

    I guess it's personal choice though :)

    Now! Back to making your game please! ;)
    QS

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

  • butterbeanbutterbean Member Posts: 4,315
    True true Quantum! My focus before was the graphics and art, but I've been trying to tackle the programming and gameplay before venturing into all the little artistic parts.
    So yes! My focus is still that, but I also need graphics to create more gameplay as I've only drawn some of the basics

    Hopefully the 1st level will be near complete and I can put a demo up :)

    Thanks for the advice!
Sign In or Register to comment.