Before starting to create a quest for Candy Box 2, make sure you got the code to work by following instructions on this page.

What does TypeScript code look like?

TypeScript is a "strict superset" of javascript. This means that in a TypeScript file (.ts), you can write pure javascript code if you want. But you can also use TypeScript syntax! Here are the most important things :

What does the compiling script ( or compile.bat) do?

The compiling script takes all the code located in the code directory, all the ascii art in the ascii directory and all the text in the text directory, and gather all that in a single candybox2.js file. This candybox2.js file is used by the index.html file : this is why opening the index.html file launches the game.

So, how do I create a quest?

There are two special directories to handle quests made for the Arena : code/arena/ for the TypeScript files (.ts) and ascii/arena for the ascii art.

Before creating your own quest, I advise you to try understanding and modifying the Peaceful Forest (one of the quests currently available in the Arena). It is rather simple, and working on it helps to understand how the game's code is organized.

The peaceful forest consists of two TypeScript files : code/arena/peacefulForest/peacefulForest_Quest.ts and code/arena/peacefulForest/peacefulForest_Tree.ts, and one ascii art (the logo displayed on the Arena page), ascii/arena/peacefulForest/logo.txt. So you just need to edit the TypeScript files, compile, and open the index.html file in your browser to test your changes!

Once you'll understand how the Peaceful Forest works, you can create your own quest by adding your own directory in the code/arena and the ascii/arena directories. Your quest should be hard and original! If you want it to be added to the game so that everyone can play it, send it to me by mail at If your quest is interesting and functional, it will be added to the Arena. If it is hard and original enough, it will be added to the highlighted quests on top of the page :)

Additional informations

I want to test my quest, but the game starts from the beginning so I can't access the Arena.

If you want to start the game with everything unlocked, the easiest way is to modify the code/main/Saving.ts file. Just uncomment the lines from 17 to 135, and you'll start a game with everything unlocked, all the items in the inventory, and a lot of potions :)

So, I made my quest, but I can't access it from the Arena?

You must give the name of your quest in the Arena by modifying the line 51 in the code/main/TheArena.ts file.

I've got a question or a problem

You can chat with me and other quest makers on the game's IRC channel here or the game's forum here.