A little Inspiration for the developers just move your mouse around
// Project: Humour Day
#constant maxWidth=800
#constant maxHeight=600
SetWindowTitle( "Humour Day" )
SetWindowSize( maxWidth , maxHeight, 0 )
// set display properties
SetVirtualResolution( maxWidth , maxHeight )
SetOrientationAllowed( 1, 1, 1, 1 )
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
//dim smiley$[32,32]
Global Bg=100
Global smiley=1
Global smileyImage=1
Global smileyTempImage =2
//16 by 3 colors by 16 =768
dim mySmileyData$[768] as string =["0","0","0","0","0","0","177","177","113","227","227","121","253","253","114","249","249","94","248","248","73","248","248","51","247","247","29","249","249","6","211","211","0","153","153","0","0","0","0","0","0","0","0","0","0","0","0","0",
"0","0","0","192","192","129","246","246","155","251","251","146","253","253","126","254","254","103","255","255","81","255","255","57","254","254","34","252","252","11","246","246","0","236","236","0","155","155","0","0","0","0","0","0","0","0","0","0",
"177","177","106","246","246","155","253","253","173","254","254","152","240","240","124","255","255","111","255","255","83","255","255","59","255","255","37","240","240","11","254","254","0","248","248","0","236","236","0","153","153","0","0","0","0","0","0","0",
"227","227","121","251","251","146","255","255","153","249","249","142","0","0","0","128","128","51","255","255","80","255","255","57","127","127","19","0","0","0","249","249","0","254","254","0","246","246","0","211","211","0","0","0","0","0","0","0",
"253","253","114","253","253","125","255","255","130","200","200","99","0","0","0","84","84","29","255","255","73","255","255","50","84","84","11","0","0","0","200","200","0","255","255","0","252","252","0","248","248","0","100","100","0","0","0","0",
"249","249","94","254","254","103","255","255","107","255","255","107","39","39","13","187","187","57","255","255","59","255","255","39","187","187","15","39","39","0","255","255","0","255","255","0","254","254","0","246","246","0","215","215","0","0","0","0",
"248","248","73","255","255","81","255","255","83","255","255","80","255","255","75","255","255","59","255","255","43","255","255","26","255","255","6","255","255","0","255","255","0","255","255","0","255","255","0","246","246","0","216","216","0","0","0","0",
"248","248","51","255","255","57","255","255","60","255","255","56","255","255","50","255","255","39","255","255","26","255","255","10","255","255","0","255","255","0","255","255","0","255","255","0","255","255","0","246","246","0","216","216","0","0","0","0",
"247","247","29","255","255","36","171","171","24","255","255","35","255","255","28","255","255","19","255","255","6","255","255","0","255","255","0","255","255","0","255","255","0","171","171","0","255","255","0","246","246","0","217","217","0","0","0","0",
"250","250","6","203","203","7","143","143","6","255","255","11","255","255","5","255","255","1","255","255","0","255","255","0","255","255","0","255","255","0","255","255","0","143","143","0","203","203","0","249","249","0","100","100","0","0","0","0",
"211","211","0","246","246","0","255","255","0","91","91","0","232","232","0","255","255","0","255","255","0","255","255","0","255","255","0","232","232","0","91","91","0","255","255","0","246","246","0","211","211","0","0","0","0","0","0","0",
"150","150","0","235","235","0","248","248","0","255","255","0","137","137","0","88","88","0","114","114","0","114","114","0","88","88","0","138","138","0","255","255","0","248","248","0","235","235","0","155","155","0","0","0","0","0","0","0",
"0","0","0","154","154","0","235","235","0","246","246","0","252","252","0","255","255","0","255","255","0","255","255","0","255","255","0","251","251","0","246","246","0","235","235","0","154","154","0","0","0","0","0","0","0","0","0","0",
"0","0","0","0","0","0","150","150","0","211","211","0","249","249","0","246","246","0","246","246","0","246","246","0","246","246","0","249","249","0","211","211","0","150","150","0","0","0","0","0","0","0","0","0","0","0","0","0",
"0","0","0","0","0","0","0","0","0","0","0","0","100","100","0","215","215","0","216","216","0","216","216","0","215","215","0","100","100","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0",
"0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]
createSmileyTempImage ()
setUpSmileyParticles()
//doSmileyParticles()
createsprite(Bg,0)
setspritesize(Bg,maxWidth ,maxHeight)
SetSpriteColor(Bg,0,0,0,10)
EnableClearColor(0)
render()
ClearScreen()
do
Print("Celebrating International Humour Day")
DrawSprite(Bg)
SetParticlesPosition(smiley,GetPointerX(), GetPointerY())
AddParticlesColorKeyFrame(smiley,1,Random(0,255),Random(0,255),Random(0,255),255)
AddParticlesScaleKeyFrame( smiley,1,2 )
AddParticlesScaleKeyFrame( smiley,2.5,.5 )
UpdateParticles(smiley, GetFrameTime())
Sync()
loop
function createSmileyTempImage ()
color=0:clearscreen()
for y = 0 to 15
for x = 0 to 15
drawSpr=createSprite(0)
red=Val(mySmileyData$[color]):green=Val(mySmileyData$[color+1]):blue=Val(mySmileyData$[color+2])
SetSpriteColor(drawSpr,red,green,blue,255):SetSpriteSize(drawSpr,1,1):SetSpritePositionByOffset(drawSpr,100,100)
paint(drawSpr,x,y):render():color=color+3 :deleteSprite(drawSpr)
next x
next y
//Swap()
Render():If GetImageExists(smileyImage) then DeleteImage(smileyImage)
GetImage(smileyImage,0,0,15,15):Render():ClearScreen()
endfunction
function Paint(Brush,x,y)
if GetImageExists(smileyTempImage )=0 then CreateRenderImage (smileyTempImage , maxWidth ,maxHeight, 0, 0 )
SetRenderToImage(smileyTempImage , 0 )
SetSpritePositionByOffset(Brush,x,y)
DrawSprite(Brush)
SetRenderToScreen()
DeleteImage(smileyTempImage)
endfunction
function setUpSmileyParticles()
CreateParticles(smiley,100,100)
SetParticlesImage(smiley,smileyImage)
SetParticlesActive(smiley,1)
SetParticlesSize(smiley,16)
SetParticlesFrequency(smiley,50)
SetParticlesLife(smiley,2.5)
SetParticlesVelocityRange(smiley,1,5)
endfunction smiley
I created an image with the following functions then copy pasted to use as an array declaration I have no objection to this being done
but you are limited to the number of lines and also judged for readability etc
Function pickColor(X,Y)
render()
tImage=getImage(x,y,1,1)
clearscreen()
tMemblock=CreateMemblockfromImage(tImage)
red=GetMemblockbyte(tMemblock,12)
green=GetMemblockbyte(tMemblock,13)
blue=GetMemblockbyte(tMemblock,14)
alpha=GetMemblockbyte(tMemblock,15)
rgb$=chr(34)+str(red)+chr(34)+","+chr(34)+str(green)+chr(34)+","+chr(34)+str(blue)+chr(34)
deletememblock(tMemblock)
deleteimage(tImage)
endfunction rgb$
function createSmiley()
filename$="rgb.txt"
file = OpenToWrite(filename$,0)
rgb$="["
for y = 1 to 16
for x=1 to 16
rgb$=rgb$+pickColor(x,y)
if y <> 16
rgb$=rgb$+","
elseif x<16 and y=16
rgb$=rgb$+","
endif
next x
if y>=16 then rgb$=rgb$+"]"
Writeline(file,rgb$)
rgb$=""
next y
closefile (file)
endfunction
Goodluck everyone as you can see my submitted code is less than 100 lines of code
but I am judging it this time round so I can only enter to inspire and for the fun of it
fubar