GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 Re: Script Submission » Delaunay Triangulation using Bowyer-Watson algorithm » 2017-08-22 19:14:12

I've been using this code (found it on github I believe) for dungeon generation in my game Glory Borne.

dungeon

#2 Re: Script Submission » Closest Power Of Two » 2017-08-22 18:56:45

Awesome! Love that solution both aesthetically and functionally over the others.

#3 Script Submission » Closest Power Of Two » 2017-08-13 07:38:49

davesch
Replies: 3
Expand///next_pow2(val);

return power(2,clamp((ceil(log2(argument0))),1,100000000000000000000));

I know this script already exists here but this one is about 3x as fast as the old one below.

Expand/// next_pow2(n)
//
//  Returns the next power-of-two greater than or equal to a given value.
//
//      n       positive integer
//
/// GMLscripts.com/license
{
    var n = argument0 - 1;
    n |= (n >>  1);
    n |= (n >>  2);
    n |= (n >>  4);
    n |= (n >>  8);
    n |= (n >> 16);
    n |= (n >> 32);
    return n + 1;
}

#4 Script Submission » Frame-Independent Lerp » 2017-08-13 07:19:06

davesch
Replies: 0

///dlerp(va1,val2,amount,dt);

return lerp(argument0,argument1,1-power(1-argument2,argument3));

//Where dt (delta_time*0.000001*TargetFramerate) is equal to "1" when fps == steps per second.

Board footer

Powered by FluxBB