TGC Codebase Backup



Random Color Dots by Mark Garrett

14th Mar 2018 4:51
Summary

Creates Random Color-Dots on Screen



Description

Draws different colored dots on the screen



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    SetErrorMode(2)

// set window properties
SetWindowTitle( "Color Dots" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window

// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts

for a = 1 to 500
cir(random2(1,1024),random2(1,768))

next a
sync()
sleep(1500)


function cir(a,b)
		clr = MakeColor(Random2(1,1024),Random2(1,768),Random2(1,768))
     DrawEllipse( a,b, 5, 5, clr, clr, 1 )
endfunction