Both version are very cool. QB64 could use a polygon command... One strange thing about version #2.... After watching it I had this irresistible urge to bury a cat in the back yard... Problem is, we don't have a cat, or a shovel....
09-19-2017, 02:30 AM This post was last modified: 09-19-2017, 02:31 AM by bplus. Edited 0 times
A moving experience with polygons:
' polygon demo 4.bas for QB64 (B+=MGA) 2017-09-18
CONST xmax = 700
CONST ymax = 700
SCREEN _NEWIMAGE(xmax, ymax, 32)
_TITLE "Polygon Demo 4 by bplus, Toggles: press spacebar + main poly 6 to 10, press enter + thick 1 to 6"
COMMON SHARED dradius, thick
dradius = .315: thick = 0
x0 = xmax / 2: y0 = ymax / 2: a = _PI(-.5): n = 6
COLOR _RGB(50, 150, 200)
IF _KEYHIT = 32 THEN
IF n = 10 THEN n = 6: dradius = .3 ELSE n = n + 1: dradius = dradius - .025
IF _KEYHIT = 13 THEN
IF thick = 5 THEN thick = 0 ELSE thick = thick + 1
radius = 240
polygon x0, y0, radius, n, a
a = a + _PI(1 / 180)
SUB polygon (xOrigin, yOrigin, radius, nVertex, RadianAngleOffset)
polyAngle = _PI(2) / nVertex
x1 = xOrigin + radius * COS(RadianAngleOffset)
y1 = yOrigin + radius * SIN(RadianAngleOffset)
FOR i = 1 TO nVertex
x2 = xOrigin + radius * COS(i * polyAngle + RadianAngleOffset)
y2 = yOrigin + radius * SIN(i * polyAngle + RadianAngleOffset)
SELECT CASE i MOD 7
CASE 1: COLOR _RGB(255, 0, 0)
CASE 2: COLOR _RGB(255, 255, 0)
CASE 3: COLOR _RGB(0, 0, 255)
CASE 4: COLOR _RGB(0, 165, 0)
CASE 5: COLOR _RGB(128, 0, 128)
CASE 6: COLOR _RGB(0, 128, 128)
CASE 0: COLOR _RGB(200, 100, 0)
FOR j = 0 TO thick
LINE (x2 + j, y2 + j)-(x1 + j, y1 + j)
IF radius > 5 THEN
polygon x1, y1, radius * dradius, nVertex - 1, -2.3 * RadianAngleOffset
x1 = x2: y1 = y2
I have been in the process of moving the last four days and putting everything in storage. My wife and I are staying at a local campground until the house we are waiting on is ready. It should be about 1-2 weeks. During that time, I do not have an electrical source to get on my laptop, so the only time I can get on is during my lunch at work, or after closing.
So during the little mini-vacation, my wife and I are taking, I will not be on here very much.
I haven't been out camping in over 20 years. I really did miss it. It has been so peaceful and I have been sleeping well. The local campground we are at has restrooms, showers, and laundry facilities, so I am not doing without, except for electricity. I do have an inverter that plugs into the car lighter port, but one of the wires is broke and I have to fix it. If I ever think about fixing it, I may be able to get online on the laptop at night, since I get my internet through my cell phone anyway.
I was out of work the last two days, so I haven't had the chance to get on. Plus I have been too busy and extremely tired to even think about. I was up over 40 hours packing, loading the Uhaul, Unloading the Uhaul, and finding a place to stay. The first night at the campground, we were so exhausted, we slept in the car. There was no way I could stay awake any longer.
Last night, we got the first tent up to sleep in, and we cooked pork chops on the grill. They were delicious. We will set up the second tent to store our supplies (clothes, shower stuff, and food) tonight.
After 18 years of marriage, this is the first time my wife and ever camped out together. It was fun.
Dedicated to empowering computer programming hobbyists, tinkerers, amateurs, and enthusiasts.