Ah Dav's number works better than Steve's but Steve pointed to right place. You guys tied :)
Works well now! (Windows only sorry PI guys)
_Title " MessageBox test - look behind the QB64 app on tool bar if not seen on top. Lean on esc to quit... "
' Thank you FellippeHeitor!
Const xmax
= 800, ymax
= 600, PI
= 3.141592653589793
drawLandscape
Color &HFFFFFFFF, &HFF000000 kind = 1 + 4096 ' 0 is just OK, 1 is OK & Cancel
Print "Warning a Modal Message Box may come up off screen, you program is waiting for that!." answer = MessageBox(0, "You might have to look for me off screen. Lean on escape button to quit. Now you should quit seeing me with Cancel.", "Test MessageBox", kind)
'cant mess with first parameter?
k$
= InKey$ ' curious if key press in messageBox will interfere with inkey$
'needs midInk, irnd
'the sky
midInk 0, 0, 128, 128, 128, 200, i / ymax
'the land
startH = ymax - 200
rr = 70: gg = 70: bb = 90
Xright = 0
y = startH
' upDown = local up / down over range, change along Y
' range = how far up / down, along X
upDown
= (Rnd * .8 - .35) * (mountain
* .5) range = Xright + irnd&(15, 25) * 2.5 / mountain
lastx = Xright - 1
y = y + upDown
Line (lastx
, y
)-(X
, ymax
), , BF
'just lines weren't filling right lastx = X
Xright = range
rr = irnd&(rr - 15, rr): gg = irnd&(gg - 15, gg): bb = irnd&(bb - 25, bb)
startH = startH + irnd&(5, 20)
Sub midInk
(r1%
, g1%
, b1%
, r2%
, g2%
, b2%
, fr##
) Color _RGB32(r1%
+ (r2%
- r1%
) * fr##
, g1%
+ (g2%
- g1%
) * fr##
, b1%
+ (b2%
- b1%
) * fr##
)
Function irnd&
(n1
, n2
) 'return an integer between 2 numbers If n1
> n2
Then l%
= n2: h%
= n1
Else l%
= n1: h%
= n2
irnd&
= Int(Rnd * (h%
- l%
+ 1)) + l%