-
-
Save edmundito/ab5818ae57bd3c23a4b06b565c2b579b to your computer and use it in GitHub Desktop.
Black Hole code for AGS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://frankforce.com/?p=6378 | |
function u(float t) { | |
DrawingSurface* surface = Room.GetDrawingSurfaceForBackground(); | |
for (int i = 0; i < 2000; i++) { | |
surface.DrawingColor = Game.GetColorFromRGB( 99*i, 2*i, i ) | |
float fi = IntToFloat(i); | |
int x; | |
int y; | |
float F; | |
int K; | |
if (i > 0) { | |
F = 260.0*(t+9.0)/fi + Maths.Sin(fi*fi); | |
x = FloatToInt(960.0 + fi*Maths.Sin(F)); | |
y = FloatToInt(500.0 + 0.2 * (2.0*fi*Maths.Cos(F) + 20000.0/fi)); | |
K = FloatToInt(Maths.Sin(fi) * 9.0) | |
} | |
else { | |
x = 0; | |
y = 0; | |
K = 20000; | |
} | |
surface.DrawRectangle(x, y, K, K); | |
} | |
surface.Release(); | |
} | |
int loops = 0; | |
function repeatedly_execute_always() { | |
float t = IntToFloat(loops) / IntToFloat(GetGameSpeed()); | |
u(t); | |
loops++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment