MobileWebbs

Discussion in 'Share Your Creations' started by JesseW, Oct 18, 2008.

  1. JesseW

    JesseW Active Member Licensed User

    This is a port of a screen saver I wrote for Windows desktop using VB6. The B4P code omitts the parts of the code that make it work as a screen saver on a desktop machine. Included in the attached MobileWebbs.zip file is the B4P source code, the device executable (no cab file needed, just copy the exe and run it from file explorer) and the original desktop screensaver for your viewing pleasure (just copy Webbs.scr to your desktops windows folder and it will appear in the screen saver list).

    It's mesmirizing to watch sometimes and kinda soothing... But the program is kinda useless, as there's no real concept of a screen saver in WinMo, but what the heck, maybe someone will learn something from it :) Oh, and by the way, this is MY VERY FIRST COMPILED WINMO APP EVER!!!! Yea me! >blush<

    If you're interested in an explaination, I'll try. Please forgive my lack of comments in the source file. I am one of the worlds worse. I have a particular style, and I can read it and make sense of it for a long time, so I'm lazy in that area... :(

    Onward... If you take two lines, where an end of one line touches the end of the other line. Then you draw lines between intersecting points along each line. (This was a project in high school art class waaaayyyyy back before dirt was invented) Here's a visual

    [​IMG]

    So, MobileWebbs (MW) starts each 'tri-axis' by drawing a line from the start of one line to the start of the other line, in essence drawing the first line. Then it increments a calculated amount (the distance between the start of the first line and the start of the second, divided by the number of increments, in X and Y increments) and adds those incremental values to the current position IN THE FIRST LINE, then does the same for the second line, and draws a line between those points. The last line that is drawn is the entire second line.

    MW works with 3 sets of these tri-axis sets of lines at a time. The one being drawn currently, the one that was drawn last cycle, and the one before that which is now being erased as the first set is drawn. That way, there's always one set fully displayed (the second set), one being erased and one being drawn. At the end of each cycle, the one that was erased is gone and forgotten, the one was was fully displayed becomes the next to be erased, and the one just drawn becomes the new fully displayed set for the next cycle. The new 'to be drawn' set is randomly calculated and ensured to be a nice spread to keep it from drawing tiny sets, and the new cycle starts. I should mention here that each set is duplicated and flipped both horizontally and vertically to give a full bodies, non-lopsided visual effect. A random color is assigned to the new set. This creates an illusion that it is 'flowing', and has a real nice effect

    The program continues until [ok] or the screen area is tapped, and it simply exits. The desktop screen saver has settings you can change to adjust the number of lines between the axis's and the speed in which it draws, but I removed that complexity for this demonstration on the mobile device, and set the number of intersections to 20 and the speed on a timer to 20, which is milliseconds I believe???

    MW should be screen size independent, since all it's calculations are made using the forms width and height properties. It works out of the box on my 240x320 Touch Cruise.

    Any questions, just ask. But please keep in mind that I wrote this thing a LONG TIME AGO, and details as to why something is a certain way are foggy. Just porting it over game me a headache :)

    I hope you enjoy this as much as I have. Next to come is a port of another screen saver I wrote, which is a random maze generator. I'm also considering resurecting 'Caves of Ice' from the early 80's, which the source code was published in Compute! magazine for the Commodore 64, Vic-20 and Atari 16k machines, but making it more difficult by adding the concept of zero-gravity and port hatches instead of doors, so you can really get turned around and topsie-turvie. I'm a mean one, for sure!!! :) See ya!!!

    ps. If anyone actually remembers Caves of Ice, please let me know, so I'll not be the only one from that era of self-taught computing. That would be really cool!
     

    Attached Files:

    Last edited: Oct 18, 2008
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice