// Author - MrC // Based on WavePit.r4 by Spoonman Tunnel tunnel; Map map; int x,y; float theta,rad,dx,dy; float mx, my; void Init() { for (y=0;y<24;y=y+1) { for (x=0;x<32;x=x+1) { dx = x-15.5; dy = y-11.5; rad = Mag(dx,dy); theta = Atan2(dy,dx); mx = -(0.01*dy/rad)-Sin((rad-7.5)*0.1)*0.02*dx/rad; my = (0.01*dx/rad)-Sin((rad-7.5)*0.1)*0.02*dy/rad; map.SetValues(x, y, mx, my, (3.0+Cos(theta))*0.275, (3.0+Cos(theta*2.0))*0.275, (3.0+Cos(theta*4.0))*0.275); } } } void Render() { gfxPushMatrix(); map.Render(); gfxSetRenderTarget(map); gfxColour(1,1,1,1); gfxBegin(PRIM_LINESTRIP); for (int x=0; x < 256; x = x+1) { rad = 0.25 + (WaveLeft(x) / 10.0f); theta = x*3.141592/128.0; gfxVertex(Cos(theta)*rad, Sin(theta)*rad,1); } gfxEnd(); gfxBegin(PRIM_LINESTRIP); for (int x=0; x < 256; x = x+1) { rad = 0.25 + (WaveRight(x) / 10.0f); theta = x*3.141592/128.0; gfxVertex(Cos(theta)*rad, Sin(theta)*rad,1); } gfxEnd(); gfxPopMatrix(); gfxSetRenderTarget(TEXTURE_FRAMEBUFFER); gfxSetTexture(map); float bass = 0; if (BASS > 0) bass = BASS * 20; tunnel.Update((2 + bass) * TIMEPASS, 1 * TIMEPASS * MIDDLE * 2); tunnel.Render(8, 1, 8, 20); }