Attributes?

blastfactorblastfactor Member Posts: 72
edited November -1 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 Member Posts: 1,095
    In the enemy actor:

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

    Hope this helps.
    ~CTM
  • blastfactorblastfactor Member Posts: 72
    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 Member Posts: 3,186
    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 Member Posts: 72
    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 Member Posts: 1,095
    put the destroy AFTER the change attribute. This should work
    ~CTM
  • calvin9403calvin9403 Member Posts: 3,186
    do you use a self attribute
  • calvin9403calvin9403 Member Posts: 3,186
    CowTechMan said:
    put the destroy AFTER the change attribute. This should work
    ~CTM

    I think that doesn't matter
  • blastfactorblastfactor Member Posts: 72
    that isnt working either... maybee its because my attribute is a real number?
  • blastfactorblastfactor Member Posts: 72
    what is a self attribute?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    you add the attribute into the actor, not into the game attributes
  • calvin9403calvin9403 Member Posts: 3,186
    attribute needs to be an integer
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    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 Member Posts: 3,186
    then what is the problem, maybe he has to upload the project
  • calvin9403calvin9403 Member Posts: 3,186
    mail calvin9403 at hotmail.com
    if you have more question
  • blastfactorblastfactor Member Posts: 72
    ok, i made it into a self attribute and substituted that in for the game attribute, and it.... still dont work :(
  • blastfactorblastfactor Member Posts: 72
    and thank you calvin, i will if i need so
  • blastfactorblastfactor Member Posts: 72
    anyone have anymore ideas?
  • quantumsheepquantumsheep Member Posts: 8,188
    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: https://quantumsheep.itch.io

  • calvin9403calvin9403 Member Posts: 3,186
    I just get back, why don't you send me your project
  • blastfactorblastfactor Member Posts: 72
    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 Member Posts: 3,186
    I don't understand that, I think you need to mail to me
  • calvin9403calvin9403 Member Posts: 3,186
    how about making a reload time
  • calvin9403calvin9403 Member Posts: 3,186
    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 Member Posts: 3,186
    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 Member Posts: 72
    when i make the attribute, do i make it in the actor? or in the game?
  • calvin9403calvin9403 Member Posts: 3,186
    game
  • blastfactorblastfactor Member Posts: 72
    i dont understand 3 and 4.. would you please go more in depth?
  • calvin9403calvin9403 Member Posts: 3,186
    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 Member Posts: 3,186
    why don't you send me your project
  • blastfactorblastfactor Member Posts: 72
    i dont know how to make a fire button :(
Sign In or Register to comment.