<p>"I played "Spampede," and it's really annoying that when I press up/down followed quickly by left/right, that I die when I shouldnt be dying. The problem is that if you press up/down/left/righ it probably immediately changes some direction variable, let's call it dir, to whatever key you pressed. That works fine and well, however when you change to a different axis (i.e. horizontal if you're going vertical or vice versa) and then quickly change to the previous axis yet going in the opposite direction than previously, then that will result in your snake object having a dir such that the snake head is directed to go directly behind itself, because the game doesn't process the direction CHANGES fast enough. So my suggestion in order to remedy this problem is to use a queue or a similar data strucutre in your snake object, such that when you change direction it stores the direction you want to change to in a queue and right before your snake moves in each iteration of the game loop have the queue dequeue(get and remove front most object) and set your snake's dir to that which you have just dequeued."</p>
<p>I considered doing that, but then I decided that (1) it would be too much work, (2) most players adapt after a while to the turnaround time, and (3) people will be tempted to overload the queue with keypresses. Also, technically, you can reverse and turn in the same clock tick (though I have yet to see a human player do that effectively :p). Therefore, with this system, there is no situation that is absolutely impossible to escape (I think)...though chances are you'll mess up anyway when you reach that situation...</p>
<p>"how long did it take to program those games (not the java) but the visual basic. do you need a special program. did you invent the program or is there a tutorial that tells you how to make it? i am really interest in that stuff!"</p>
<p>The Visual Basic programs took varying amounts of time to code. Solitaire took like 1/2 an hour, Asteroids took 4 hours to write the basic code, and several more to smooth it out, Civil War took some 100 hours (ugh...), Minesweeper took 2 (?) hours
In order to write a VB program, you need Microsoft Visual Basic, which you must purchase (or pirate...DON'T DO THIS THOUGH). When installed, there are two parts: the form design, where you can draw text boxes, command buttons, and shapes the way you would in Microsoft Word; and the code part, where you must type in almost everything (just like in Java or C++).</p>
<p>BTW, Visual Basic is NOT meant for making games :p It's meant for applications, which is why there are builtin things like drivelist boxes, filelist boxes, radio buttons, etc. I will probably rewrite Asteroids in Java someday with nearly identical mechanics, but much more efficiency.</p>