besnik/text-adventure-game-js-engine

package.json/ webpack.config.js

coreyar opened this issue · 3 comments

Hi, I found this repo and was interested in checking it out/ contributing. Do you have a package.json or webpack.config.js?

Did some investigating and it seems that the dependencies have been included in the repo. This ticket may be more about interest in pulling those out and using npm or yarn to manage dependencies and adding webpack for the build process.

I tried to start the game at engine/engine2 but have not had much luck so far.

Hi Corey, thanks for interest! The repo is in pretty chaotic state atm - I need to find some time and do some clean up. The idea is to create solid game engine (and editor) using plain javascript and keep things as simple as possible. I did several PoC work for various concepts and the code is spread across the repo. Situation regarding browsers and support for javascript, html5, css was greatly improved in last decade and I decided to build clean core model without heavy libraries. Next I wanted to build various UI using modern frameworks or perhaps html5, css3 and new js features. I also wanted to aim UI to mobile world since this type of game would probably have most success on mobile.

So there are three main areas where any help is welcomed:

  1. Core model of game engine and editor (+- plain javascript)
  2. Game UI (responsive design, html5, css3 or other technologies)
  3. Editor UI (the same as #2)

Current version of model for game engine and editor you can find in engine.js. At the core sits game engine class that holds all components like location class or player class. The game engine relies a lot on publish-subscribe design pattern.

You could instantiate game engine class manually and populate it with data but it is much easier to do it with help of editor class (in future also using Editor UI). You can see it in action in sample html playground. There is no UI except few text elements that displays your current location and where you can go. Most of the 'play' you can do in development console of your favorite browser. Just hit F12 and open console. Game engine is instantiated in game global variable. You can use commands in console like game.see() inspect current location or game.go('l1') to change location. You can play with API using console. As you can see the structure of code is pretty flat (inspired by KISS rule and borrowed few ideas from python world). Later it will be necessary to structure it better but for now it is easier to work and do refactoring using simple structures.

Regarding UI I did not have much time to implement that part. The same goes for Editor UI. I would like to implement in responsive way. I did some work here and here but it is pretty basic and need much more work.

I hope this explains some design ideas and structure of the repo.

There is plenty of work on model and UI part. If you have any ideas about new features or improvements (like packages you mentioned) or want to help please let me know.

Awesome. Thank you for writing back. I didn't think to try and use the app in the console. Let me dig in some more when I have a second and I'll see how I can contribute.