How would you make a sky with randomly blinking stars?

Started by tor.brandt, Tue 15/11/2016 21:55:50

Previous topic - Next topic

tor.brandt

I want to make a background that has a sky with randomly blinking stars.
The randomness should behave in such a way that the stars are white most of the time, but then shortly shifts to some gray nuance now and then.

I'm thinking of either making objects with groups of stars (it would probably be grossly overkill to make separate objects for each star), and set those objects to shift frames with a Random int, or perhaps use the DrawingSurface.DrawPixel, and set the drawn pixels to shift color with a Random int.

Would you prefer either of those two options, or do you have a better idea for how I could obtain the same result?

Any suggestions appreciated!

Crimson Wizard

#1
Also, if you have a small limit on how many stars can blink at any given time simultaneously, then you can make that number of objects for "blinking stars", turn them on and off, placing at positions where they need to blink right now.

Drawing on room background should not be difficult too, but with objects you already have convenient Animate commands, and with raw drawing you will need to keep track of animation frames and draw old star image back too yourself.

If that is just single pixel color that you change per star, then raw drawing might be a best choice.

Jack

If you want to simulate the effect of mostly invisible clouds passing (which causes the gray fade of stars) I would use moving cloud shapes very close to black with light and varying opacity as an overlay. It should appear more realistic than randomly fading them. You could do this with one object or many, depending on what you prefer.

tor.brandt

Thanks for the replies!

@Crimson Wizard:
Good to know that my ideas were not totally rubish, and that there wasn't an obvious better option that I hadn't thought of (laugh)

@Jack:
I'm not sure if the effect I'm thinking of is created by thin clouds in real life, or if it's some kind of "atmospheric jitter", but what I'm after is really just having a white pixel that occasionally turns a darker nuance and then back again.
But thanks for the input! :)

SMF spam blocked by CleanTalk