ps snoopy needs to be added to the poll.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote from: Snoopy on 2019-Apr-24
I will try to do something (I like the concurence friendly). The code of WPShadow is simpler but the optical effect is nice (and according to the rules of the contest, the complexity doesn't matter this time).
DrawStar(x%, y%, Color#, NumberOfPoints%, TextureID%, Rotate#, Depth#)
// --------------------------------- //
// Project: ColorPalette
// Start: Saturday, August 08, 2015
// IDE Version: 12.312
// compile 1920 x 1080 resolution fullscreen
LOADSPRITE "sky2.png", 9999
WHILE TRUE
STATIC a# = 0
a# = a# + 0.1
IF a# > 359.0
a# = 0.0
ENDIF
b# = SIN(a#) * 127.0
// the meters - still experimenting with colors..these are read to go...they have inputs [0.0..1.0] or [-1.0..1.0]
METER_Volume(30,40,20,300,SIN(a/2))
METER_SINE(60,40,20,300,SIN(a) )//, 0x604020, 0x707070)
METER_SINE(90,40,20,300,COS(b) )//, 0x604020, 0x707070)
// stars
DrawStar(200,500, 0xffffff, 5 , -50 , a , 0.5)
DrawStar(300,600, 0xff00ff, 5 , -100 , a , 0.75)
DrawStar(200,640, 0x808080 + RGB(COS(a)*127,128,0), 24 , -128 , 0 , SIN(a) * 1.0)
DrawStar(200,640, 0x808080 + RGB(0,COS(a)*127,128), 24 , -128 , a , 0.2)
// fractal sun
// this one needs HEAVY experimenting!
MakeSun(960,540, 2048, 2048+COS(b)*2048, 1, RGB( (127+COS(b*10)*127), (127+SIN(b*10)*127),COS(b*5)*127+127), 0x000000, b#, 0.1) //this is the fractal...its a lil messy
IF (GETTIMERALL() >20000)
c=c+0.01
IF c>1.0 THEN c=1.0
DrawStar( 940, 540, 0xffffff, 5, 9999, a, c)
ENDIF
IF (GETTIMERALL() >24000) THEN END
SHOWSCREEN
WEND
//
FUNCTION MakeSun: x1%, y1%, Points2%, Size2%, Wander%, Color#, Color2#, Angle#, Depth#
DrawStar(x1% , y1%+2 , Color#, Points2%, -Size2% , COS(Angle#)*2.0, Depth#)
DrawStar(x1% , y1% , Color2#, Points2% , -Size2% , 0 , Depth#)
RETURN 0
ENDFUNCTION
FUNCTION METER_SINE: x%, y%, w%, h%, Level#, Color1% = 0x00f0f0, Color2% = 0xf0f000 // Level# = -1.0 to 1.0 eg. [-1.0..1.0]
IF Level# < -1.0 THEN Level# = -1.0
IF Level# > 1.0 THEN Level# = 1.0
PRINT Level,10,10
LOCAL MeterLevel# = (h% - 1 ) * Level#
POLYVECTOR x%,y%,w%,h%,0x0000f0
DRAWRECT x%+2,y%+2,w%-4,h%-4,Color2%
DRAWRECT x%+4,y%+4,w%-8,h%-8,Color2% * 0.4
DRAWRECT x%+4,y%+(h%/2),w%-8,-MeterLevel#/2,Color1%
RETURN 0
ENDFUNCTION
FUNCTION METER_Volume: x%, y%, w%, h%, Level#, Color1% = 0x806040, Color2% = 0xf0f000 //Level# = 0 to 1.0 [0..1]
IF Level# < 0 THEN Level# = 0
IF Level# > 1.0 THEN Level# = 1.0
PRINT Level,10,10
LOCAL MeterLevel# = ( h% - 4 ) * Level#
DRAWRECT x%,y%,w%,h,Color1%
DRAWRECT x%+4,y%+4,w%-8,h%-9,Color1% * 0
DRAWRECT x%+4,y%+h%-4,w%-8,-MeterLevel#, Color2%
RETURN 0
ENDFUNCTION
FUNCTION DrawStar: x%, y%, Color#, NumberOfPoints%, TextureID%, Rotate#, Depth# // make some stars! -TextureID# = SIZE If No Sprites ID is supplied. (-) Negative ID
// Star Creator Code Designed Neil M. Silver, Aug. 9, 2015
//
// The Algorithm:
// --
// NumberOfPoints = Number of visually obvious points, eg. An American Star is 5 pointed.
// --
// Vector Count = The number of actual vectors a polyvector needs, in fan mode, can be calculated:
//
// ( V = P * 2 + 2 )
// VectorCount% = ( NumberOfPoints% * 2 ) + 2 )
// Note: Add Two, one for the center point, one for the last point.
// --
// VectorAngleSize% = is the turn size for each vector to draw.
// ( A = 180 / P )
// VectorAngleSize# = ( 180.0 / NumberOfPoints% )
// --
// Depth%
// The inner and outer radius represent the length of the points, and the depth of thier inner corners.
// The Depth% value is a scalar, a ratio of the outer radius, 0.5 is good for stars...play with this [0.1~~1.0]
//
// . ________________
// ^
// . . . . | Outer Radius
// V
// . ________________
// V Inner Radius (Depth#)
// . ______________
// . .
//
//
// --
// Rotate%, 360 degrees
// --
// A negative value for TextureID% will make the star that size, without an image.
// eg ( TextureID% = -5 ) will make the star 10 wide, radius 5...no skin.
// --
//
// Other notes:
// Its midhandled.
// Use a square image, root 2
//
STATIC Phase%
LOCAL iW%, iH%, ViR#, VoR#
LOCAL VectorCount% = ( ( NumberOfPoints% * 2 ) + 2 )
LOCAL VectorAngleSize# = ( 180.0 / NumberOfPoints% ) * 1.0
LOCAL tX#, tY#, vX#, vY#
// Get the outer radius:
IF TextureID% >= 0
GETSPRITESIZE TextureID%, iW%, iH%
ViR# = ( iW% * 0.5 ) * Depth#
VoR# = ( iW% * 0.5 ) * 1.0
ELSE
VoR# = ABS(TextureID%) //use -textureid for a size param
ViR# = ( VoR# * Depth# )
ENDIF
//STAR:
STARTPOLY TextureID%, 0 // FAN Mode only!
POLYVECTOR x%, y%, VoR#, VoR#, Color# // center vector
LOCAL AngleNow#
FOR i% = 0 TO VectorCount% - 1
AngleNow# = ( ( VectorAngleSize# * i% * 1.0 ) + Rotate# ) * 1.0
Phase% = Phase% + 1
IF Phase% > 1
Phase% = 0
ENDIF
IF Phase%
vX# = COS( AngleNow# ) * VoR#
vY# = SIN( AngleNow# ) * VoR#
ELSE
vX# = COS( AngleNow# ) * ViR#
vY# = SIN( AngleNow# ) * ViR#
ENDIF
tX# = vX# + VoR#
tY# = vY# + VoR#
POLYVECTOR x% + vX#, y% + vY#, tX#, tY#, Color#
NEXT
ENDPOLY
RETURN 0
ENDFUNCTION
// --------------------------------- //
// Project: HelloWorld
// Start: Tuesday, March 12, 2019
// IDE Version: 15.238
// By Hemlos
// Instructions: compile as console
AUTOPAUSE FALSE
SYSTEMPOINTER TRUE
LOCAL HelloWorld AS lib_String_Object_
HelloWorld.is$ = "hElLo wOrLd"
LOCAL BGColor% = 0, TColor% = 15
STDCOLOR TColor,BGColor
STD_OUT( HelloWorld.is$ )
STD_OUT( HelloWorld._Capitalize$() )
STD_OUT( HelloWorld._Capwords$() )
STD_OUT( HelloWorld._Swapcase$() )
STD_OUT( HelloWorld._RFill$(3, "!") )
STD_OUT( HelloWorld._LFill$(3, "!") )
STD_OUT( HelloWorld._Left$(14) )
STD_OUT( HelloWorld._Right$(11) )
STD_OUT( HelloWorld._Swapcase$() )
STD_OUT( HelloWorld._Upper$() )
STD_OUT( HelloWorld._Lower$() )
STD_OUT( HelloWorld._Encrypt$("GLBasic") )
STD_OUT( HelloWorld._Decrypt$("GLBasic") )
STD_OUT( HelloWorld._Replace$("world","GLBasic") )
STD_OUT( HelloWorld._Replace$("GLBasic","world") )
STD_OUT( HelloWorld._Capitalize$() )
STD_OUT( HelloWorld._Capwords$() )
SLEEP 60000
END
FUNCTION STD_OUT: showThis$, restTimeMS% = 1000 // clearscreen, stdout, sleep. restTimeMS% = millseconds sleep time (integer) defaults one second
CLEARSCREEN
STDOUT "\n\n\n "
STDOUT showThis$
SLEEP restTimeMS%
RETURN 0
ENDFUNCTION
QuoteThe message exceeds the maximum allowed length (20000 characters).You'll have to download the .rar to see it in action.
Quote from: Kitty Hello on 2019-Mar-09
Very cool. How do you come up with that kind of ideas?
// SOLAR SYSTEM CONFIGURATION
GLOBAL SPLITWAVE = FALSE // Initial planet formation splits into 2 directions.
GLOBAL SPACEWAVEFORM% = 1 // 0 = direct VECTORADD addition, 1 = random VECTORADD addition ()
GLOBAL RINGS% = 12 // Number of rings
GLOBAL RADS% = 2 // # of radial hub arms
GLOBAL SPREAD# = 12.0 // additional rad spread random angle on xz plane
GLOBAL DIST# = 2000.0 // RADIUS OF PLANET BELT, PER STEP
GLOBAL GAP# = 8000.0 // Magnitude between each ring
GLOBAL G# = 0.000006674 // Gravitational constant - time, the bigger the constant, the faster time goes. our universe irl is very very slow, constant is tiny and thats a good thing.
//PLANET PHYSICS
GLOBAL STARSIZE# = 1000000000.0 // 0 = normal object >0 = star to form in center, size starts at this size.
GLOBAL MaxMASS# = 1100000.0 // RANDOM PLANET MASS MAX START SIZE
GLOBAL MinMASS# = 1000000.0 // RANDOM PLANET MASS MIN START SIZE
GLOBAL VECTORADD# = 0.0 // addition to SPACEWAVEFORM% angle of fall at initialization, 0 = stable, no variationss regardless of SPACEWAVEFORM%,
GLOBAL E# = 120.0 // solar system initial spin speed
Quote from: erico on 2019-Mar-01not sure, if it would or not?
That is neat! Would it work better if the planet shading was more "hard", like a cartoon shade?
Looks awesome and I bet even better while moving about.