R0J0hound's Forum Posts

  • To best show what static does make an event like this:

    +-------------------------+
    | every tick              |
    +-------------------------+
       local number a=0
       local static number b=0
       +----------------------+
       | every tick           | add 1 to a
       |                      | add 1 to b
       |                      | set text to a&" "&b
       +----------------------+[/code:3p392zri]
    
    notice that you'll get the text set to two numbers "1" and an increasing number.  Basically static makes the local save it's value.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You just drag the variable around to change if it's local or global. Global variables are all the way to the left and local are nested under something else.

    Constant, like you say can't change.

    Static makes the variable like a global in that it keeps it's value and isn't reset every time like locals are.

  • Here's an example with the family idea:

    https://dl.dropboxusercontent.com/u/542 ... bbles.capx

  • There are other topics about this. The simplest is to use a family where the family contains "Sprite". Then you can do:

    Sprite is overlapping family

    That way each are picked in their own type.

  • You could use an equation like this to get the value to go from 0 to 180 and back to 0 based on time.

    value = abs((time*speed+180)%360-180)

    If you set speed to 180 it will take a second to go to 180 and another second to go back to 0.

  • Here's the example you were thinking of:

    It's not set up to handle tilemaps.

    Also if you search my posts about "collision normal" you can find some ways to find the angle of the surface an object is colliding with.

  • This topic could be useful:

  • It was done with perlin noise, or more precisely a creative combination of multiple perlin noise.

  • jogosgratispro

    Not very I'd imagine. This terrain is based on an idea that mudmask linked to. It just randomizes the array then smooths it for a island like look. Side view stuff is probably better done with perlin noise I'd imagine.

  • MathNook

    The simplest way would be to use perlin noise instead of an array of random values. There's a noise plugin that can help with that. Not sure if the example can be tweaked that way.

    Another idea is to loop the array. Basically you have a front index and a back index. You start with the array filled and back as 0. Front is the current position. Once it's a certain distance from back, the value at back is set to a new random value and one is added to back. Or something like that. I'd probably start from scratch since the idea is different enough.

  • Without a capx it's hard to come up with a solution. You could get it all in one go with a loop

    repeat RegexMatchCount times

    --- dictionary: add key RegexMatchAt(loopindex)

    To make it so it doesn't stop at the first occurrence you could use "g" as the flags parameter. That way you wouldn't need to replace the text and make the regex need to process the text again.

    There may be other ways to do it. Maybe this could give ideas:

  • How are you getting the string into construct? Pasting it into a variable? Or is it happening when loading a file from Ajax?

  • Newer versions of the chipmunk library can have segments collide with segments, but it wasn't ported to JavaScript when I made the plugin.

    I'm guessing you got that error because the inertia was set to zero. Maybe because of zero area. Just make it a hair thicker.

  • MathNook

    That's all the terrain that was generated, and after that it goes to 0. Changing the size of the array will change how much is generated.

  • You can do more but it starts to look hairy.

    op="+" ? var1+var2:(op="-" ? var1-var2:(op="/" ? var1/var2:(op="*" ? var1*var2:sqrt(-1))))