|
-
May 4th, 2004, 04:04 PM
#1
Thread Starter
Lively Member
Insane after 5 days codeing HELP!
Ok! here is the situation guys, i have writen a kinda memory game program in VB, i have done everything but the game code, i learn how to use XML stuff in the prosess, resource file and other cool stuff.
The only thing is, about 5 night on the trot i have re writen the game code! u kno when you start falling over your own logic and subs and your going in ciruls, you wake up in the morning and think either *** WAS I THINKING!, or you totaly forgot you chain of logic and now ur code is ***, anyways this has happend about 5 times, well night, so what i need is bloody help ish, i decided on a new mothod for populateing my buttons and stuff, since the game code is basicly as follows.
I have 5 buttons, and each time the code goes round the text on these will change, then i have a imagebox and thats got an image thats changed every time the code goes round, when the correct button is pressed that corasponds to the picture box then a new picture should appear, there are 5 pictures in a set.
God knows what im going to do, anyway, i was thining in the intrest of tidying the ******* up, i wanna slap alot of the routines into class's, how can i pass one ting to a class but get it to return about 5-6 things back? is it somnething to do with byval but in a function, god i dunno, i probibly knew thins about 5 days ago, im so messedup now tho
main messege is like HELP!!
Last edited by Lethal; May 5th, 2004 at 07:34 AM.
-
May 4th, 2004, 04:09 PM
#2
Fanatic Member
when you says the code goes round ? what do u mean ? is there a loop, are you using an array (if not id use one) ?
You shouldnt be falling over the logical structure of this size of game 5 buttons 1 picture sounds like the lucky number 7 game to me.......
Code examples of what youve already got would be nice
I am curretly building a defect management system for software and web developers,
If you wana try it out (beta test) and keep it for free just send me a message
-
May 4th, 2004, 04:40 PM
#3
Thread Starter
Lively Member
trust me on the fact its all gui atm, pulling of an xml file way to messy to post what i have, but let me explain in a bit more detail ok. example
in my resource file i have a picture of 5 cars all diffrent makes ok, ford, dodge, toyota, honda,opel,
some how i want 1 picture to appear in the picture box thing ok, and the 5 button to display thoses names, one each then when the button that corasponds to the picture is licked chnage the picture, untill all are correct, at the end the user needs a question wather to do it again or move on to the next set of 'stuff', also i might like to pull this if they wanna try again vaule of the xml sheet, lets just say get it from a value atm.....ok say that value is how many time to display each picture...am i makeing sence? i hope so lol,m im so messed up now hahahha
cheers guys i totaly thank everyone for their help|!!!!! sooooo much
-
May 5th, 2004, 03:27 AM
#4
Fanatic Member
OK Personally i would wack a dimenional array for the questions and pictures
Dim QuestionArray(5,5) as string
QuestionArray(0,0) = "Picture file of car"
QuestionArray(0,1) = "some text"
QuestionArray(0,2) = "some text"
QuestionArray(0,3) = "some text"
QuestionArray(0,4) = "some text"
QuestionArray(0,5) = "some text"
then the second question would be
QuestionArray(1,0) = "Picture file of car"
QuestionArray(1,1) = "some text"
QuestionArray(1,2) = "some text"
QuestionArray(1,3) = "some text"
QuestionArray(1,4) = "some text"
QuestionArray(1,5) = "some text"
You could use a timer or something to make the selection from the array random, and remember the indexes of the array youve shown so you dont repeat the same question.
then you just use simple onclick sub on the 5 buttons
if you text the buttons 1 to 5 then you can pick up the value of the click nice and easy the last index of the array i.e.QuestionArray(1,5) = "some text" can contain the correct answer QuestionArray(1,5) = "4" then on the click events have this
if me.button3.text = QuestionArray(1,5) then
answer is incorrect deal with it
end if
if me.button4.text = QuestionArray(1,5) then
answer is correct deal with it
end if
this way its a nice easy structure to follow. You could be clever and load the array from an xml document. just each element in the xml get put into a value of the array......
this would be nice if you want to release a load of questions in a single file,
hope it helps
if me.
I am curretly building a defect management system for software and web developers,
If you wana try it out (beta test) and keep it for free just send me a message
-
May 5th, 2004, 03:42 AM
#5
Thread Starter
Lively Member
i was trying my very best to stay aaway from arrays as like 95% of my crap i write has them, i was thinking of a class and pass something to that class, like say car and it will pass back all the stuff to populate the board or populate the board its self, but it makes me make a as new frmGame and that just makes a new for not use the original i spent ages on this sofar so i wanna keep it as tidy as possible, an array might get a bit messy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|