CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 44
  1. #16
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    75

    Re: Need help with a whole bunch of things

    Do you happen to have aim or msn by any chance? Then I can send/link to you a zip of it containing all the files easily. I don't really want to put a link up here since I use my school's ftp.

    And if you are referring to the sound files, I fixed that.

    The flickering occurs while movement happens. The blue background I put behind the maze so that there isn't that unsightly gray showing if the person reaches the walls shows temporarily through the maze in the middle of the picture box.

  2. #17
    Join Date
    Oct 2001
    Location
    Melbourne, Australia
    Posts
    576

    Re: Need help with a whole bunch of things

    I dont... could you just update the previous post?

    anyway, checkout the me.autoredraw. maybe set that to false before you do the bit that causes the flicker, and set it back to true after you have finished. you may need to do a me.refresh also if the autoredraw doesn't repaint the screen automatically when reset to true.

    no guarantees, but it might work

  3. #18
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    75

    Re: Need help with a whole bunch of things

    The part that causes the flicker is moving the maze image, and without the game actually starting, it has just a small amount of flickering happening, but when I actually start the game, it flickers like mad... There isn't really one point that makes it flicker

    The form's autorefresh was set to false anyways, and the movement makes the image refresh itself. I may have to make the bg refresh with it perhaps to fix that... but it still won't help with what happens when I start the game...

    I'll pm you the link to the .zip in a second.

    And nope refreshing the bg didn;t work...

  4. #19
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    75

    Re: Need help with a whole bunch of things

    Fixed the major twitching for when the game started.... turns out I had the reset starting position code placed in the timer instead of the cmdstart...

    Now it just leaves the minor flashes...

  5. #20
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    75

    Re: Need help with a whole bunch of things

    Hmm... when I make it into an .exe, the sound files don't go with it.... that might explain why they didn't play the first time, since it had to load them from outside the .exe.....

  6. #21
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    75

    Re: Need help with a whole bunch of things

    I think I am going to spend tomorrow learning about some of the stuff my teacher's brother wanted me to learn.... even though it is from a 2nd year university computer science program... which is so very.....very.....above my head.... hopefully my math teacher will be able to explain all this stuff in terms I will actually be able to understand

    http://www.csd.uwo.ca/courses/CS210a/

    He wanted me to get an understanding of the stuff there... painful

  7. #22
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    75

    Re: Need help with a whole bunch of things

    Just a list of things that still need to be adressed:

    1. The whole entire setup of the maze
    2. Including sound files with the .exe
    3. Someone simplifying those very complex concepts for me
    4. Implementing a heap for the recent events list
    5. The annoying flicker that occurs when movement happens.

    There may be more, but those are the more important things for now.

  8. #23
    Join Date
    Jun 2002
    Location
    West Virginia
    Posts
    131

    Re: Need help with a whole bunch of things

    The flickering is caused by painting to the screen while the screen is being refreshed. So you need to paint the picture very fast. The fastest way is using API BitBlt. Check out this tutorial at Lucky's Gaming Site.
    http://www.rookscape.com/vbgaming/GBeebe/bitblt.php
    While there check out their tutorials on games.
    also here
    http://www.vbexplorer.com/VBExplorer/game_tutorials.asp
    they also have a BitBlt tutorial.
    BitBlt is about 10 times faster than PaintPicture although they are both built on the same API.
    Wayne
    Last edited by WayneS; October 29th, 2004 at 04:06 AM.

  9. #24
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    75

    Re: Need help with a whole bunch of things

    I would have tested it and be asking how to implement it into my own work, but my teacher sprung a highly useless waste of class time that I had to do... so I didn't get to actually do the tutorial. I'm working for most of tomorrow so I guess I'll just have to spend most of Sunday doing everything that needs to be done.

    I'd be doing something right now but Norton AV be running and Norton is such a resource hog.

    If anyone wants to help me with anything until I can actually do some work on the game, it'd be a great help to make up for the time I can't spend working on it.

  10. #25
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    75

    Re: Need help with a whole bunch of things

    Great... all that time spent learning complex stuff and we drop it because he forgot this was all in vb and that using the graph theory in vb would be too hard...

    Now we are just going to do something ala LOZ, or FF1, which was what I though was happening all along so eh, nothing lost, nothing gained really.

    Now I just need to find out how to set it all up, if anyone wants to take a look at how we are planning to set it up, look at the attachment. He hasn't gotten back to me on how to set it up so I can set each tile whether it is wall or not, and I'd prefer if I knew how to at least for when I wake up tomorrow so then I can spend Sunday setting whether each of the... *shudders* 10000 tiles.... is wall or not... I wouldn't care if I have to spend some time setting up the code, but with 10000 tiles, I need a lot of time to spend on the tiles.
    Attached Images Attached Images

  11. #26
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    75

    Re: Need help with a whole bunch of things

    Alright, Zeb gave me this:
    "with the map, do you know how you are going to do it? best way i coul see is to create a text file and read that into the map array on the form.load event. the text file would just have something like this:

    111111
    100101
    110001
    111111

    where 1 = wall and 0 = floor. (2 = pit trap, 3 = fire trap) and you read that a character at a time into your 2 dimensional array."

    He said if I didn't know how to do it, which I obviously don't, ask the forum, which I am.

    So, if anyone wants to help me, I'd really appreciate it (just the coding base for reading it, I can do the text file myself), as then I can focus on the bitblt for the map to remove the flickering. And then after that is all done, I can focus on adding whatever little things I want to add, and bring this topic to a close, and give positive ratings to those who helped
    Last edited by Bastille; October 31st, 2004 at 05:26 PM.

  12. #27
    Join Date
    Oct 2001
    Location
    Melbourne, Australia
    Posts
    576

    Re: Need help with a whole bunch of things

    OK - here's the basics. you open a file, read the data, then close the file.
    Code:
    dim i as integer
    
    ' gets the next available file number
    i = freefile    
    ' opens the file in input mode (read only)
    open app.path & "\test.dat" for input as #i
    
    ' do your reads.
    ....
    
    close #i
    There are a number of ways to read the file - input and get. Input has a function and a statement version. the best for your purposes is probably the function version:
    Code:
    ' fixed length string array
    dim x(10) as string * 1
    dim ii as integer
    
    for ii = 1 to 10
        ' read 1 character from file i and place it into the array
        x(ii) = input(1, #i)
    next
    things to be aware of:
    - how big is the file? are you sure? you may want to put some error checking.
    - end-of-line takes up two characters - carriage return (CR) and line-feed (LF). so if you have the map set out as in the above example, you have a file that is 6x4 map characters PLUS 3 CR/LF characters (and maybe another if you hit enter after the last line).
    - you can also use Line Input, which will read a line at a time into a string. it might be easier to do that until EOF and parse each string into your array.

    That should get you started. be aware though that using the above techniques is "legacy" and won't hold if you want to move on to .Net

  13. #28
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    75

    Re: Need help with a whole bunch of things

    Which I won't be <_<
    Lesse.... 100 lines... 100 characters in each... so 10300 characters in total for the file.... or something around that... so if I make the file with the characters into it, and use that code, what will be left to set up before it is a full map? I know there will be still what happens if such and such a square equals what number, but other than that, anything else?

  14. #29
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Need help with a whole bunch of things

    100 lines... 100 characters in each
    You can read it in a single step
    and hold it in an array. See
    Cakkie sticky post, and search for How
    to read a file in a single step...
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  15. #30
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    75

    Re: Need help with a whole bunch of things

    Okay... got that set up... the loading the file part.... now all that remains for me to know is:
    A) how to set it to an array
    B) Set the maze to read said array for setting up the map
    C) Setting what happens depending on each square
    D) Actually design text file

    Would any extra characters be created if I used Word to create it and then copy it over to notepad? Word is a lot easier for the design process because it can count the characters, so that way I won't put too many or too little accidentally and pay for it later.

Page 2 of 3 FirstFirst 123 LastLast

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