CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Movies

  1. #1
    Join Date
    Aug 2001
    Posts
    5

    Movies

    I have programmed a game so that when the player wins they see a video. But i don't want them to be able to go into the game folder and watch the video until they win. The video is 98 MB so resource files are kinda of out of the question (unless someone knows how to use one with that big of a file) I want to play the video with windows media player. How can I make it so they can't see the video until they win?


  2. #2
    Join Date
    Aug 2001
    Location
    wenatchee washington
    Posts
    7

    Re: Movies

    I may be totally wrong as I am a total newbie to programming but couldnt you setup a password to protect activation and then call that password from within your code ? just a thought. Bryan

    HEEELLLP !!! I am Brand new to programming and desperately need someone to take my hand (no not literally LOL) I have sooo many questions and no answers. can ya please help me ?

  3. #3
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Movies

    You might 'disable' the movies. Most movies don't play when the header is messed up, so mess it up. Say like adding a few character to the beginning of the file. Then, when you are about to play the movie, remove the chars. After playing, add them again.

    private Sub EnableMovie(strFilename as string, strFileNameOut as string)

    Dim FFileIn as Integer
    Dim FFileOut as Integer

    FFileIn = Freefile
    Open strFileName for binary Access Read as #FfileIn

    FFileOut = Freefile
    Open strFileNameOut for Output as #FfileOut

    print #FFileOut, input(FileLen(strFileName)-1,#FfileIn);

    Close #FfileIn
    Close #FFileOut

    End Sub



    This code opens a file, removes the first character, and writes the rest to another file. You could use this to enabled a movie, write it to nother file, and open that file. The only thing you need to do is to disable your movies by adding 1 character at the beginning, and remove the outfile after use.

    EnableFile App.Path & "\level2.dat", App.Path & "\movie.avi"
    SomeSubThatPlaysTheMovie
    Kill App.Path & "\movie.avi"



    This way, you can also give your movies another name (like .dat) which also doesn't draw very much attention.

    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured