Created
January 12, 2022 19:55
-
-
Save Tricky1975/4667a8871baac1ec8da38443be0866f5 to your computer and use it in GitHub Desktop.
I used this cute BlitzBasic program to pre-render soms sinus effects I needed in other games of mine.
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
The picture itself was used in a game I scripted in Apollo which I coded in turn in C++. | |
However for some quick effects BlitzBasic is sometimes a wonderful language due to it's quick syntax and very easy to use compiler. | |
I used the Blitz3D compiler to be exact. |
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
Const W = 255 | |
Const H = 360 | |
AppTitle "Big sinus" | |
; Up to down | |
Graphics W*4,H | |
For y=0 To H-1 | |
CX = (W*2)+(Sin(y) * W) | |
For x=0 To 255 | |
Color 255-x,255-x,255-x | |
Plot CX+X,Y | |
Plot CX-X,Y | |
Next | |
Next | |
img = CreateImage(W*4,H) | |
GrabImage img,0,0 | |
SaveImage img,"VSinus.bmp" | |
WaitKey | |
; Left to right | |
Graphics H,W*4 | |
For y=0 To H-1 | |
CX = (W*2)+(Sin(y) * W) | |
For x=0 To 255 | |
Color 255-x,255-x,255-x | |
Plot Y,CX+X | |
Plot Y,CX-X | |
Next | |
Next | |
img = CreateImage(H,W*4) | |
GrabImage img,0,0 | |
SaveImage img,"HSinus.bmp" | |
WaitKey | |
End | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment