I've moved most of the code we've just talked about into the preface area, just to clear the decks.
I've also added a keydown handler, with the same sort of left/right handling we've seen before.
The only difference is that instead of dealing with separate "bug_x" and "bug_y" variables, we're just accessing the ".x" and ".y" properties of the "bug" variable.
|