Adding mouse support

Recently I finally started working on adding mouse support in my game. Originally I wanted the game to be playable with controller, but for various reasons (Qt’s lack of controller support being the major one), this never materialized. First try of designing user interface was outlined in over a year old blog post.

However, as usual with the best laid out plans, as soon as I started implementing the new control scheme I realized that it was pretty flawed and downright broken. What works for Diablo and other similar games don’t translate that well into turn based game where movement is on a grid. Movement with mouse felt clunky and one needed lots of clicks to move around. It might be somewhat better if player could click far away and their character started walking toward the point, automatically stopping when something interesting pops into view.

I felt that such a scheme wouldn’t work in the end, so little redesigning was in order. Now the movement is with either cursor keys or WASD-keys. This serves to make game playable for both left and right handed players (you wouldn’t believe how frustrating it is to try play with left handed mouse when only WASD-keys are supported). Melee and unarmed attacks are done either by clicking an enemy that is next to player character or trying to walk into occupied square. Ranged attacks are currently only possible by clicking enemy with mouse.

Since WASD-keys don’t offer easy way to activate portals (stairs and such), I’m going to eventually change things so that player character walking into same space with portal will automatically activate it. This requires some fine tuning in the system, like disallowing item generation on same location as stairs and making sure that there’s always a way around stairs. This sounds doable, but I can be sure only after I have implemented that of course.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s