'Made on Dec. 20, 2019 by Ken G.
_TITLE "Scene Generator - by Ken G. - Space Bar for new scene, (S)ave Picture, Esc to quit." start:
'Draw sky.
sky = sky + .25
'Draw ground.
cc2 = cc2 + .5
y = 300
c4 = c2
t = 0
tt = 0
si = 0
'Draw hills.
c2 = c2 + .05
c2 = c4
l = .5
'Draw grass.
LINE (grassx
+ sst
, grassy
+ sst2
)-(grassx
+ sst
, (grassy
+ sst2
) - l
), _RGB32(50, 255, 127) l = l + .025
'Draw random river.
yy = 305
rw = 2
tt = tt + 1
si = si + 1
yy = yy + (si * 2)
tt = 0
'Trees
trees:
length = yt * 8 / 160
th = yt / 100
LINE (xt
+ thick
, yt
)-(xt
+ thick
, yt
- length
), _RGB32(211, 83, 6) 'left side
LINE (xt
+ thick
, yt
- length
)-((xt
- length
) + thick
, yt
- length
* 2), _RGB32(211, 83, 6) LINE ((xt
- length
) + thick
, yt
- (length
* 2))-((xt
- (length
* 2)) + thick
, yt
- (length
* 3)), _RGB32(211, 83, 6) LINE ((xt
- length
) + thick
, yt
- (length
* 2))-((xt
- (length
* 1.5) + thick
), yt
- (length
* 3)), _RGB32(211, 83, 6) 'right side
LINE ((xt
+ thick
), yt
- length
)-((xt
+ length
) + thick
, yt
- (length
* 2)), _RGB32(211, 83, 6) LINE ((xt
+ length
) + thick
, yt
- (length
* 2))-((xt
+ (length
* 2) + thick
), yt
- (length
* 3)), _RGB32(211, 83, 6) LINE ((xt
+ length
) + thick
, yt
- (length
* 2))-((xt
+ (length
* 1.5) + thick
), yt
- (length
* 3)), _RGB32(211, 83, 6)
again:
saving:
PRINT " Your bmp file will be saved in the" PRINT " same directory as this program is." PRINT " It can be used with almost any" PRINT " other graphics program or website." PRINT " It is saved using:" PRINT " width: 800 height: 600 pixels." PRINT " Type a name to save your picture" PRINT " and press the Enter key. Do not" PRINT " add .bmp at the end, the program" PRINT " will do it automatically." PRINT " Quit and Enter key ends program." nm$ = nm$ + ".bmp"
'Checking to see if the file already exists on your computer.
PRINT " File Already Exists" PRINT " Saving will delete your old" PRINT " Would you like to still do it?" PRINT " Esc goes to start screen." llloop:
saving2:
SaveImage 0, nm$
nm$ = ""
picture& = 0
picture2& = 0
'Here is the SUB needed to save the image to BMP.
IF bytesperpixel&
= 1 THEN bpp&
= 8 ELSE bpp&
= 24 b$
= "BM????QB64????" + MKL$(40) + MKL$(x&
) + MKL$(y&
) + MKI$(1) + MKI$(bpp&
) + MKL$(0) + "????" + STRING$(16, 0) 'partial BMP header info(???? to be filled later) FOR c&
= 0 TO 255 ' read BGR color settings from JPG image + 1 byte spacer(CHR$(0)) MID$(b$
, 11, 4) = MKL$(LEN(b$
)) ' image pixel data offset(BMP header) FOR py&
= y&
- 1 TO 0 STEP -1 ' read JPG image pixel color data r$ = ""
c&
= POINT(px&
, py&
) 'POINT 32 bit values are large LONG values d$ = d$ + r$ + padder$
MID$(b$
, 35, 4) = MKL$(LEN(d$
)) ' image size(BMP header) b$ = b$ + d$ ' total file data bytes to create file
MID$(b$
, 3, 4) = MKL$(LEN(b$
)) ' size of data file(BMP header)