Results 1 to 5 of 5

Thread: db

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2004
    Posts
    11

    db

    hi,

    doing a school project and would like to noe how to add an access database cause mine keeps saying that database cannot be opened, 2ndly i need help figuring out how to detect when 1 object moves ontop of another object(collision).
    thnx

  2. #2
    Addicted Member
    Join Date
    May 2004
    Location
    China
    Posts
    228
    You'll get more help if you post more detailed posts. Where are you getting an error opening the db? What is the line of code? What is the error?

    As for your second question, something like

    VB Code:
    1. For X = 0 To Form1.Count - 1
    2.         If X > Form1.Count - 2 Then
    3.             For Y = X + 1 To Form1.Count - 1
    4.                 If ((Form1.Controls(X).Left > Form1.Controls(Y).Left) And _
    5.                 (Form1.Controls(X) < (Form1.Controls(Y).Left + Form1.Controls(Y).Width)) And _
    6.                 (Form1.Controls(X).Top > Form1.Controls(Y).Top) And _
    7.                 (Form1.Controls(X).Top < (Form1.Controls(Y).Top + Form1.Controls(Y).Height))) Then
    8.                     ViolatingSpace = True
    9.                 End If
    10.             Next Y
    11.         End If
    12.     Next X

    I didn't actually test that to see if it works, just for syntax. It also only checks to see if the top left corner is violating another control's space. Some lines would have to be added to also test for the bottom right... Someone else simplify that, please!
    You know the best way to find the answer to your question? SEARCH!
    www.google.com
    www.planet-source-code.com
    www.msdn.com
    http://www.vbforums.com/search.php?s=
    P.S. Its faster than waiting for replies too!

    [vbcode]
    If InStr(1, Message, "FIX MY CODE") <> 0 Then Reply = False
    If AnswerIn(Google, VB_Forums, PSC, MSDN) = True Then Reply = False
    [/vbcode]

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2004
    Posts
    11
    okay well heres basically wat i'm trying to do.. (would it help if i attach my project?), i'm trying to make a game... in a way similar to mario land (hehehehe evil) anyways.. i need a database to store 10 scores on my score board, so that i'm hoping is nice and simple, 2ndly i've got a timer sending objects flying accross the screen from right to left, and my lil dude is meant to dodge them, however atm it won't detect a collision so my player can just go jumping through bricks without loosing lives or bouncing back etc. I have tried to detect using the bottom left corner of the brick and the top right corner of the player and this worked... for a while... but a bit dodgy. but after i added an image list into my form it killed the collision detection and i can't fix it :S besides my collision detection before only detected half the time :S

  4. #4
    Addicted Member
    Join Date
    May 2004
    Location
    China
    Posts
    228
    Yeah, it might help if you attach your project. As per the db. You really don't need a real db to keep track of 10 things. Use an ini file. Store the scores as hex numbers, that will fool most people into not fooling around with them. Keep an md5 checksum of each score if you really don't want them touching them. Will fool all but the best (at least most determined!) Rot13 the md5 and you will confuse all except the top rank of Mensa.

    This does raise another question... You have to program a Mario clone for school? That just seems a little... odd.
    You know the best way to find the answer to your question? SEARCH!
    www.google.com
    www.planet-source-code.com
    www.msdn.com
    http://www.vbforums.com/search.php?s=
    P.S. Its faster than waiting for replies too!

    [vbcode]
    If InStr(1, Message, "FIX MY CODE") <> 0 Then Reply = False
    If AnswerIn(Google, VB_Forums, PSC, MSDN) = True Then Reply = False
    [/vbcode]

  5. #5

    Thread Starter
    New Member
    Join Date
    May 2004
    Posts
    11
    hahahah well i have no idea wat an ini file is.... but anyways the teacher basically says go make ur own project so i decide to make a game and he says better be decent and i say my idea and hes says its total bull crap i decided to go bak to the good old days of mario and he says thats cool so i go ahead but now with about 4 weeks b4 due date its jz a pile of **** lol i suck at programming and its not really that close to mario.... jz the closest think i can compare with and that everyone noes... if u see my project u'll cry that its so bad LOL..
    Attached Files Attached Files

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