-
Notifications
You must be signed in to change notification settings - Fork 128
/
source_code.html
63 lines (60 loc) · 3.38 KB
/
source_code.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!DOCTYPE HTML>
<html>
<head>
<title>Candy Box 2 - source code</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<style type="text/css">
body{
font-family: monospace;
font-size: 15px;
}
p{
text-indent: 2em;
}
</style>
</head>
<body>
<h2>License</h2>
<p>
Candy Box 2 source code is released under the free software GPLv3 license (free as in "freedom"). This means that you are free to:
<br/>
<ul>
<li>Use the software for any purpose</li>
<li>Change the software to suit your needs</li>
<li>Share the software with anyone</li>
<li>Share the changes you make</li>
</ul>
</p>
<p>
You can get more information about this license <a href="https://www.gnu.org/copyleft/gpl.html">here</a>.
</p>
<h2>Where do I get the source code?</h2>
<p>
Candy Box 2 is written in <a href="https://en.wikipedia.org/wiki/TypeScript">TypeScript</a>, a language which compiles to javascript using tsc, the TypeScript compiler.
This language is published under the Apache License, which is GPL compatible.
</p>
<p>
Therefore, there are three ways to get the source code :
<br/>
<ul>
<li>The <a href="candybox2.js">compressed, javascript version</a> used when you play the game. Caution : since it is compressed, it is hardly readable.</li>
<li>The <a href="candybox2_uncompressed.js">uncompressed javascript version</a> (this is the file generated by the TypeScript compiler).</li>
<li>The TypeScript files. This is the best solution if you want to work on the code. See below to know how to download them.</li>
</ul>
</p>
<h2>How do I work on the code?</h2>
<p>
The first thing to do is to download the <a href="https://github.com/candybox2/candybox2.github.io/releases">.zip file</a> containing everything you need : the game itself, the TypeScript files, the ascii art, the compilation scripts, and even this page!
</p>
<p>
Then, there are three steps :<br/>
<ul>
<li>Install all the external software you will need to compile the game. Install <a href="http://nodejs.org/">node.js</a>, the <a href="install_tsc.html">typescript compiler</a>, <a href="http://yui.github.io/yuicompressor/">yuicompressor</a> and <a href="http://python.org/download/releases/3.0/">Python 3</a>. Note that Candy Box 2 compilation script is using yuicompressor with the command "yuicompressor". Depending on how you installed it, you may need to use "yui-compressor" or another command. Don't hesitate to change the compilation script to comply with that.</li>
<br/>
<li>Try to run the compilation script included in the .zip file you downloaded earlier. Use compile.sh on GNU/Linux systems and compile.bat on Windows systems. If you encounter any problem, the fastest way to get an answer is to ask on <a href="http://webchat.quakenet.org/?channels=candybox2&uio=d4">Candy Box 2 IRC channel</a>.</li>
<br/>
<li>If no error show up during the compilation process, it means it worked! You can now begin to work on the code by modyfing the TypeScript files in the code/main directory. You can play with the code, make your own ASCII art game, or maybe <a href="create_quest.html">create a quest for Candy Box 2</a>?</li>
</ul>
</p>
</body>
</html>