by Fuzzy » Mon May 08, 2006 6:01 am
Hi. I dont know exactly, But I can think of two ways to do it.
One way, the way old graphics programs used to seem to do it was to just draw pixels both ways from where a mouse click took place, and if the pixel drawing pointer encountered a pixel of a different color that what was drawn on first, it stopped there and drew the other way. when it hit two horizontal limits, it would draw on line above or below.
We dont have a read pixel function in GE, so you'd have to store the borders of areas if you wish to flood fill, and look them up as you go.
Now, I dont think thats whats happening in that old game(but I dont know it).
Another technique, that I have seen, but in a sort of screen saver, is to store a series of draw instructions, much like the old LOGO and turtle graphics. Instead of drawing everything out behind scenes, and blasting it all on screen at once, you draw real time, from the stored instructions.
It looks quite neat, if I understand what you mean.
Simplest, If you are doing this, would be to store each color as a series of y coordinate, and lengths. The canvas would be told: go to the 46th line, and draw thirteen purple pixels to the right. Once all the purple pixels are drawn, start over with the next color. Its slow, you are redundant in covering parts of the screen, but the illusion of live drawing is what you are after, right?
The nice thing about this is you could use a look up reference to a pattern and each pixel, draw one aspect of the pattern. for example, you make a series of small arrays
pattern1 = array[6] {56, 234, 87, 2, 3, 99}
Thats not a proper array, I know... so your pixel drawing routine looks up the current place in the pattern, gets that number, and then goes to a larger array of RGB triplets, and gets the actual color for that. You could put the triplets in the pattern array too I guess.
Questions, Confusions? Critiques? Lets hear 'em.
Mortal Enemy of IF....THEN(and Inspector Gadget)
Still ThreeFingerPete to tekdino