R0J0hound's Recent Forum Activity

  • Slider -> set CSS style "transform" to "rotate(90deg)"

  • The tilemap has no angle so the most you can do is rotate the angle of the layer the tilemap is on.

  • Doing it with an array is just as easy. The only difference really is you're setting a value to the array instead of creating the object right away. You could do it in two passes but really it's basically the same as above.

    array for each xy

    --- array set at (array.curX, array.curY) to noisejs.perlin2(this.curx/this.width*noise_scaling, this.cury/this.height*noise_scaling) + lerp(-1, 1, this.cury/this.height)

    array for each xy

    --- array set at (array.curX, array.curY) to this.curValue>0

    With that it's just one material. For two you could do

    array for each xy

    --- array set at (array.curX, array.curY) to round(max(this.curValue*2))

  • Use your own hosting like Dropbox or something instead of the arcade.

  • You could use the distance() function or use the pythogerian theorem to find the hypotonuse.

    Hypotenuse = sqrt(x^2 + y^2)

  • Well I only know what I read about it and it isn't really something you learn in a school.

    Basically the plugin allows you to make perlin or simplex noise (look them up to see what they look like). The plugin uses a "seed" for the randomness so with the same seed noisejs.perlin2(0.5, 0.1) for instance will always give the same value, whereas c2's random() will give a different value every time.

    Now from what I've read and messing with the plugin this is some info about the expressions.

    noisejs.perlin2(x, y) returns a value from -1 to 1.

    The example capx translates that to a value from 0 to 100 for opacity. You could just as well set it to 100 or 0 by comparing if the value of noisejs.perlin2 is greater than 0. That would give blocks or no blocks instead of smooth noise.

    The parameters x and y should be non integers to give differing values. That is why the example divides loopindex("x") and y by 10 in the expression. I guess that can be thought of as a scaling factor. If you use just integers you'll get just 0 returned.

    Now that we've got some of the low level stuff out of the way the idea to create hills instead of just blobs is by combining perlin noise with something else. This link shows to combine the perlin noise with a vertical gradient to get the hills. After that the rest of the info loses me, probably because it's for some noise library.

    Ok to use that let's do what the example capx does and loop over all the squares. This can be done any way you want whether with an array or no. It makes little difference.

    width = 100
    height =100
    noise_scaling = 1
    
    for x from 0 to width-1
    for y from 0 to height-1
    ---- solid?[/code:isiwr3f9]
    
    So your perlin noise at every point would be:
    noisejs.perlin2(x/width, y/height)
    or with scaling noisejs.perlin2(x/width*noise_scaling, y/height*noise_scaling)
    
    We also only want block or no block instead of shades of blocks so we can just place a block if the perlin noise is greater than 0.  It would then look like this:
    
    [code:isiwr3f9]width = 100
    height =100
    noise_scaling = 1
    
    for x from 0 to width-1
    for y from 0 to height-1
    noisejs.perlin2(x/width*noise_scaling, y/height*noise_scaling) > 0
    --- create block[/code:isiwr3f9]
    
    So far so good but that just gives blobs everywhere.  A solution is to add a vertical gradient to it.
    This can do it: lerp(-1, 1, y/height). It will give -1 for the top 0 for the center and 1 for the bottom. So you expression is now
    noisejs.perlin2(x/width*noise_scaling, y/height*noise_scaling) + lerp(-1, 1, y/height)> 0
    Which will give more or less hills centered vertically.
    
    There's probably more you can do such as shift it up and down by adding a number but the general thing to do is fiddle with the numbers and experiment until you get something you like.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • JamesXXXYZ

    Sorry I'm unable to fix it or merge features from your capx to mine. Pretty busy.

  • The installer option does nothing, that's why it's not showing up.

  • line x<220

    --- destroy line

    every 3 seconds

    pick topmost line

    --- create line at """end of line"""

    --- line set angle to choose(-90,0,90)

    Where the origin of the line is the left-center and """end of line""" is an image point at right center.

  • Ribis

    You can make the graphics any way you want there's no right way.

    JamesXXXYZ

    That code just defines 3 isometric direction vectors, not rotation.

    Angles can be handled exactly as I stated before.

  • JamesXXXYZ

    I'm not sure what you mean by isometric angles not being linear. If 0 degrees is to the right and 90 degrees is down then with 1:2 isometric the vertical speed should half the speed of going horizontal. sin and cos aren't a reason for why it wouldn't work.

    Would it be simpler if you just did all the motion as if in top view and convert to iso by dividing all y positions by two?

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound