Results 1 to 5 of 5

Thread: Help in a little game

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2000
    Location
    Near Montreal
    Posts
    9

    Smile

    Hi, I start to program a little game. You move a man.(pictureBox) with 4 command(up, down, left right). I use the picture.left and picture.top to move the man. My problem is that I want to put some obstacle like box to create a maze. I dont want that the man pass over the box! Do someone have a trick ? These obstacle will be picturebox too.
    If something is not clear, e-mail me or ask what you don't understand in this forum.
    Thank you and sorry for my english, i'm french
    DarKsLiMe Was Here

  2. #2
    Member
    Join Date
    Nov 2000
    Location
    Palma de Mallorca, Spain
    Posts
    39

    Cool Try this

    code:
    If pic1.Left + pic1.Width > pic2.Left And pic1.Top + pic1.Height > pic2.Top Then
    If pic1.Left < pic2.Left + pic2.Width And pic1.Top < pic2.Top + pic2.Height Then
    'here goes the action for the collision


  3. #3
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    *hehe*recognizs his code*

    erm well, if you want to make a maze you probably want to use a map to store where you can walk. That makes collision unneccessary since you can just check if the maps there 0 (empty) or higher (number of picture there).

    Hope this helps

  4. #4

    Thread Starter
    New Member
    Join Date
    Dec 2000
    Location
    Near Montreal
    Posts
    9

    Exclamation ok....

    Like I said i'm a newbie... I will check this but I don't know if I will be able to do this...
    Will check this in the weekend and give you news!
    Tanx
    DarKsLiMe Was Here

  5. #5

    Thread Starter
    New Member
    Join Date
    Dec 2000
    Location
    Near Montreal
    Posts
    9

    Talking What code for colision

    Can you give me an example of the code for a colision and where can I paste the code.

    And can you change de pic1 and pic2 for
    picMan
    picRock
    Cause i'm not sure where to paste it

    Thank you!
    DarKsLiMe Was Here

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