Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Help with VB6

Options
  • 19-06-2003 6:53pm
    #1
    Registered Users Posts: 3,779 ✭✭✭


    I am currently doing a little game, nothing fantastic just a 'dodge the falling objects' kind of thing. For the completion of an introduction to VB6 course I am currently doing.

    The problem is that there appears a lot of 'clipping' (I think thats the term) when there are alot of moving objects.

    maybe a link to the game would be helpfull

    game

    its still no where near finished, I know I have few things to sort, but I have no idea how to sort this 'clipping'


Comments

  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    Can you post the source files instead ping?


  • Registered Users Posts: 3,779 ✭✭✭Ping Chow Chi


    ok - the above link now points to the source files

    just need help on the 'clipping' problem though - let me work out the rest of the stuff for myself though, so no pointing out the other errors of my code please :x


  • Registered Users Posts: 3,779 ✭✭✭Ping Chow Chi


    asked my tutor about this on saturday and apparently there is not a great deal I can do to solve it. :(


  • Registered Users Posts: 629 ✭✭✭str8_away


    There is way to get rid of 'clipping' fleaker whatever.
    To do this you need 2 picture boxes and one API function

    take a look of API function
    Private Declare Function BitBlt Lib "gdi32" ( _
    ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, _
    ByVal nWidth As Long, ByVal nHeight As Long, _
    ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, _
    ByVal dwRop As Long) As Long
    

    This function can copy content of one picture box to an other.
    So what you do is prepare your "Screen" on one picture box 1 in the back ground. When it is ready copy it to picture box 2 and it will display in one.

    To show this working quickly,
    1) copy yhte above function on top of your code in frmGame
    2) create 2 picture box, picture1 and pitcure2 with same height and width. (4815 and 8400)
    3)move your image array (imgGame) into picture1
    4)add following code in generatePulse() just before end sub
    BitBlt Picture2.hDC, 0, 0, Picture1.Width, Picture1.Height, Picture1.hDC, 0, 0, vbSrcCopy
    
    5) set left and top of picture1 to (240,720)
    6) set left and top of picture2 to (4560,5640)
    7) set frmGame hight and width to (11520,13215)
    8)press F5 and move the application to the centre of screen.

    You will see that in Picture2 there is no 'clipping' and in pictureon there is.
    You will also see something "funny" in picture2. This is because you have image array inside the picture box (I think)
    To get ride of that you will need to resture your game. Use BitBlt to copy "bomb" and "gren" into picture2. instead of image array.

    Hope this helps


  • Registered Users Posts: 3,779 ✭✭✭Ping Chow Chi


    thanks for the help - I think it will take me a little time to understand what this does before I impliment it though :D


  • Advertisement
  • Registered Users Posts: 629 ✭✭✭str8_away


    And you should.

    Let me know if you have any question.


Advertisement