Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fall Banner 2023 Idea - Dev Diary
#8
Something we could do extra though, regarding align and distribute is add that element of randomization...

So maybe we could have additional functions:
`align_random()` and `distribute_random` -- why would you want to use align and distribute randomly when they are meant to be precise things? because it could get boring is why.

So what would be randomizable?

Looking at the previous pseudo:
`align(x_type$, y_type$, shapes())`
x_type = "empty, left, middle, right" (where empty = "")
y_type = "empty, top, middle, bottom" (where empty = "")

we'd need 4 new arguments here. why? start_x and end_x, start_y, and end_y -- random x and y in that range applied AFTER the alignment.

So: `align_random(x_type$, y_type$, shapes(), x_start%, x_end%, y_start%, y_end%)`

Same for distribute:
`distribute(x_type$, y_type$, shapes(), x_start%, x_end%, y_start%, y_end%)` -- random x, y ranges.

Here's where optional arguments would be ideal for QB64... but alas we don't have those. However, in our code, we can just pass 0's for stuff we don't care about. Since the math will be using offsets, adding 0 to something is going to do nothing. We can also make sure we check for a range > 0 because randomizing 0 isn't helpful and it's wasteful.

Now we could have used the same funcs/subs for align and distribute by just passing in these other parameters, but this is a messy idea because most of the time align and distribute are going to be used without random jitter.

So instead, we will have align_random and distribute_random call on align and distribute Smile then just add the rand ranges.

These high level ways of thinking will be much easier for us too, as humans. Because we won't be confronted by endless 0's all over the place lol.
grymmjack (gj!)
GitHubYouTube | Soundcloud | 16colo.rs
Reply


Messages In This Thread
Fall Banner 2023 Idea - Dev Diary - by grymmjack - 09-02-2023, 12:59 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 01:11 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 01:17 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 01:45 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 02:01 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 02:07 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 02:33 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 02:40 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 02:49 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 03:18 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 03:29 AM
RE: Fall Banner 2023 Idea - Dev Diary - by dbox - 09-02-2023, 03:37 AM
RE: Fall Banner 2023 Idea - Dev Diary - by dbox - 09-02-2023, 02:02 PM
RE: Fall Banner 2023 Idea - Dev Diary - by bplus - 09-02-2023, 03:29 PM
RE: Fall Banner 2023 Idea - Dev Diary - by bplus - 09-06-2023, 01:59 PM



Users browsing this thread: 2 Guest(s)