A Dark Room goes open source

Alright, fine!

I thought leaving the code unobfuscated would be enough for you people, but no, you had to have it on GitHub. Well, here it is, distributed under the MPL. Go nuts, kids.

41 thoughts on “A Dark Room goes open source

  1. Duy Quang

    So, I’d like to help you translate the game to Vietnamese.
    Email me if you interested.
    I’m just a Vietnamese pupil, trying to improve my English skill 😉

    Reply
    1. Michael Post author

      There’s work going on right now to adapt the code to be easily translated. Once that’s done, I’d love your help in creating a Vietnamese version!

      Reply
  2. leo_rockway

    Great game, thank you for releasing it with a free software license. Please, contact me once internationalization code is up so I can help translate the game to Spanish.

    Reply
  3. Xianglin

    Hi Michael, I also would like to help you to translate it in Chinese. I read your code. Those text are hard-coded in JS files. Are you trying to separate them? If needed I can do some job for you.

    Reply
    1. Michael Post author

      The open-source community is currently working on separating the text from the code so that localization can occur. I’ll keep you updated!

      Reply
  4. Pinaz9

    A stranger arives in the night.

    He says that he is a story artist, and an idea man. He also says that he will work for free.

    The builder says that she doesn’t know about him.

    Reply
    1. Michael Post author

      builder points him in the direction of GitHub, just on the edge of the village.
      says people are working on making things better.
      says he should help.

      Reply
      1. Pinaz9

        How do I GitHub?

        I can’t figure out how to leaf a comment without modifying the code.

        I can’t code worth crap, just so you know.

        Reply
  5. Bill Dugan

    Request: Move the “continue”, “leave”, and “run” buttons downward so they don’t take the place of the attack buttons, such that I don’t accidentally click on them during the action sequences. Or add a 3 second “grayed out” time after they are drawn but before you can click on them. At least 20 times playing this game, I have continued to rapidly cycle through stab, swing, shoot, slash, and of course eat meat, only to accidentally click “run” when the button is drawn under one of my attack buttons. I have run away from the sulfur mine 4 times in a row after my victories, and the guards do not think much of me anymore.

    Since I cannot stop playing this game, your attention to this UI suggestion is appreciated!

    Reply
  6. k90

    It is good idea to divide fight run eat buttons or pot then on fixed place to avoid pushing accidentally.

    Reply
  7. Tom Huang

    Hi,

    Thanks a lot for posting the game code and for making the game itself! Great stuff!

    Quick question, I’ve noticed the Cmd + L doesn’t focus the cursor and highlight the entire URL, is this intended? would you please help point out which part of the code might be doing that?

    Thank you again for all your great work and help!

    Best regards,

    Tom

    Reply
    1. Michael Post author

      There’s a key handler attached to the document that discards all keystrokes that aren’t used by the current active screen. I think it’s in main.js. The main concern was the arrow keys causing the page to scroll on smaller screens. It shouldn’t be hard to modify it to only discard unused arrow key presses and allow the browser to handle everything else.

      Reply
      1. Tom Huang

        ah, sweet, gotcha, i think there’s some code in engine.js that i might move to “travelTo” and checking of the activeModule has keyUp/keyDown handlers.

        thank you very much for your quick reply!

        sorry but just another quick question, when you said:
        “Here is what he should be doing:
        All updating values (store numbers, incomes, etc…) should be objects that can register listeners to value-change events. These events should be fired whenever a value (or group of values, I suppose) is updated. That would be so elegant and awesome.”

        do you mean things like store/income having their own classes, called by things like room/outside, instead of engine?

        thanks again!

        Reply
        1. Michael Post author

          More or less, yeah. I think someone from the open source community is already tackling that, though!

          Reply
  8. Dan

    I seriously hope the best for you. This was a great, out of nowhere hit. My hope is that this turns into something like minecraft where the basic simplicity of the game is maintained, but the story and options can still develop over time such that we keep wanted to come back and see what’s new, but always needing to start in a dark room.

    Reply
  9. Johnny

    Could you allow the option to keep punching when you don’t have any other melee weapons? On two occasions I almost died because I picked up some grenades and was forced to fight with nothing else even though i was a kung fu master.

    Reply
  10. Clay

    A change request, if anyone feels up to it–
    Currently, traps and buildings are built from the Firelit Room tab, but displayed on the Village tab, while production is set from the Village tab, but displayed on the Firelit Room tab. The UI would be much more sensible if the “stores” and “village” boxes traded places.

    Reply
  11. Louise

    I’d love to translate it into danish if you’d like 🙂 seeing as some others wants to translate into other languages.

    Reply
  12. Chris

    Hey, I have been browsing the code and was wondering where is the initial starting point when the page is loaded for the javascript to start calling other functions and run?

    Reply
    1. Michael Post author

      The init() function in engine.js! It gets added to the onReady event on lines 606-608. The $(function() {} ); notation is jQuery shorthand.

      Reply
  13. Pingback: A Dark Room | Szczeżuja log

Leave a Reply

Your email address will not be published. Required fields are marked *