ThePix / QuestJS

A major re-write of Quest that is written in JavaScript and will run in the browser.
MIT License
66 stars 13 forks source link

It's alive... IT'S ALIVE! #8

Closed KilianKilmister closed 4 years ago

KilianKilmister commented 4 years ago

The first Step is done. It's now fully modulised with minimal changes do the actual code.

it is not fully pluggable yet, tho. I ran into some issues getting the HTML file to do what i want (making it a proper bundle allowes it to run asynchronously, and HTML doesn't like to be written like that) so for right now i had to add some extra script to create the UI, but that wil be fixed in due time. As of right now it can't load seperatly bundled games out of the box. Game-eg is prebundled and seems to work wihtout issue, tho.i'll work on making games fully pluggable ASAP.

I did some rearranging of the file structure, as it was getting a little crowded in the workspace root and since the main files now need transpiling, they should not be in lib anymore.
It basically boils down to these changes:

The dist/ folder contains two files that were generated by the bundler (.js and .js.map). They should not be edited. Instead, edit the files in src/ and rebundle

I also created an NPM-Package. It's main function currently is just to store the dev-tools i used. They can now be easily installed by opening a terminal in the workspace folder and using npm install. It does not have any external runtime dependancies. The tools i used are:

Additionally I have reformatted the README.md and docs.md. I corrected syntax errors, added and removed some spacing to make it easier to read as plaintext and added a Table of Content to the docs.md file.

finally, i added a folder named .vscode/ holding a debug task that can be attached to a chrome instance. This way the program can be debbugged more easily as everything will automatically link up. It also contains some reccomended extentions and some configs. Feel free to take a look it if you want.

I added comments to most of the new files that explain more or provide a link to an external source.

ThePix commented 4 years ago

I had a quick look. Reorganising the files is fair enough if required; you need to update a few to find them. There is then an issue that web pages do not like import/export. I will leave that one with you.

I am afraid I have made some changes - prompted in part by your comments. I hope they wil not upset what you have done too much. I had not realised you were doing stuff so soon, so sorry about that. I will try not to do anything for a while!

If you go into the project and open page-eg.html you will find the example game. Type "test" and it will run through some tests. That is the big test of what you are doing; getting that to run in a web page.

KilianKilmister commented 4 years ago

I had a quick look. Reorganising the files is fair enough if required; you need to update a few to find them. There is then an issue that web pages do not like import/export. I will leave that one with you.

Allready taken care of. that's what the bundler is for. It takes all the sourcecode and produces a single script file that can be used by any webpage. Its included in this PR. The resulting bundle is generated into the dist/ folder

I am afraid I have made some changes - prompted in part by your comments. I hope they wil not upset what you have done too much. I had not realised you were doing stuff so soon, so sorry about that. I will try not to do anything for a while!

no worries. i'll fix what needs changing. should not take long. should be done by tomorrow.

If you go into the project and open page-eg.html you will find the example game. Type "test" and it will run through some tests. That is the big test of what you are doing; getting that to run in a web page.

So that's how the test is started. couldn't figure it out for the life of me. only did some basic playtesting.

KilianKilmister commented 4 years ago

Just looked at the changes. shouldn't take very long at all. to avoid things like that i'd suggest we start working with individual staging branches. this way a pull request has to be filed and and then they can be resolved in order. this particular commit would probably have resolved automatically anyways, if it werent for the changes to the filestructure

ThePix commented 4 years ago

I will stop doing anything on this for the time being, so I do not make extra work for you!

KilianKilmister commented 4 years ago

this should now be all ready