Hi, I'm new. How do you reduce an enemys hp by clicking on an attack button?

Hi, I'm new. I'm making a turn based game and I made an attack button. I also made an attribute in the enemy actor called enemy1_health and it's 100. I want to to press the attack button and then the enemies health will go down by a random range of 1-5.

Best Answer


  • joloco2009joloco2009 Posts: 5Member

    How do i declare a global variable?

  • joloco2009joloco2009 Posts: 5Member

    Oh never mind I think you make a variable in the game tab.

  • joloco2009joloco2009 Posts: 5Member

    change attribute game.enemy1_health to game.enemy1_health-random(1,5)

    I tried writing the - but it doesnt seem to work.

  • AlchimiaStudiosAlchimiaStudios Posts: 943Member, PRO

    Not sure I understand. I've attached a demo for you to have a look at.

    Follow us: Twitter - Website

  • joloco2009joloco2009 Posts: 5Member

    It doesn't seem to work. I typed game.enemy1_HP-Random(5,10) and then I will display game.enemy1_HP in the enemy actor.

Sign In or Register to comment.