Loop Inside Function Issues

0 favourites
  • 6 posts
From the Asset Store
SynthWave Loop Pack includes 68 seamless loops, founded on 11 original melodies.
  • The goal is to have the computer spawn programs after the player spawns programs.

    Player spawning is working 100% perfectly, computer spawning is not working at all.

    <img src="http://i.imgur.com/OGsxxZD.png" border="0">

    BoardGame.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'd say it's time to add some logging. Add the Browser plugin and add some Log lines in appropriate places to see the flow. It seems like you are calling a lot of the logic too many times, not controlling your states appropriately. I prefer Chrome for logging. Hit F12 to bring up the console.

  • I gave it a try.

    But here's what my console aid at the start of execution and the end of execution:

    iewport target-densitydpi is not supported. localhost:50001/:11

    Using WebGL renderer preview_prelude.js:39

    Shader '<default>' log: (empty) preview_prelude.js:39

    Shader '<point>' log: (empty) preview_prelude.js:39

    Max texture size: 16384 preview_prelude.js:39

    WebGL Extensions: WEBKIT_EXT_texture_filter_anisotropic,OES_element_index_uint,OES_standard_derivatives,OES_texture_float,OES_vertex_array_object,WEBKIT_WEBGL_compressed_texture_s3tc,WEBKIT_WEBGL_depth_texture,WEBGL_lose_context preview_prelude.js:39

    Point size range: 1 to 256 preview_prelude.js:39

    It didn't change during runtime so I'm not sure what the issue is.

    I agree my code above is redundant, but the reason why I split it like that was to further test and try to debug.

  • You need to add your own log lines so you can "watch" what is going on, and see which code is running and which isn't. Print out variables, etc to see if they are the right values.

  • This is when I really wish C2 had a step-through debugger :(

  • After further testing, I think the loop isn't working as intended. I could be wrong, but we'll see.

    Any insight from anyone who has done automated spawning for a fixed number of times before would be grateful.

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