Islands

Islands

This game is from ldjam.com, which is currently unavailable.
You can try viewing the original page on Web Archive (may not load correctly).
overall: 2.86
fun: 2.21
innovation: 4.21
theme: 3.71
mood: 2.86
Play in browser

Genre: endless runner + sumo

Proof of concept of a game with the map entirely generated by a fractal. Do not expect a finished, polished game :wink:.

Goal: escape to land and keep your enemy in the water before the time runs out.
If both of you survive, the map shrinks.

There is no score or endgame screen - the game just zooms out and restarts when a player dies.

Controls
- Arrow keys / WASD: movement
- Space: push away enemy (ability recharges), hold ground (it is harder for your enemy to push you)

Player
- Inner circle: *on land* indicator
- Middle: player color
- Outer circle: push away ability charge indicator (green when ability ready)

The Julia fractal shader based on Julia Islands by golinad.
Opted out of the *Graphics* rating category for that reason.
Specifically, the original shader was distilled to the functions below.

Relevant part of the *height* shader (single float output into a RenderTexture, which is used also in-game for land/water detection etc.)
```
float2 cSqr(float2 c){
return float2(c.x*c.x - c.y*c.y, 2.0*c.x*c.y);
}

float landscapeJulia(float2 uv)
{
const int maxIt = _Iterations;
// Normalized pixel coordinates (from 0 to 1)
uv *= 2;

int it = 0;
float2 z = uv;
float2 c = _Seed.xy;
float minD = length(z);
for(int i=0; i< maxIt;i++){
z = cSqr(z) + c;
if(length(z) > 50.0) break;
it++;
minD = min(length(z), minD);
}

// Time varying pixel color
return -1.0 + 1.5*float(it)/float(maxIt);
}

float frag (v2f i) : SV_Target
{
float2 uv = i.uv - float2(0.5, 0.5);
uv /= _Zoom;
float height = landscapeJulia((uv+_Offset.xy)/2);

return height;
}
```

Second shader (visualisation) transforms the height into RGB
```
float3 landColor(float h)
{
float hn = h*0.5 + 0.5;
return float3(0.1, 0.3, 0.4) + float3(hn, 0.7*hn, 0.4*hn);
}

fixed4 frag (v2f i) : SV_Target
{
fixed4 col = tex2D(_SubTex, i.uv);
float height = col.r; // the height is stored in the red channel
col.rgb = landColor(height);
return col;
}

```
Found a bug?
Tell us on Discord