How do I make a simple damage display?

0 favourites
  • 7 posts
From the Asset Store
This sound pack features 117 game sounds : Axe,Punch Swing & Hit & Damage. This is a perfect collection for your game.
  • Continuing my RPG project,how do you make it so that a number spawns and shows the amount of damage taken by an enemy and disappear?I already figured out a very basic way of the turn based combat,I just need help displaying the damage.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi, first, how do you handle the damages? Does each enemy has its own events? Are they grouped under a family? Do you use a function?

  • Hi, depending on how you trigger the damage on the same line you need to spawn a text object and asign the dmg done to it's text function like bellow

    //lets take a "on clicked sprite" condition, with a variable "health" variable on a sprite object.
    on clicked Sprite > spawn text to sprite origin point 
    ----------------- > subtract from health 20
    ----------------- > set text.text to 20

    something like that, and then you can customize the text movement and damage done by adding more variables, like the 20 to be a randomized variable based on enemy armor/defence/health etc... but to spawn the actual visible damage you will eventually have something similar to above pseudo code.

    Hope this is what you meant.

    for a more concise solution, we need a screenshot atleast of the code area where you trigger the damage done to characters.

  • Here,this should help.

  • In event 5, create a text object with the fade behavior at enemy, and set text to damage amount.

  • In event 5, create a text object with the fade behavior at enemy, and set text to damage amount.

    event line 5, 1st action, and 8, 1st action, one for the player turn and one for the AI turn, spawn object text at the respective enemy/player character XY or imagepoint and set the text value to the enemy.dmg or player.dmg and as oosyrag said, having a fade out behavior on the text object will make it disapear after an amount of time, you can also set the bullet behavior and set angle of motion to 270 when text object is spawned, and make sure to untick the "set angle" from the text.bullet behavior default settings everything else you can leave as is.

    if you do it corectly, you should have a text object popup on the damaged party that will say the dmg done and the text will go upwards while slowly disapearing over 1 second as the default value of fade behavior is.

  • Thanks for the help :D

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)