![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hand Crafted
Join Date: Nov 2007
Location: The Pit
Posts: 13
Rep Power: 0
![]() |
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 SubAt 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 |
|
|
|
|
|
#2 |
|
Hand Crafted
Join Date: Nov 2007
Location: The Pit
Posts: 13
Rep Power: 0
![]() |
Re: Screen Saver (sort of ...)
Is anyone able to provide some help for this?
|
|
|
|
|
|
#3 |
|
Professional Programmer
|
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 |
|
|
|
|
|
#4 |
|
Hand Crafted
Join Date: Nov 2007
Location: The Pit
Posts: 13
Rep Power: 0
![]() |
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. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |