Git Product home page Git Product logo

coolwanglu / browserhack Goto Github PK

View Code? Open in Web Editor NEW
309.0 309.0 48.0 40.05 MB

NetHack on the Web!

Home Page: http://www.kongregate.com/games/coolwanglu/browserhack

C 92.20% C++ 3.44% OpenEdge ABL 0.07% GAP 0.01% Max 0.02% Shell 0.05% Awk 0.07% Makefile 0.45% JavaScript 0.76% Python 0.01% CSS 0.13% HTML 0.11% Batchfile 0.15% DIGITAL Command Language 0.37% Lex 0.16% Yacc 0.75% Assembly 0.51% R 0.10% Objective-C 0.66%

browserhack's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

browserhack's Issues

shift-click also moves

Shift-clicking on tile also moves my current character. I just looked into both mouse_event_handler (line 747) and the shift-click event listener (line 782, both win/web/nethack_lib.js) but judging from the early return statements, I couldnt find the root cause..

Again, this is on Firefox

How can you kick?

Control-d is supposed to be kick, but in a browser, that bookmarks. There's no #kick extended command either. Thus kicking a sink, or a locked door, or a chest, or a monster, or even the wall if you're so inclined -- all these are impossible?

Overlay menus with item listings do not show item ID nor respond to keys

E.g., press W to wear something, then press ? to see the list of things that can be worn. This overlay list does not show the item ID (A-Z, a-z). Furthermore, pressing a-z or whatever does nothing if the overlay is shown.

A correct fix would be to show the item IDs and allow pressing a key to indicate which item(s) you want.

Locks up sometimes with drop item menu.

Seems like maybe the UI get's into a state that is out of sync with the game state, and locks up.

I'm not sure how to reproduce, but it's some sequence involving dropping or perhaps otherwise selecting items. Perhaps a consequence of selecting nothing.

Unsupported input method for `#` symbol

With my current keyboard layout (Swiss French), to input a # symbol for extend commands, the combination is AltGr + 3, which does not work with the current build

Also on a side note, support of the subkeyvalue option would be greatly appreciated, for the following swap of the Z and Y keys (my QWERTZ keyboard makes it hard to use HJKL YU NM for movement):

OPTIONS=subkeyvalue:121/122
OPTIONS=subkeyvalue:122/121

Suggestion: package as open web app

First of all, this is a really well done port. Thanks you for doing this.

I want to suggest packaging this as an open web app. This would enable BrowserHack to run in Android (as a Cordova/Phonegap app) and Firefox OS.

To work in these runtimes, BrowserHack would need to show a softkeyboard or focus a hidden element to use the system's softkeyboard.

I'd be happy to work on this, if you can guide on which files to touch :-)

On reload inventory is full of "strange object"

Upon restoring my game (after ending the session with S save), my inventory seems to be in a strange state. None of the objects have retained their names in the inventory hover text on the right. Several objects are now strange object, but other bizarre names appear as well ((null), or merely the empty string.)

The state of what is currently worn and/or equipped appears corrupted as well. A cloak of invisibility appears unequipped, though it was on save and still seemingly renders me invisible on load. A scroll appears to be confused with my throwing daggers, sharing their name and a place in my quiver.

Some screen shots:
screen-shot

boots-of-hmm

quivered-scroll-of-hmm

null-spellbook

blank-potion

Some other observations:

  • The inventory icons themselves are still correct
  • The assigned keyboard (#adjust) letters are still correct
  • The placement of the items in the different sections of the inventory is still correct.
  • This isn't the first time I've saved and loaded this character, but it is the first time I've seen the odd behavior.

I can try to conjure up the IndexedDB if you think that'll help, but there doesn't appear to be an easy export option.

Chrome 43.0.2357.124 (64-bit) on OSX 10.10

Problem compiling on Linux

Good morning! I'm running into an issue when attempting to compile BrowserHack from source on Linux, specifically Fedora 24.

I've installed the latest emscripten release from the sdk tgz available on the emscripten website.

After cloning this project, I had to edit the EMCC variable in build.sh to point to my emscripten installation. After that, attempting to run ./build.sh results in:

$ ./build.sh 
Copying Makefiles.
( cd src ; make )
make[1]: Entering directory '/home/mmorsi/workspace/tmp/BrowserHack/src'
touch ../src/config.h-t
/home/mmorsi/workspace/tmp/emsdk-portable/emscripten/1.37.9/emcc -O3 -I../include -c monst.c
/home/mmorsi/workspace/tmp/emsdk-portable/emscripten/1.37.9/emcc -O3 -I../include -c objects.c
/home/mmorsi/workspace/tmp/emsdk-portable/emscripten/1.37.9/emcc -O3 -I../include   -c -o alloc.o alloc.c
make[2]: Entering directory '/home/mmorsi/workspace/tmp/BrowserHack/util'
/home/mmorsi/workspace/tmp/emsdk-portable/emscripten/1.37.9/emcc -O3 -I../include   -c -o makedefs.o makedefs.c
makedefs.c:361:14: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
        Fprintf(ofp,Dont_Edit_Data);
                    ^~~~~~~~~~~~~~
makedefs.c:361:14: note: treat the string as an argument to avoid this
        Fprintf(ofp,Dont_Edit_Data);
                    ^
                    "%s", 
makedefs.c:560:14: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
        Fprintf(ofp,Dont_Edit_Code);
                    ^~~~~~~~~~~~~~
makedefs.c:560:14: note: treat the string as an argument to avoid this
        Fprintf(ofp,Dont_Edit_Code);
                    ^
                    "%s", 
makedefs.c:1235:14: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
        Fprintf(ofp,Dont_Edit_Data);
                    ^~~~~~~~~~~~~~
makedefs.c:1235:14: note: treat the string as an argument to avoid this
        Fprintf(ofp,Dont_Edit_Data);
                    ^
                    "%s", 
makedefs.c:1357:17: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
    Fprintf(ofp,Dont_Edit_Code);
                ^~~~~~~~~~~~~~
makedefs.c:1357:17: note: treat the string as an argument to avoid this
    Fprintf(ofp,Dont_Edit_Code);
                ^
                "%s", 
makedefs.c:1398:14: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
        Fprintf(ofp,Dont_Edit_Code);
                    ^~~~~~~~~~~~~~
makedefs.c:1398:14: note: treat the string as an argument to avoid this
        Fprintf(ofp,Dont_Edit_Code);
                    ^
                    "%s", 
/home/mmorsi/workspace/tmp/emsdk-portable/emscripten/1.37.9/emcc -O3 -I../include   -c -o dlb.o dlb.c
makedefs.c:1714:14: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
        Fprintf(ofp,Dont_Edit_Code);
                    ^~~~~~~~~~~~~~
makedefs.c:1714:14: note: treat the string as an argument to avoid this
        Fprintf(ofp,Dont_Edit_Code);
                    ^
                    "%s", 
makedefs.c:1869:17: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
    Fprintf(ofp,Dont_Edit_Code);
                ^~~~~~~~~~~~~~
makedefs.c:1869:17: note: treat the string as an argument to avoid this
    Fprintf(ofp,Dont_Edit_Code);
                ^
                "%s", 
makedefs.c:1894:17: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
    Fprintf(ofp,Dont_Edit_Code);
                ^~~~~~~~~~~~~~
makedefs.c:1894:17: note: treat the string as an argument to avoid this
    Fprintf(ofp,Dont_Edit_Code);
                ^
                "%s", 
8 warnings generated.
/home/mmorsi/workspace/tmp/emsdk-portable/emscripten/1.37.9/emcc -O3 -I../include -c ../sys/unix/unixres.c
/home/mmorsi/workspace/tmp/emsdk-portable/emscripten/1.37.9/emcc   makedefs.o   -o makedefs
make[2]: Leaving directory '/home/mmorsi/workspace/tmp/BrowserHack/util'
make[2]: Entering directory '/home/mmorsi/workspace/tmp/BrowserHack/util'
make[2]: Entering directory '/home/mmorsi/workspace/tmp/BrowserHack/util'
/home/mmorsi/workspace/tmp/emsdk-portable/emscripten/1.37.9/emcc  --pre-js ../win/web/mount_nodefs.js  -o makedefs.js makedefs.o ../src/monst.o ../src/objects.o
/home/mmorsi/workspace/tmp/emsdk-portable/emscripten/1.37.9/emcc  --pre-js ../win/web/mount_nodefs.js  -o makedefs.js makedefs.o ../src/monst.o ../src/objects.o
make[2]: Entering directory '/home/mmorsi/workspace/tmp/BrowserHack/util'
make[2]: Entering directory '/home/mmorsi/workspace/tmp/BrowserHack/util'
/home/mmorsi/workspace/tmp/emsdk-portable/emscripten/1.37.9/emcc  --pre-js ../win/web/mount_nodefs.js  -o makedefs.js makedefs.o ../src/monst.o ../src/objects.o
/home/mmorsi/workspace/tmp/emsdk-portable/emscripten/1.37.9/emcc  --pre-js ../win/web/mount_nodefs.js  -o makedefs.js makedefs.o ../src/monst.o ../src/objects.o
js ./makedefs.js -o
js ./makedefs.js -p
js ./makedefs.js -z
js ./makedefs.js -m
./makedefs.js:9: ReferenceError: require is not defined
Makefile:198: recipe for target '../include/onames.h' failed
make[2]: *** [../include/onames.h] Error 3
make[2]: Leaving directory '/home/mmorsi/workspace/tmp/BrowserHack/util'
Makefile:488: recipe for target '../include/onames.h' failed
make[1]: *** [../include/onames.h] Error 2
make[1]: *** Waiting for unfinished jobs....
./makedefs.js:9: ReferenceError: require is not defined
Makefile:200: recipe for target '../include/pm.h' failed
make[2]: *** [../include/pm.h] Error 3
make[2]: Leaving directory '/home/mmorsi/workspace/tmp/BrowserHack/util'
Makefile:490: recipe for target '../include/pm.h' failed
make[1]: *** [../include/pm.h] Error 2
./makedefs.js:9: ReferenceError: require is not defined
./makedefs.js:9: ReferenceError: require is not defined
Makefile:202: recipe for target '../src/monstr.c' failed
make[2]: *** [../src/monstr.c] Error 3
make[2]: Leaving directory '/home/mmorsi/workspace/tmp/BrowserHack/util'
Makefile:492: recipe for target 'monstr.c' failed
make[1]: *** [monstr.c] Error 2
Makefile:204: recipe for target '../include/vis_tab.h' failed
make[2]: *** [../include/vis_tab.h] Error 3
make[2]: Leaving directory '/home/mmorsi/workspace/tmp/BrowserHack/util'
Makefile:494: recipe for target '../include/vis_tab.h' failed
make[1]: *** [../include/vis_tab.h] Error 2
make[1]: Leaving directory '/home/mmorsi/workspace/tmp/BrowserHack/src'
Makefile:92: recipe for target 'nethack' failed
make: *** [nethack] Error 2

Suggestion: pan with mouse drag

In case the player might need to take a look at the whole map or to check something far away. This version of game does not seem to support panning so things might become hard if the player cannot find the downstairs or when he just want to check the monsters in the level with telepathy.

show border of dungeon map

Since the user interface does not show the full dungeon map, you can not find out whether the current room you are in is on the far-right, the center or the far-left of the dungeon. If the map was zoomed out, you would see which areas (and which walls of the current rooms) are more likely to contain a hidden door.

The android port tacked this by showing the whole dungeon background in black and surrounding the non-dungeon part (e.g. when scrolled all to the right) in grey. This allowed you to see more correctly where you are in the dungon.

I noticed that browserhack currently only creates <div> elements for the actual tiles that are being rendered. I am not sure how to address this without showing all currently unknown blocks as black tiles. I tried fiddling with background colors in CSS, but did not make any substantial progress.

Note Emscripten version in README

Thanks for building this project! How is doing on Kongregate?

What version of Emscripten was this project compiled with? I've tried emcc 1.30.0, which results in a build that doesn't work (I cannot get past the opening dialogs), and emcc 1.34.1, which results in a binary that works perfectly, but is much slower than the build you have up on github.io.

1.34.1 wasn't even out when the last release was made on github.io, so do you happen to have a record of the version you used to make that build?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.