Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 21st, 2007, 7:42 PM   #1
Megabyte
Hand Crafted
 
Megabyte's Avatar
 
Join Date: Nov 2007
Location: The Pit
Posts: 13
Rep Power: 0 Megabyte is on a distinguished road
Screen Saver (sort of ...)

Well, technically not a screen saver (or not right now). But our current project is to make one set of the lines from the 'mystify' screen saver on Windows.

Option Explicit

Private Sub cmdStart_Click()

Dim sngX As Single
Dim sngY As Single
Dim sngX2 As Single
Dim sngY2 As Single
Dim sngColors As Single
Dim sngDelay As Single
Dim intChangeX As Integer
Dim intChangeY As Integer
Dim intChangeX2 As Integer
Dim intChangeY2 As Integer

intChangeX = 1
intChangeY = 1
intChangeX2 = 2
intChangeY2 = 2

Do
    sngX = sngX + intChangeX
    sngY = sngY + intChangeY
    Line (sngX, sngY)-(10000, 8000), sngColors
   
    sngDelay = 0
    Do
        sngDelay = sngDelay + 1
    Loop Until sngDelay = 1000
   
    Line (sngX, sngY)-(10000, 8000), vbBlack
    If sngY >= Me.Height - 380 Then
        intChangeY = -1
        sngColors = vbGreen
    End If
    If sngX >= Me.Width - 380 Then
        intChangeX = -1
        sngColors = vbYellow
    End If
    If sngY <= 0 Then
        intChangeY = 1
        sngColors = vbRed
    End If
    If sngX <= 0 Then
        intChangeX = 1
        sngColors = &H80FF&
    End If
   
    Line (sngX, sngY)-(5000, 4000), sngColors
   
    sngDelay = 0
    Do
        sngDelay = sngDelay + 1
    Loop Until sngDelay = 1000
   
    Line (sngX, sngY)-(5000, 4000), vbBlack
    If sngY >= Me.Height - 380 Then
        intChangeY = -1
        sngColors = vbGreen
    End If
    If sngX >= Me.Width - 380 Then
        intChangeX = -1
        sngColors = vbYellow
    End If
    If sngY <= 0 Then
        intChangeY = 1
        sngColors = vbRed
    End If
    If sngX <= 0 Then
        intChangeX = 1
        sngColors = &H80FF&
    End If
   
    sngX2 = sngX2 + intChangeX2
    sngY2 = sngY2 + intChangeY2
   
    Line (sngX2, sngY2)-(10000, 8000), sngColors
   
    sngDelay = 0
    Do
        sngDelay = sngDelay + 1
    Loop Until sngDelay = 1000
   
    Line (sngX2, sngY2)-(10000, 8000), vbBlack
    If sngY2 >= Me.Height - 380 Then
        intChangeY2 = -1
        sngColors = vbGreen
    End If
    If sngX2 >= Me.Width - 380 Then
        intChangeX2 = -1
        sngColors = vbYellow
    End If
    If sngY2 <= 0 Then
        intChangeY2 = 1
        sngColors = vbRed
    End If
    If sngX2 <= 0 Then
        intChangeX2 = 1
        sngColors = &H80FF&
    End If
   
    Line (sngX2, sngY2)-(5000, 4000), sngColors
   
    sngDelay = 0
    Do
        sngDelay = sngDelay + 1
    Loop Until sngDelay = 1000
   
    Line (sngX2, sngY2)-(5000, 4000), vbBlack
    If sngY2 >= Me.Height - 380 Then
        intChangeY2 = -1
        sngColors = vbGreen
    End If
    If sngX2 >= Me.Width - 380 Then
        intChangeX2 = -1
        sngColors = vbYellow
    End If
    If sngY2 <= 0 Then
        intChangeY2 = 1
        sngColors = vbRed
    End If
    If sngX2 <= 0 Then
        intChangeX2 = 1
        sngColors = &H80FF&
    End If
   
Loop Until sngX > Me.Width

End Sub

Private Sub Form_Load()

Me.WindowState = 2

End Sub

At this point, pretty much all of it works, except 2 of the points don't move.

http://img159.imageshack.us/img159/3596/ssrt6.jpg
The points circled in red continue to remain stationary.

What needs to be added and/or changed in my code to do so?

Saw someone else just asked a question similar .. Possibly from my class (or another period) since it all looks familiar in that code. Heh. :p
Megabyte is offline   Reply With Quote
Old Nov 29th, 2007, 4:27 PM   #2
Megabyte
Hand Crafted
 
Megabyte's Avatar
 
Join Date: Nov 2007
Location: The Pit
Posts: 13
Rep Power: 0 Megabyte is on a distinguished road
Re: Screen Saver (sort of ...)

Is anyone able to provide some help for this?
Megabyte is offline   Reply With Quote
Old Nov 29th, 2007, 4:30 PM   #3
Wizard1988
Professional Programmer
 
Wizard1988's Avatar
 
Join Date: Oct 2005
Location: Chitown
Posts: 414
Rep Power: 3 Wizard1988 is on a distinguished road
Send a message via AIM to Wizard1988
Re: Screen Saver (sort of ...)

One thing you can try is changing different values in the code and observing how they change the drawing. From there you can modify the code to fit your needs.
__________________
JG-Webdesign
Wizard1988 is offline   Reply With Quote
Old Nov 29th, 2007, 4:50 PM   #4
Megabyte
Hand Crafted
 
Megabyte's Avatar
 
Join Date: Nov 2007
Location: The Pit
Posts: 13
Rep Power: 0 Megabyte is on a distinguished road
Re: Screen Saver (sort of ...)

I don't think I need a specific value. I believe I need something similar to the sngX and the sngY where the (10000, 8000) and (5000, 4000) values are.
So I believe I would need something like and sngXChange and sngYChange, along with sngXChange2 and sngYChange2 in those places.

I don't really know what the numbers they need to equal have to be or how to implement them. I tried the other day but it screwed up my program.

If I don't have the correct idea please let me know, and any other tips, hints, or whatever to help me finish are appreciated.
Megabyte is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Screen Saver - Hue Alteration Kilo C# 7 Jan 7th, 2007 1:53 PM
Quick Sort program jazz C 11 Jun 1st, 2006 4:08 AM
sort and swap brad sue C 1 Mar 25th, 2006 6:33 AM
Senior Capstone-Spying Screen Saver Hounder Project Ideas 23 Dec 16th, 2005 7:00 PM
threaded merge sort help AusTex C 1 May 1st, 2005 4:58 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:28 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC