// Created: 2020-08-27
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "generated map" )
a=GetMaxDeviceWidth()
b=GetMaxDeviceHeight()
SetWindowSize( a, b, 1 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( a, b ) // 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
SetWindowSize( 1024, 768, 1 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768)
`Setvirtualresolution(1000,1000)
ResetTimer()
dim map[551,551]
remstart
//Create a Green Cross Image
swap()
Drawline(0,0,15,15,0,255,0)
Update(0)
Render()
Drawline(0,15,15,0,0,255,0)
Update(0)
Render()
GetImage(1,0,0,15,15)
//Save Image File
SaveImage(1,"temp.png")
SetClearColor(50,50,100)
//Create Sprite
id=LoadSprite("temp.png")
remend
swap()
plato()
for r=1 to 200
holm(Trunc(random(20,531)),Trunc(random(20,531)))
next r
for r=1 to 200
holm1(Trunc(random(20,531)),Trunc(random(20,531)))
next r
for x=0 to 551
for y=0 to 551
drawbox(x,y,x+1,y+1,map[x,y],map[x,y],map[x,y],map[x,y],1)
next y
next x
GetImage(1,20,20,531,531)
//Save Image File
SaveImage(1,"temp.png")
SetClearColor(50,50,100)
//Create Sprite
id=LoadSprite("temp.png")
Do
If Timer()>15 Then Exit
Sync()
Loop
End
function plato()
`----------- plato
for x=0 to 551
for y=0 to 551
map[x,y]=50
drawbox(x,y,x+1,y+1,50,50,50,50,1)
Update(0)
Render()
next y
next x
endfunction
function holm(x,y)
for t=1 to 18
for alfa=0 to 360
h= map[Trunc(cos(alfa)*t+x),Trunc(sin(alfa)*t+y)]
map[Trunc(cos(alfa)*t+x),Trunc(sin(alfa)*t+y)]=h
if h<=68-t
map[Trunc(cos(alfa)*t+x),Trunc(sin(alfa)*t+y)]=68-t
map[Trunc(cos(alfa)*t+x+1),Trunc(sin(alfa)*t+y)]=68-t
map[Trunc(cos(alfa)*t+x),Trunc(sin(alfa)*t+y+1)]=68-t
map[Trunc(cos(alfa)*t+x+1),Trunc(sin(alfa)*t+y+1)]=68-t
elseif h>70-t
map[Trunc(cos(alfa)*t+x),Trunc(sin(alfa)*t+y)]=h
map[Trunc(cos(alfa)*t+x+1),Trunc(sin(alfa)*t+y)]=h
map[Trunc(cos(alfa)*t+x),Trunc(sin(alfa)*t+y+1)]=h
map[Trunc(cos(alfa)*t+x+1),Trunc(sin(alfa)*t+y+1)]=h
endif
next alfa
next t
endfunction
function holm1(x,y)
for t=1 to 18
for alfa=0 to 360
h= map[Trunc(cos(alfa)*t+x),Trunc(sin(alfa)*t+y)]
map[Trunc(cos(alfa)*t+x),Trunc(sin(alfa)*t+y)]=h
if h>=50-18+t
map[Trunc(cos(alfa)*t+x),Trunc(sin(alfa)*t+y)]=50-18+t
map[Trunc(cos(alfa)*t+x+1),Trunc(sin(alfa)*t+y)]=50-18+t
map[Trunc(cos(alfa)*t+x),Trunc(sin(alfa)*t+y+1)]=50-18+t
map[Trunc(cos(alfa)*t+x+1),Trunc(sin(alfa)*t+y+1)]=50-18+t
elseif h<50-18+t
map[Trunc(cos(alfa)*t+x),Trunc(sin(alfa)*t+y)]=h
map[Trunc(cos(alfa)*t+x+1),Trunc(sin(alfa)*t+y)]=h
map[Trunc(cos(alfa)*t+x),Trunc(sin(alfa)*t+y+1)]=h
map[Trunc(cos(alfa)*t+x+1),Trunc(sin(alfa)*t+y+1)]=h
endif
next alfa
next t
endfunction
a full screen is required for my idea.
As indicated in the program.
But here's the problem: it doesn't save the picture.
The point is that the command GetImage(1,0,0,15,15) doesn't work.
programming is a hobby, not a job.
P.S. in google and youtube - nikename pavelman- it is not me!