Two functions that use AGKs built in commands to make a circle or triangle image useful for sprites
//place these at top of program
#constant white = MakeColor(0,0,255)
#constant green = MakeColor(0,255,0)
#constant blue = MakeColor(0,0,255)
#constant yellow = MakeColor(255,255,0)
#constant black = MakeColor(0,0,0)
//main program here
createSprite(1,createTriangleSprImage())
createSprite(2,createEnemySprImage())
SetSpritePosition(1,random(100,200),random(100,200))
SetSpritePosition(2,random(200,300),random(200,300))
do
sync()
loop
end
function createTriangleSprImage()
rem draw a triangle image used for the player sprite on radar
SetClearColor(0,0,0)
ClearScreen()
Render()
DrawLine(5,0,9,9,green,green)
DrawLine(1,8,8,8,green,green)
DrawLine(1,9,5,0,green,green)
//DrawLine(5,0,5,9,green,green)
//draw these if you want it filled
DrawLine(4,0,8,9,green,green)
DrawLine(0,9,8,9,green,green)
DrawLine(0,9,4,0,green,green)
DrawBox(4,1,6,8,green,green,green,green,1)
swap()
img = getimage(0,0,10,10)
SetImageTransparentColor(img,0,0,0)
endfunction img
function createEnemySprImage()
rem draw a circle image used for the player sprite on radar
SetClearColor(0,0,0)
ClearScreen()
Render()
DrawEllipse(6,6,4,4,yellow,yellow,0)
DrawEllipse(6,6,3,3,yellow,yellow,0)
swap()
img = getimage(0,0,12,12)
SetImageTransparentColor(img,0,0,0)
endfunction img
fubar