Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fly command #40

Open
SmilerRyan opened this issue Sep 11, 2018 · 3 comments
Open

Fly command #40

SmilerRyan opened this issue Sep 11, 2018 · 3 comments

Comments

@SmilerRyan
Copy link

SmilerRyan commented Sep 11, 2018

Currently to reach places high up, you must build, jump and delete blocks after to get to a location.
How would I add a /fly command, which simply disables falling when users press (or hold) a key (ex. f)?

@cymno
Copy link

cymno commented Sep 15, 2018

Like this: a5e1d17
Btw, the movement code in ./js/player.js is very nice to play around with and modify. You could easily e.g. add a sprint option by finding out how to detect a "shift" press in javascript and then increase the speed here accordingly.

Here are the steps I took to actually run the project (a bit hidden imo):

$git clone this-repo
$npm install socket.io express
$node server

Then visit http://localhost:3000/multiplayer.html or http://localhost:3000/singleplayer.html in a browser (or replace localhost by your ip-adress)

@SmilerRyan
Copy link
Author

SmilerRyan commented Sep 16, 2018

Thanks, however this has only partially solved my solution as I cannot move any other direction except for up/down while holding the key to fly.

@cymno
Copy link

cymno commented Sep 16, 2018

Yes, for that it is necessary to enable in-air movement. This also makes the jump more responsive, as it is possible to adjust the direction after the jump has already started. If you'd really like to keep the old system it's also possible to enable in-air movement only when "f" is pressed.

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

No branches or pull requests

2 participants