Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Key Movements #24

Closed
wants to merge 9 commits into from
Closed

Key Movements #24

wants to merge 9 commits into from

Conversation

sgricci
Copy link

@sgricci sgricci commented Mar 28, 2012

Added ability to move around the map using arrow keys.

@willurd
Copy link

willurd commented Mar 28, 2012

We might want to use WASD for right-handed players as this game also requires control of the mouse. Left handed players would probably still want to use the arrow keys:

case Types.Keys.LEFT:
case Types.Keys.A:
    game.makePlayerGoLeft();
    break;

@sgricci
Copy link
Author

sgricci commented Mar 28, 2012

@willurd: thanks for the suggestion, I've added WASD and "space" for attack, as well as several other hotkeys for other parts of the interface

@willurd
Copy link

willurd commented Mar 28, 2012

Nice!

@Keylan
Copy link

Keylan commented Mar 28, 2012

Hotkeys still seem to be active while typing in chat box, which causes movement as well as help, achievement windows, etc. to open while typing a message. I'd suggest deactivating these hotkeys while the chat window is open. :-)

@christosporios
Copy link

This was really needed, nice.

@joequery
Copy link

@Keylan Would the best way to proceed with that be offer an entirely different switch statement based on

 if($('#chatbox').hasClass('active'))...

?

@Keylan
Copy link

Keylan commented Mar 28, 2012

@joequery I don't think an entirely different switch case is necessary. Can probably just edit the if statement before it to:
if (game.started && !$('#chatbox').hasClass('active')) {

considering the handler for the enter key is before the if statement.

@joequery
Copy link

@Keylan Ah, good point, I didn't realize that all the keys relate to out of chat functionality.

@damajor
Copy link

damajor commented Mar 28, 2012

WASD does not suit any keyboards, think about other kb layouts.

@willurd
Copy link

willurd commented Mar 28, 2012

@damajor Do you mean that it doesn't suit all keyboard layouts?

@namanix
Copy link

namanix commented Mar 29, 2012

Ever heard of azerty keyboards. If not. Google it. And view the pictures. And look at the places of the keys. It will make you gasp ;p

@willurd
Copy link

willurd commented Mar 29, 2012

@namanix I'm sure most programmers are aware that non-qwerty keyboard layouts exist. Short of providing some mechanism of configuring key bindings (which is possibly something we might want to look into), I'm unsure how we might go about supporting all of them.

@damajor
Copy link

damajor commented Mar 29, 2012

@willurd : you cannot use WASD on some kb layouts because it has no meaning due to the keys location.

@willurd
Copy link

willurd commented Mar 29, 2012

@damajor How would you get around that?

@damajor
Copy link

damajor commented Mar 29, 2012

Honestly I didnt dig into JS features so I can only propose 2 ways to work around this issue:

  • let the user sets the keys he wants to use for Up/Left/Right/Down...

or

  • (far from being efficient) grab the main existing kb layouts and do some preconf inside the JS based on the kb layout detection (but I dont know if it is feasible).

@christosporios
Copy link

@damajor Yes, but why do that? Why complicate the UI by adding an additional menu with configuration options that 95% of the users will never touch? In this case, I think simplicity is more important than configurability. Whoever doesn't like the keyboard commands can just use their mouse. I think azerty keyboard users will actually be glad BrowserQuest provides mouse support.

@damajor
Copy link

damajor commented Mar 29, 2012

@tech-no-crat Complicated UI, yes that is what we are debating here. I just think that when a feature is implemented it has to be done the right way and in a way to be portable and available for everyone.

Making a feature and saying to someone or a bunch of people "no you can't use it because you do not live there or there and/or does not own such kind of peripheral" is just too easy.

I wont argue on you arguments that says that azerty people should be happy to have their mouse to be able to play the game, I am just sick of that....

@sgricci
Copy link
Author

sgricci commented Mar 29, 2012

You can also use arrow keys.

Also, you can always run your own server and change the keys setup in the
shared/js/gametypes.js file.
On Mar 29, 2012 8:20 AM, "Xav" <
reply@reply.github.com>
wrote:

@tech-no-crat Complicated UI, yes that is what we are debating here. I
just think that when a feature is implemented it has to be done the right
way and in a way to be portable and available for everyone.

Making a feature and saying to someone or a bunch of people "no you can't
use it because you do not live there or there and/or does not own such kind
of peripheral" is just too easy.

I wont argue on you arguments that says that azerty people should be happy
to have their mouse to be able to play the game, I am just sick of that....


Reply to this email directly or view it on GitHub:
#24 (comment)

@christosporios
Copy link

@damajor:

Complicated UI, yes that is what we are debating here

Configurability and simplicity do depend on each other.

I just think that when a feature is implemented it has to be done the right way and in a way to be portable and available for everyone. Making a feature and saying to someone or a bunch of people "no you can't use it because you do not live there or there and/or does not own such kind of peripheral" is just too easy.

Sadly, that's practically impossible. There are target groups for every feature. Mobile phones and tablets won't get this feature no matter what. Using a mobile device is their choice and so is using a specific keyboard. Non-QWERTY keyboards are very rare and the users who choose them are probably not using them for gaming anyway. And if they are, as @sgricci said, they can still use the arrows and the mouse. Don't forget that this feature is completely optional. Plus this is an open-source project, go ahead and fork it if you insist.

I like this pull request as it is. Anyway, this isn't really worth debating.

I wish I could resist:
not so funny image

@sgricci
Copy link
Author

sgricci commented Mar 29, 2012

All I can say is I literally laughed out loud. I think that's the first
time someone has commented on a pull request I made with a meme.

Well done sir!
On Mar 29, 2012 8:51 AM, "Christos Porios" <
reply@reply.github.com>
wrote:

@damajor:

Complicated UI, yes that is what we are debating here

Configurability and simplicity do depend on each other.

I just think that when a feature is implemented it has to be done the
right way and in a way to be portable and available for everyone. Making a
feature and saying to someone or a bunch of people "no you can't use it
because you do not live there or there and/or does not own such kind of
peripheral" is just too easy.

Sadly, that's practically impossible. There are target groups for every
feature. Mobile phones and tablets won't get this feature no matter what.
Using a mobile device is their choice and so is using a specific keyboard.
Non-QWERTY keyboards are very rare and the users who choose them are
probably not using them for gaming anyway. And if they are, as @sgricci
said, they can still use the arrows and the mouse. Don't forget that this
feature is completely optional. Plus this is an open-source project, go
ahead and fork it if you insist.

I like this pull request as it is. Anyway, this isn't really worth
debating.

I wish I could resist:
not so funny image


Reply to this email directly or view it on GitHub:
#24 (comment)

@sgricci
Copy link
Author

sgricci commented Mar 29, 2012

Also, @xav would it help if I added numpad support?
On Mar 29, 2012 8:57 AM, "Stephen Gricci" steve@gricci.org wrote:

All I can say is I literally laughed out loud. I think that's the first
time someone has commented on a pull request I made with a meme.

Well done sir!
On Mar 29, 2012 8:51 AM, "Christos Porios" <
reply@reply.github.com>
wrote:

@damajor:

Complicated UI, yes that is what we are debating here

Configurability and simplicity do depend on each other.

I just think that when a feature is implemented it has to be done the
right way and in a way to be portable and available for everyone. Making a
feature and saying to someone or a bunch of people "no you can't use it
because you do not live there or there and/or does not own such kind of
peripheral" is just too easy.

Sadly, that's practically impossible. There are target groups for every
feature. Mobile phones and tablets won't get this feature no matter what.
Using a mobile device is their choice and so is using a specific keyboard.
Non-QWERTY keyboards are very rare and the users who choose them are
probably not using them for gaming anyway. And if they are, as @sgricci
said, they can still use the arrows and the mouse. Don't forget that this
feature is completely optional. Plus this is an open-source project, go
ahead and fork it if you insist.

I like this pull request as it is. Anyway, this isn't really worth
debating.

I wish I could resist:
not so funny image


Reply to this email directly or view it on GitHub:
#24 (comment)

@damajor
Copy link

damajor commented Mar 29, 2012

@sgricci : I already proposed some kind of workaround, you are of course free to decide which one (or none) to implement. Well anyway I wont participate to this issue anymore due to the exceptional level of unnecessary and not constructive remarks contained... BTW Good luck.

@tech-no-crat : I am really sad to say that but you seem to be a so short minded guy...

@LiamDawe
Copy link

As long as i can use WASD for movement i will be happy, keep up the good work!

@jedahan
Copy link

jedahan commented Apr 4, 2012

Incremental improvements. +1 for qwerty support, thanks for the patch!

@sbstjn
Copy link

sbstjn commented Apr 10, 2012

thanks @sgricci, #78 is built upon your code…

@justinclift
Copy link

@sgricci Just committed your pull request to the repo here.

Trying to get all of the useful looking commits together in one spot, to make future development easier. :)

@nickdesaulniers
Copy link
Collaborator

Thanks for taking a look at the source code for BrowserQuest! BrowserQuest was developed by Little Workshop on behalf of Mozilla to showcase how the Web is the ultimate cross platform for games.

Mozilla does not currently have the resources to maintain BrowserQuest, but you should check out some of these amazing community forks instead! Feel free to add your fork to the wiki.

English

Korean

Android

Windows Phone

Erlang based

  • sedrik/bqs - Erlang implementation of the BrowserQuest server

C++ based

Related

  • HabitRPG - A habit building program which treats your life like a Role Playing Game
    • Uses the BrowserQuest character icons (CC-licensed) for some of their stuff, and is looking to contribute back the icons they've developed since

No longer actively developed

French

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet