Skip to main content
9 events
when toggle format what by license comment
Apr 25, 2011 at 15:20 vote accept Tom
Apr 25, 2011 at 13:24 comment added Tom EDIT: I didn't realise that the Draw method had been changed which I've done now. It seems to work now apart from one issue - the questions and answers have stopped cycling through, but it showing the "|orange: 9" which is the way I've set up the XML file.
Apr 25, 2011 at 13:06 comment added Tom Edit: I got it working, I made a local variable within the Update method but I forgot to put "= new KeyBoardState" which has made it work. Now when the game runs, it still displays all the questions one after another and doesnt stop..
Apr 25, 2011 at 13:01 comment added Tom I've tried using this but I've got problems with the keyboardstate method that Roy T has given. Its giving an error for the line "GetState" saying its a method used incorrectly. I tried making a variable for the Update method for currentState but that hasnt worked either... :(
Apr 22, 2011 at 17:35 comment added Nate @Roy a good point on keypress.
Apr 22, 2011 at 7:51 comment added Roy T. I think your answer is better than mine :). Small addendum A lot of newbies have problems with detecting a keypress (because its hard to hold a button for less than 15ms. So here is the code that to detect a key press: KeyBoardState oldState; if(Keyboard.GetState.IsKeyDown(Keys.A) && !oldState.IsKeyDown(Keys.A)){ userChoseAnswer = true; } oldState = Keyboard.GetState();
Apr 21, 2011 at 21:42 comment added Ray Dey +1 This. A question and answer game shouldn't worry about timing unless they're timed questions, but the primary sentinel value should be checking whether a user has answered in the first place.
Apr 21, 2011 at 20:13 history edited Nate CC BY-SA 3.0
fixed a bug in my code :)
Apr 21, 2011 at 19:20 history answered Nate CC BY-SA 3.0