hi,

i've attached a DX7 program. i deactivated the game, so don't even try to play :tongue:.. just start it and press options. if you click on the name of player one or two, you can type in a name. BUT: try to type in two letters one after the other very fast. you'll notice something weird, any ideas how to solve this?

thank you..

bye
Posted on 2003-01-22 12:52:37 by NOP-erator
Well i still think you do not get it right:

1)Read the keyboard state ONLY once at frame start. As you do this first save current_state to old_state (256 bytes rep movsb)

2)Check for a new key by reading curent state first. Sample just for the key you want, do not check the whole current_status.

If there is a pressed key you must olso check the old_state ... if there was no key pressed in the previous frame. Only this way you detect a valid key press.

3)DO NOT modify current_state and old_state this frame! the only way of change them should be point 1) above


Besides wellcome to OS keyboard programming problems, actually via DirectInput you have almost the same problems as OS makers.

Theoretically you should add a repeat key delay to those actions (first delay and repetitive delay) ... but they might not be needed by your kind of game.

PS.
-----
that cool font of yours, remains on HDD after Ctrl+Alt+Del +End task :)
Posted on 2003-01-22 16:58:04 by BogdanOntanu
hey bogdan, i did it like you told me, everything works fine, the key isn't duplicated anymore. i got the idea of saving the old key (not the whole keystate!) and checking in the current key state if this particular key was pressed!
the only problem that remains is, that the keyboard state is obviously read too fast, so that it somehow duplicates (?) the keys when i press one after the other very fast. if this is actually a real problem is another question.. nobody would type in his name that fast! this delay stuff you told me about would problably solve it.. who knows.. it's not a serious problem so I'll leave it for the moment, and will concentrate on the more important things..

of course the font remains on you hdd, when you don't quit the game properly.. but the intention was to keep the font for you, right? :alright:
btw: is it typical to use a special font and drawing the text - for example in the options menu - instead of putting everything in gifs and bitmaps?

thanks for your effort...
erm.. do you think this game has any "future" or is it just too lame? ^^'

bye
Posted on 2003-01-23 10:56:25 by NOP-erator
Well i have missed the version with the game running,

So i have just an ideea about what the game does from the game title, but yes i think the game might have "a future" if done right. Like in: it must be fun to play and not cost too much :)

After all ... at the end of the day... everybody might want to play a little game that is funny, dosent require too much thinking and its just a few kilobytes on your HDD...

(well you could add some megabytes to the klobytes with no problem)

About using fonts to draw, well yes one could use standard GDI functions with TTF fonts ... unless:
1) more speed is required
2) you can not do the effect you are after fast enough with GDI/fonts

But i have to say your menu's look cool!

I still do not get it why is that key repeating only IF i type another key very fast... i hope is not an issue with key_up / key_down . AFAIK the hardware keyboard controller has some delays included in hardware so i am not sure it is a delay related problem.

You should not consider another key down unless old key is zero and curent key is one...so it dosent matter how fast i press another key... there is "no way" it can make another key fire because the status for that old key will be ONE until i release the old key "no matter" how many new key and how fast i press them...

... logically speaking ... but in practice you might have to check your code...
Posted on 2003-01-23 19:21:01 by BogdanOntanu
Hi!

oh well.. i know where a made the mistake. i expected the key to be sent exactly two times to my program, so i cleared oldkey after caching it a second time. ^^' sorry.. hehe..
it works perfectly now, i attached a version with the game running, there are no bugs atm afaik! *yeeehaaa*

thanks! :alright:

bye
Posted on 2003-01-24 04:39:08 by NOP-erator