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
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:
For X = 0 To Form1.Count - 1
If X > Form1.Count - 2 Then
For Y = X + 1 To Form1.Count - 1
If ((Form1.Controls(X).Left > Form1.Controls(Y).Left) And _
(Form1.Controls(X) < (Form1.Controls(Y).Left + Form1.Controls(Y).Width)) And _
(Form1.Controls(X).Top > Form1.Controls(Y).Top) And _
(Form1.Controls(X).Top < (Form1.Controls(Y).Top + Form1.Controls(Y).Height))) Then
ViolatingSpace = True
End If
Next Y
End If
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!
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
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.
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..