GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Attributes?

blastfactorblastfactor Posts: 72Member
edited 9:43AM in Miscellaneous
How to make it so that if "Enemy1Health" = 0 then delete Enemy1?
And how do i make it so that when Enemy1 deletes then "money" = "Money+20?"
«1

Comments

  • VoidedSkyVoidedSky Posts: 1,095Member
    In the enemy actor:

    --Rule
    ---When attribute self.health = 0 then:
    ----Change game.money to game.money + 20
    ----Destroy

    Hope this helps.
    ~CTM
  • blastfactorblastfactor Posts: 72Member
    thank you so much for your help, this is my first game (if you cant tell allready haha) i have one more question, whenever i go to make graphics/images, and when i bring them into gamesalad, they are ALLWAYS a square, i can never get it so that only the image is there and the "corners" arent there. and i cant make images transparent... is there a certain program that people use? because that will be really helpful
  • calvin9403calvin9403 Posts: 3,190Member
    when you make an image in photoshop (or what ever software you use, select new layer, draw it on the new layer, and delete the background layer. save it as an PNG and you are done

    Calvin
  • blastfactorblastfactor Posts: 72Member
    Thanks guys, but what CowTechMan told me isnt working

    what ive got here

    Rule:
    -when acter overlaps or collides with Bullet1
    -Change "game.Enemy1Health" to game.Enemy1Health -1

    Rule:
    -when game.Enemy1Health = 0
    -Destroy this actor
    -change attribute game.Money to game.Money + 20

    i made sure that the origional attribute is set to 2 and stuff... anything im doing wrong?
  • VoidedSkyVoidedSky Posts: 1,095Member
    put the destroy AFTER the change attribute. This should work
    ~CTM
  • calvin9403calvin9403 Posts: 3,190Member
    do you use a self attribute
  • calvin9403calvin9403 Posts: 3,190Member
    CowTechMan said:
    put the destroy AFTER the change attribute. This should work
    ~CTM

    I think that doesn't matter
  • blastfactorblastfactor Posts: 72Member
    that isnt working either... maybee its because my attribute is a real number?
  • blastfactorblastfactor Posts: 72Member
    what is a self attribute?
  • JohnPapiomitisJohnPapiomitis Posts: 6,256Member
    you add the attribute into the actor, not into the game attributes
  • calvin9403calvin9403 Posts: 3,190Member
    attribute needs to be an integer
  • JohnPapiomitisJohnPapiomitis Posts: 6,256Member
    calvin9403 said:
    attribute needs to be an integer

    that doesnt matter. The only difference between real and interger is that real attributes can be deciamls
  • calvin9403calvin9403 Posts: 3,190Member
    then what is the problem, maybe he has to upload the project
  • calvin9403calvin9403 Posts: 3,190Member
    mail calvin9403 at hotmail.com
    if you have more question
  • blastfactorblastfactor Posts: 72Member
    ok, i made it into a self attribute and substituted that in for the game attribute, and it.... still dont work :(
  • blastfactorblastfactor Posts: 72Member
    and thank you calvin, i will if i need so
  • blastfactorblastfactor Posts: 72Member
    anyone have anymore ideas?
  • quantumsheepquantumsheep Posts: 8,188Member
    Make a self attribute called "health" - should be an integer.

    When overlaps or collides with bullet

    Change attribute self.health to self.health-1

    If self health is less than or equal to 0,
    change attribute money to money +20
    destroy actor

    That should do it.

    Cheers,

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: http://www.quantum-sheep.com

  • calvin9403calvin9403 Posts: 3,190Member
    I just get back, why don't you send me your project
  • blastfactorblastfactor Posts: 72Member
    i figured it out guys! what was happening was when i would put what the attribute was going to change to, i would just type it in instead of finding it and making it be in that blue oval haha :D and i have one question... i have it so that every 1.5 seconds it shoots a bullet, but whenever you press the fire button (space for now, untill i figure out how to make a button haha) it shoots, but when you press it, it wait to shoot instead of shooting right away... so, i made it so that there is a spawn actor out and inside of the timer, but then you can make it so that you shoot faster when you press the button more often (which i dont want)
    thanks for the help buy the way
  • calvin9403calvin9403 Posts: 3,190Member
    I don't understand that, I think you need to mail to me
  • calvin9403calvin9403 Posts: 3,190Member
    how about making a reload time
  • calvin9403calvin9403 Posts: 3,190Member
    make an attribute reload.(a boolean)
    set it to false
    when touch is press change it to true
    make another rule that says when attribute reload is true after1.5s ,change attribute to false
    and you can only shoot when it is false
  • calvin9403calvin9403 Posts: 3,190Member
    sorry that I was to rush
    1.make an attribute reload.(a boolean)
    2set it to false
    3.when touch is press and when attribute reload is false change it to true
    4.make another rule that says when attribute reload is true after1.5s ,change attribute to false
    5.and you can only shoot when it is false
  • blastfactorblastfactor Posts: 72Member
    when i make the attribute, do i make it in the actor? or in the game?
  • calvin9403calvin9403 Posts: 3,190Member
    game
  • blastfactorblastfactor Posts: 72Member
    i dont understand 3 and 4.. would you please go more in depth?
  • calvin9403calvin9403 Posts: 3,190Member
    3.when you touch( the fire button) actor, change attribute reload to true
    4.when touch is press and reload is true change attribute to false (after1.5 sec)
  • calvin9403calvin9403 Posts: 3,190Member
    why don't you send me your project
  • blastfactorblastfactor Posts: 72Member
    i dont know how to make a fire button :(
«1
This discussion has been closed.