回 帖 发 新 帖 刷新版面

主题:黑客帝国之矩阵

dos下显示和黑客帝国中的绿色矩阵刷屏的效果
难度是不是大了??

回复列表 (共27个回复)

21 楼

大家不觉得不太爽~
不是01010101的显示~
不如电影,我将网络学者的稍微改动了一下,即可是满屏幕的0101010101010[em1]
将他的子程序的ChangText改动如下:
SUB ChangeText (TextStream AS MatrixTextStreamType)
    DIM Count AS INTEGER
    DIM TempText AS STRING

    RANDOMIZE TIMER
    FOR Count = 1 To MatrixTextStreamLength -1
        TempText=TempText +CHR$(INT(48.5+RND))
    NEXT

    TextStream.Text =" "+TempText
    END SUB
[color=FF0000]CHR$(INT(48.5+RND))[/color]
这是改动部分~

22 楼

第一次接触QB,改的不知好不好~[em1]

23 楼

大家不是很关注啊~[em10]

24 楼

[url]http://www.vb126.com/bbs/dispbbs.asp?boardid=5&id=74[/url]
以上是我在 C 下的黑客帝国之矩阵设计,大家可以到那里去看看.

25 楼

'*****************************************************
'* File name: Matrix.bas                             *
'* Author:    JingTao                                *
'* Update:    2004/01/19                             *
'*         A matrix text stream demo program         *
'*                                                   *
'*****************************************************

Const MatrixTextStreamLength% = 15  'REM 0<It<MaxColor
Const LowestSpeed! = 0.3            'REM The lowest speed
Const TextStreamCount% = 20         'REM Count of text streams

Type MatrixTextStreamType
    X As Integer
    Y As Single
    Speed As Single
    Text As String * MatrixTextStreamLength
End Type

Const ScreenMode% = 12              'REM G:640*480*16, T:80*30
Const ScreenTextWidth% = 80
Const ScreenTextHeight% = 30
CONST FALSE% = 0
CONST TRUE% = NOT FALSE

DECLARE FUNCTION UpdateTextStream% (TextStream AS MatrixTextStreamType)
DECLARE SUB DisplayTextStream (TextStream AS MatrixTextStreamType)
DECLARE SUB GenerateTextStream (TextStream AS MatrixTextStreamType)
DECLARE SUB ChangeText (TextStream AS MatrixTextStreamType)
DECLARE SUB GenerateMatrixPalette ()

Dim MatrixTextStream(TextStreamCount) As MatrixTextStreamType

Screen ScreenMode
Cls

Dim Count As Integer

For Count = 1 To TextStreamCount
    GenerateTextStream MatrixTextStream(Count)
Next

GenerateMatrixPalette

While INKEY$ <> Chr$(27)
    For Count = 1 To TextStreamCount
        DisplayTextStream MatrixTextStream(Count)
        If UpdateTextStream(MatrixTextStream(Count)) Then
            GenerateTextStream MatrixTextStream(Count)
        End If
    Next
Wend

End

Sub ChangeText(TextStream As MatrixTextStreamType)

    Dim Count As Integer
    Dim TempText As String

    Randomize Timer
    For Count = 1 To MatrixTextStreamLength - 1
        TempText = TempText + Chr$(Rnd * 222 + 33)
    Next

    TextStream.Text = " " + TempText

End Sub

Sub DisplayTextStream(TextStream As MatrixTextStreamType)

    Dim Count As Integer
    Dim CharX As Integer, CharY As Single

    For Count = 1 To MatrixTextStreamLength

        CharX = TextStream.X
        CharY = TextStream.Y + Count

        If CharY < ScreenTextHeight + 1 And CharY > 1 Then
            If CharX <= ScreenTextWidth And CharX > 0 Then
                LOCATE Int(CharY), CharX
                Color (MatrixTextStreamLength - Count + 1)
                Print Mid$(TextStream.Text, Count, 1);
            End If
        End If

    Next

End Sub

Sub GenerateMatrixPalette()
    Dim Count As Integer
    Dim Red As Integer, Green As Integer, Blue As Integer

    For Count = 1 To MatrixTextStreamLength
        Red = 0
        Green = 63 - (Count - 1) * (64 / MatrixTextStreamLength)
        Blue = 63 - (Count - 1) * (64 / MatrixTextStreamLength)
        Palette Count, Red + Green * 256 + Blue * 65536
    Next

End Sub

Sub GenerateTextStream(TextStream As MatrixTextStreamType)
    
    Randomize Timer
    TextStream.X = Int(Rnd * ScreenTextWidth) + 1
    TextStream.Y = -Rnd * MatrixTextStreamLength
    TextStream.Speed = Rnd + LowestSpeed
    ChangeText TextStream

End Sub

Function UpdateTextStream%(TextStream As MatrixTextStreamType)

    TextStream.Y = TextStream.Y + TextStream.Speed
    ChangeText TextStream
    If TextStream.Y > ScreenTextHeight + 1 Then
        UpdateTextStream = True
        Exit Function
    End If
    UpdateTextStream = False

End Function

26 楼

我看不懂

27 楼

楼主:
[url=http://www.programfan.com/club/showbbs.asp?id=49042] [原创]黑客帝国之数据流 [/url] 看到的效果要好些!

我来回复

您尚未登录,请登录后再回复。点此登录或注册