gumshoe2029's Forum Posts

  • I would think about re-organizing your code according to Object Oriented principles... chiefly modularity.

    i.e.

    Make a function that spawns a boss bullet a specific number of times. You can randomly generate the angle and image spawn point within certain bounds (it looks like your angle in bounded 230-310 deg). Then you can simply call that function and input a specific number of times that you want the boss to fire.

    In this function, use trigger once and a for loop with an input parameter for the loop number, something like:

    local variable randomImagePoint = -1;
    local variable randomAngle = -1;
    
    Function bossSuperAttack (Number_Of_Shots)
      trigger once
      for loopindex: 0 :: Number_Of_Shots
         randomImagePoint = round(random(6));
         randomAngle = round(random(81)) + 230;
         Spawn BossFinalWeapon on Layer 4 (image point randomImagePoint);
         Set angle to randomAngle;
         Wait 1 sec;
    [/code:297gb12x]
    
    Then when you want the boss to fire four shots (on a certain condition) you simply call bossSuperAttack(4).
    
    If you don't want the attack to come from different points each firing, simply move the random assignment up one level to the function, rather than inside the loop (like the above shows).
  • You should add a "type" tag to your JSON. Type can be "enemy" or whatever other types you have.

    Then just check the type on the way through the JSON and compare to the string "enemy" and only operate when that condition is true.

    Like:

    {
    type: "enemy",
    name: "jabi-jabi",
    stats: {
      attack: 22
      defense: 42
    }
    }
    [/code:2ty3d8jg]
  • It works for me, lol. Nicely done.

  • rex_hash is your savior. It will parse any (at least all that I have tested) valid JSON.

  • Are the bullets actually part of your game? Or just some kind of intro?

  • Use Pode's iFrame and load an entirely separate html file. That is far easier than building a new dynamic text/image loader.

  • Perfect, thanks.

  • Particularly for Text objects for HTML5 exports. Or more specifically in Kyatric 's CBhash plugin.

    UTF-8? or UTF-16?

    This post seems to indicate that JavaScript is usually in UTF-16.

  • np.

  • Well, I mean make it so that it only triggers once. (and Trigger Once will not work for this, because it 'resets' after like 5-10s)

    You may have to use a static (or global) boolean flag.

  • LOL. Not quite. I mean in Construct2. In the events tab of your Layout where you are doing stuff. You can select the events (turn them yellow) by clicking (or control clicking on a number of them) and then right click (to get the menu) and choose "Screenshot selection") then you can Paste (control-V) this screenshot into Microsoft Paint and save the image and post it to a website like http://postimage.org/ for free and include the link here, so I can see what you are doing.

    [ img ] http://s13.postimg.org/en5zxics5/image.png[ / img ]

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You need to make this not a global condition. It is actually reloading 60 times per second.

    Condition it on something like: "On start of layout", or whatever. Because ALL global events are repeated once per tick (~60 times per second).

  • Some of us are negligent in keeping C2 up-to-date. Could you post screenshots of the affected area? (highlight, right click and choose "Screenshot selection"; use control click as necessary to select areas)

  • Check your developer tools Javascript error tab (ctrl-shift-i on Chrome).

    Usually, this is due to a data.js, c2runtime.js, offline.appcache, or app.manifest file that didn't load properly.

  • Maybe try a "Tigger once" condition?