Examples

    Documentation Tutorials

    Increase base stats

    Increase base stats

    This example builds upon the easy level progression example. If you haven’t already, take 2 minutes to go through it.

    Each time the player reaches a new Level compute floor(1000*pow(1.15,a)) and add the result (increase) to the Level up cost.

    • Registers compute formulas.
      • They get input from one or multiple Nodes in the form of variables and use the output of the computation to influence the state of Nodes or the flow of Resources.
      • The Level-up cost formula takes the Level number as input. It computes floor(1000*pow(1.15,a)) by replacing the variable a with the current Level number.
    • increase changes the XP requirement for leveling-up by adding the result of the computation on the Level-up cost Resource Connection
    • In this instance, +1 on increase is to be read as +1*floor(1000*pow(1.15,a))

    Each time the player reaches a new Level, trigger and Increase base stats: HP by 30, Stamina by 10 and Mana by 20.

    • ⇢ State Connections change the state of elements on the diagram
      • trigger uses * as a formula. This activates Increase base stats each time a resource reaches the Level Pool
    Contents

    Powering top studios around the World

    +350 Academic Institutions are already teaching Machinations

    All Rights Reserved © Machinations S.àr.l

    8217, Mamer, Luxembourg, accounts at BGL BNP PARIBAS, VAT number: LU30464284

    We use cookies for marketing and analytics. We also share information about your use of our site with our marketing and analytics partners who may combine it with other information that you’ve provided to them. You consent to our cookies if you continue to use our site. Learn more