R0J0hound's Forum Posts

  • To use a shader to do it you'll need two things:

    1. A effect to do it

    2. To store the result of the effect into a texture so it can be used for the next frame.

    I'll start with 2 since that's somewhat simpler. You'll need the paster object to do this. Ideally you could have the effect on the paster object and paste it to itself every frame, but you can't paste an object onto itself. So instead you'll need two pasters with the effect and you'll need to alternate the object you're pasting from and pasting to.

    So basically the first time do this:

    Paster1: disable effect

    Paster2: enable effect

    Paster1: paste paster2

    Second time do this:

    Paster1: enable effect

    Paster2: disable effect

    Paster2: paste paster1

    And repeat from the start.

    As far as the effect there isn't really a good reference. My thought is you could do it with two effects.

    One to move the sand down. It's logic would look like this:

    If pixel=white and pixel below is black

    Then set result to black

    If pixel=black and pixel below is white

    Then set result to white

    Then the second would shift even or odd scanlines left or right.

    So the effects run for one frame could be:

    Down

    Odd left

    Down

    Odd right

    This really cries for a test, but webgl doesn't work on my computer.

  • You can do it by saving the player's positions to an array and setting the ghost's position from that.

    Example here:

  • The terrain was probably done with an array of the y position of the terrain at every X, or maybe just a polyline. It's fast because only the points near the bike need to be checked. That is an optimization that works in that particular case. C2 is more general purpose, but the same idea could be used with manual collision detection and response.

    The recommended C2 way is to make the terrain up of multiple objects that make up the curve. Tilemaps could be used but they may not give smooth enough curves depending on what you want.

    More ideas here:

  • Another one?

    It doesn't look trivial to wrap into C2.

  • 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.
  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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: