What is it?
JSnD is a game engine completely written in JavaScript. It is a simple RPG engine based on the d20. The characters and special abilities have been simplified to work on the engine and some special abilities are used by multiple classes. It is designed to work with a Google Sheet which can be used to help populate levels and characters/monsters. Levels can be created with little to no programming experience and yet advanced programming can be used to create code such as your own AI for the monsters. Characters/monsters can be created in any pixel editor sized 30x30. This site does a great job. The game layout is all simple HTML that just requires a few "divs" with the proper "ids", the JavaScript does the rest. Dont' want a legend, don't add the code for it. Users can style the layout with CSS later if desired.
Going Forward
The next steps for this idea are to add multiplayer (local computer only), better multilevel set up, and possibly even multiplayer across the internet. Eventually, I would like to add characters up to level 20 and NPC interaction. In addition, I would like to have prefabricated layouts for the game board items.
How To's
Getting Started
First of all, check out the videos under the video tab above. Second, what version do you want to use? Make sure you are following the directions to whatever version you are using, once a version is uploaded, it is never changed. That will allow you to keep creating for that version without having to worry about it being broken. You will find a link to old versions at the bottom of this page. Third, decide where you want to start. Do you want to create a world, or multi-level campaign? Next, grab all the files that you need to run the program. Just store the game.js file in the same location as your html file as well as the "pics" folder (with all the pictures of course). Then add all the base html code and link the game.js file. Follow the rest of the directions to add the actual game code.
Creating a map
You need to go to the Google Sheet map creator. Once there, familiarize yourself with the key/legend. You will need to decide on the size of your map, enter the dimensions onto the sheet. Then use the border style to add a boarder around the size of your map (not required but does help with sanity). Then add features to the map using the legend. You can use k1, d1, and h1 to link a key to a door and then have hidden squares inside a room. It should be noted, that there is no error checking, if you add hidden squares that you don't have boxed in, the player can still get there, they just won't see anything. But hey that is the beauty of this, maybe you want a zone of blindness... Once the level is setup, run the code to process it. Copy and paste that code into the script tag under where you linked the gameJS file. You will see that the whole of the code is on one line. Just add a line break after each semi-colon. Current version can be found here.
Adding Code
As stated above, get the map code from the Google Sheet map creator and format it correctly.
You, in theory, could try to create the map code from scratch, but even I don't do that.
Add main character - get code from Character Maker
Add all characters to game - gameJS.characters = [firestoker3,goblin2,goblin1,demon1,roger];//example
Add the start game code - gameJS.startGame(gameJS.characters);
Optional code: WASD keys, Add hidden potions are keys, Add exit, Set End State.
Some optional code is less option depending on other changes you make (i.e. you send End State to exit but don't add an exit).
Playing with HTML
Make sure to add the bare minimun html with the proper "ids".
"divs" need to be added with the following "ids" - gameBoard, gamePad, characters, msgBox, stats
You can also add senario and fill it with the senario for the level and legend to show the legend.
Finally, add any CSS you want to arrange the items.
Understanding Two Player
Two player in V2 is very limited. Right now, you can only win on the exit setting and both the characters have to live. Otherwise, as long as you take turns on the computer (or just run it yourself) it should work fine.
Creating AI
Currently, to create your own AI, you will need to understand the way the code works. I hope to streamline the code in the future to make this easier. But if you understand it, just make sure after creating the function to add the function to the checkAI function in the gameJS object. Then, you can give a monster its AI.
Try out JSnD
Version 2
This is the first major release. It has three class up to level 5. There is the ability to add potions and multiple different keys and doors (allowing for much larger dungeons). Many bugs have been fixed and new AI's have been added.
Version 2 Example LevelMini Campaign - Demo
Early Days
Try out one of the earliest (mostly) functioning levels. The special lets you heal above your max health, you can only use one key, the enemies only attack if they accidently run into you, and the diagonal arrow keys don't work. But you can get to get the hidden exit.
Example Level