dop2000's Forum Posts

  • It doesn't matter.. Pin or add healthbar as a child to each character. You can use "Pick child" and update its width when needed.

  • If there was one elf sprite, the easiest solution would've been creating a container with the healthbar.

    With multiple sprites I suggest using the new scene graph feature.

    On Elves Created -> create a healthbar and add it as a child to the elf. When elves' health changes, pick child instance of the healthbar and update its width.

  • It's difficult to style form controls, and there are many other problems with them.

    Use TiledBackground object instead, it's very easy - just change its width.

    On every tick -> Bar Set width to 300*(Player.health/100)

    where 300 is the maximum width, and 100 is the maximum health.

    Here is another example:

    howtoconstructdemos.com/simple-healthbar

  • Have you tried this script in Construct 3?

    On Button clicked event -> right click on "Add action", select "Add script" and paste that JS code.

    Or, if you are using Construct 2:

    On Button clicked event -> Browser Execute Javascript "your script here"

  • It's not executed once, it's executed as many times as specified in the loop. But if you are using a fixed value for the Wait action, all iterations will be completed after the same delay. For example:

    Repeat 10 times
    Wait 0.5s
    Add 1 to variable
    

    After 0.5 second delay all scheduled actions will happen at the same time. So the variable will be incremented by 10.

    Basically, it's equal to this:

    Wait 0.5s
    Add 1 to variable
    Add 1 to variable
    Add 1 to variable
    Add 1 to variable
    Add 1 to variable
    Add 1 to variable
    Add 1 to variable
    Add 1 to variable
    Add 1 to variable
    Add 1 to variable
    
  • You can use wain in loops, here is an example:

    For n=0 to 10
     Wait (loopindex*0.5)
     Subtract 1 from var
     Text set text to var
    
  • You can use instance or global, it's up to you.

  • You can do this in a script:

    runtime.objects["ObjName"].getFirstInstance().width

    In events the only way to do this is to add all objects into a family and pick family instance by ObjectTypeName:

    System Pick Family by evaluate Family.ObjectTypeName="ObjName"

    After that you can use Family.width

  • Use Timer behavior on the player. For example, when you cast a spell, set variable SpellEnabled=false and start a timer "cooldown". On timer event, set SpellEnabled=true

  • You mean "not equal 12"? Right-click the condition and select Invert.

  • Try adding Keyboard object and use this event:

    Keyboard on Enter key pressed
    TextBox compare text = "12" ............
    
  • You can rename your project file from C3P to ZIP extension, unpack and replace files in Images folder.

  • Yeah, I didn't understand the question either. What's wrong with "Object Compare instance variable" condition?

  • Everything slows down because you have "Set time scale to 0.3" action for some reason.

    And the player drifts because you set deceleration=0 in behavior properties.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads