April 27, 2009, 11:23 pm
More on tanks and fullscreen and versus mode!
I decided after I cobbled together an initial 'story mode' for the tanks game I posted awhile ago that I'd like to use the game as a means to learn as much as possible about 2d game development in general. I then decided it'd be nice to have other game modes; I implemented 'arcade mode' first as it required almost no changes to story mode, save for making the player start at level one again whenever they died.

I also wanted a versus mode, harking back to the days of two players on one keyboard - I stumbled into a key ghosting issue, which I eventually solved by changing my control scheme to use control and shift for fire - I'm not sure it'll solve the problem for everyone, but it's better than nothing! I wrote a small ControlScheme class in the process, which has gone back into what is becoming a sort of Slick partial reimplementation in as3.

I also had to solve the split screen issue, which works perfectly now and I'm very happy with, since it's given me a nice reusable Camera class :D I've still got to refactor collision detection, although I've started. I'm also planning a two player coop mode, a bot deathmatch mode, and a two player bot deathmatch mode. There may also be network play at some point in the future, but that's a whole other kettle of fish...

The last thing I did was investigate fullscreen in flash, which is sort of ok as long as you don't want people to use it in their browsers - with the latest flash player you can use nonprintable characters like arrow keys and space, but the only reason I want to use fullscreen is for two player split screen, which needs to use printable characters...

Also had to use fscommand to trap all keys in the standalone player, otherwise ctrl (fire for player 2) and w (forward for player 1) will close the movie :) I also had to resize things to suit the user's monitor aspect ratio, but that works fine. I'm planning eventually to release the whole game as an offline game, so fullscreen can be exploited usefully.

The only thing left that slightly bugs me is that I have to fully qualify dynamic class names when I attach them to tiles in Tiled, but I suppose that's not too irritating :D And I've begun rewriting the bot AI to utilize some ideas from Reynold's paper. It's working ok so far, but I haven't combined it with the A* implementation I'm using yet - currently the bots are very dumb and wasteful, and will plot a path to the player even if they aren't on screen! So ideally we'll have a random wandering behaviour and a hunting behaviour: the bots could certainly use A* as a subsidiary hunting method, but I may just ditch it and only hunt if there is line of sight... I think the current behaviour is a bit 'zombie swarm' for my liking, and following the A* path tile for tile looks very unnatural. Turrets and Boss tanks are good so far - the Boss tanks move so slowly that their tracking looks fine, and the player will almost definately die before the tank ends up on top of them and their dumbness becomes apparent. I've also got some other game ideas after this is done, but hopefully if I concentrate on this project I'll be able to get the subsequent ones completed far more quickly :)

No comments.
Add Comment
Name:

Comment: