QB64.org Forum
Active Forums => Programs => Topic started by: SierraKen on August 14, 2020, 02:34:21 am
-
Is it a waste of time? Sure! What does it do? Probably nothing. What is it for? To prove one thing: A programming hobby can be fun even though you aren't making hardly anything!
Get yours now while the price is cheap (FREE!)
Maybe it will remind you of the simpler days, of the GREAT BIG BUTTON website that did absolutely nothing. But hey, at least this widget moves "stuff" around. Can the code be used to make anything in the future? That's up to you my friend. Maybe a game widget? An organizing widget? A PAC-MAN Widget! Do I need royalties? I wouldn't go that far. ;)
Use the arrow keys and mouse wheel in order to see intersections scatter and move. Hey, at least I tried another maze, that went South pretty fast. :)
Edit: I switched up and down arrow keys.
_TITLE "Ken's Widget - Use Arrow Keys and Mouse Wheel" xx = 10
yy = 10
mouseWheel = 0
IF mouseWheel
= -1 THEN xx
= xx
+ 1: yy
= yy
+ 1 IF mouseWheel
= 1 THEN xx
= xx
- 1: yy
= yy
- 1 LINE (ix
, iy
+ 10)-(ix
- 10, iy
+ 10), _RGB32(0, 0, 0)
LINE (ix
+ 10, iy
)-(ix
+ 10, iy
+ 10), _RGB32(0, 0, 0) LINE (ix
+ 10, iy
+ 10)-(ix
+ 20, iy
+ 10), _RGB32(0, 0, 0)
LINE (ix
, iy
+ 20)-(ix
- 10, iy
+ 20), _RGB32(0, 0, 0)
LINE (ix
+ 10, iy
+ 30)-(ix
+ 10, iy
+ 20), _RGB32(0, 0, 0) LINE (ix
+ 10, iy
+ 20)-(ix
+ 20, iy
+ 20), _RGB32(0, 0, 0)
-
OK nice grid practice.
Tip: Use this
before main DO loop and then you wont need the PAINT near end of loop.
-
Awesome! I never knew what those color hex memories did. I'll update it below.
Yeah it was just a grid practice like you said. I thought about trying to make a maze using a grid first and randomly placing walls but it was harder than it sounds. I might work on it more another time.
_TITLE "Ken's Widget - Use Arrow Keys and Mouse Wheel" xx = 10
yy = 10
mouseWheel = 0
IF mouseWheel
= -1 THEN xx
= xx
+ 1: yy
= yy
+ 1 IF mouseWheel
= 1 THEN xx
= xx
- 1: yy
= yy
- 1 LINE (ix
, iy
+ 10)-(ix
- 10, iy
+ 10), _RGB32(0, 0, 0)
LINE (ix
+ 10, iy
)-(ix
+ 10, iy
+ 10), _RGB32(0, 0, 0) LINE (ix
+ 10, iy
+ 10)-(ix
+ 20, iy
+ 10), _RGB32(0, 0, 0)
LINE (ix
, iy
+ 20)-(ix
- 10, iy
+ 20), _RGB32(0, 0, 0)
LINE (ix
+ 10, iy
+ 30)-(ix
+ 10, iy
+ 20), _RGB32(0, 0, 0) LINE (ix
+ 10, iy
+ 20)-(ix
+ 20, iy
+ 20), _RGB32(0, 0, 0)
-
Very interesting, Ken!
-
Oh I missed the arrow keys thing, yeah good practice, this stuff comes in handy later if it does not inspire something while fooling around.
Maybe try some plaid patterns? Colorful overlapping grids with different thickness lines (BF's)
-
Today I started on a game project using a grid. You move your guy around city blocks. I think I will have things you collect on the way. I have the blocks and a chr$(1) happy face you move around. I might change the happy face to something else since he's so tiny. I wish I could make him larger. Anyway, here is what I have so far:
_TITLE "City Blocks - Use Arrow Keys" x = 5
y = 5
d = 0
nex:
LINE (ix
, iy
)-(ix
+ 30, iy
+ 30), _RGB32(255, 0, 0), BF