HelmetPIg's Forum Posts

  • Very useful function especially with the timescaling independent of system time. This seems to error out when I try to save state with it running though. Any advice/fix please?

    To duplicate -just add an action: System>'Save game to slot "mysave"

    Error message: Uncaught TypeError: this.timers.saveToJSON is not a function

    (line 179, col 39)

  • Thank you rexrainbow!

  • Anyway to show all my collision boxes similar to the 'Show collision polys' button in the editor? Like showing hitboxes in CSGO or Touhou? Preferably not by adding a ton of new sprites everywhere..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi rexrainbow -- just wondering, what are the primary benefits of this vs. having an instanced variable on the sprite that control what it does? I'm thinking about this in terms of enemy AI.

    Sprite.statevariable = 0 then do X

    Sprite.statevariable = 1 then do Y

    etc.

    Does this result in better performance? Something else?

  • I'm wondering what the best way of optimizing code for a number of different AI would be.. currently using

    on EnemyFamily created [general enemy initialization code]

    on Enemy1 created [enemy specific initialization code]

    on Enemy2 created [enemy specific initialization code]

    on Enemy3 created [enemy specific initialization code]

    if Enemy1.count > 0

    [Enemy1 specific AI code]

    if Enemy2.count > 0

    [Enemy2 specific AI code]

    if Enemy3.count > 0

    [Enemy3 specific AI code]

    ... etc for 40 or so different enemies. Already using families to group most of the similar code but there's quite a few unique things to each enemy (e.g., teleportation, spell casting, etc.). Profiler tells me my enemy code is still using a good chunk of CPU time even when there are no enemies spawned. Wondering if there is a better way to segment off enemy specific code so it doesn't keep checking to run if nothing is spawned. For example, is it better to check if the enemy sprite is visible? Or have a Global variable increase if there is that type of enemy spawned?

    Thanks for any help guys!