-
Notifications
You must be signed in to change notification settings - Fork 170
/
index.html
298 lines (262 loc) · 16.8 KB
/
index.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Command and Conquer - Tiberian Dawn - HTML5</title>
<link rel="shortcut icon" href="http://www.adityaravishankar.com/favicon.ico" />
<link href="http://www.adityaravishankar.com/projects/games/command-and-conquer/" rel="canonical" />
<meta property='fb:app_id' content='268072089881146' />
<meta property='og:title' content='Command and Conquer - Tiberian Dawn - HTML5' />
<meta property='og:url' content='http://www.adityaravishankar.com/projects/games/command-and-conquer/' />
<meta property='og:image' content='http://www.adityaravishankar.com/projects/games/command-and-conquer/images/logo.jpg' />
<style type="text/css">
body {
background:black;
color:white;
text-align:center;
font-family: Arial, Helvetica, sans-serif;
font-size:14px;
}
canvas {
border:1px solid white;
cursor:url(images/cursors/blank.gif),none !important;
background-image: url(images/loading.gif),url(images/htitle.jpeg);
background-position: center bottom,center;
background-repeat: no-repeat,no-repeat;
}
#debugger {
border:1px solid white;
font-size:12px;
padding:5px;
overflow:auto;
height:400px;
}
#specialcontrols{
display:none;
}
@font-face {
font-family:'Command and Conquer';
src:url('images/sidebar/cnc.ttf');
}
div {
border:0px solid red;
}
#leftcontent {
float:left;
width:450px;
padding:10px;
text-align:left;
}
#rightcontent {
float:left;
width:640px;
padding:10px;
text-align:left;
}
#rightmostcontent {
text-align: left;
float:right;
margin:10px;
margin-top:0px;
vertical-align:middle;
display:none;
}
H1{
color:yellow;
text-align:left;
}
#header {
padding-bottom:20px;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<!--script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script-->
<script src="js/cnc-v0.3d.js" type="text/javascript" charset="utf-8">
</script>
</head>
<body>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['t1._setAccount', 'UA-9874019-1']);
_gaq.push(['t1._trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<div id="leftcontent">
<img style="float:left;"src="images/logo.jpg" width="400" height="146" alt="Command and Conquer">
<h1 >C&C - HTML5 v0.3d by <span style="font-size:small;color:white;"><a href="http://www.adityaravishankar.com">Aditya Ravi Shankar</a></span>
</h1>
<!--img src="images/cursors/blank.gif"-->
<p>This is a recreation of the original Command and Conquer, Real Time Strategy game entirely in HTML5 and Javascript. </p>
<p>This page works best on <a href="http://www.google.com/chrome" title="Google Chrome - Get a fast new browser. For PC, Mac, and Linux">Google Chrome</a> or <a href="http://www.mozilla.org/en-US/firefox/new/" title="Mozilla Firefox Web Browser — Free Download">Mozilla Firefox</a>. The images can take a little while to load so please be patient.</p>
<p style="color:green">This is still a work in progress. Any comments or feedback (including bugs), is appreciated. I intend to develop this game further - improving the AI, pathfinding (<a href="http://www.adityaravishankar.com/projects/games/pathfinding-javascript-rts-demo/" title="Command and Conquer - RTS Game Pathfinding - HTML5">See improved pathfinding demo here</a>), adding more units and levels. If you are interested in helping out with this effort (even by just testing the game and giving feedback), please let me know. </p>
<p><u>BUGS and ISSUES:</u><br>Please report bugs on the github issues page or in the comments section below. <a href="https://github.com/adityaravishankar/command-and-conquer/issues">https://github.com/adityaravishankar/command-and-conquer/issues</a></p>
<p style='color:blue'>If you liked this demo, please let me know by clicking on the Like button below and leaving me a comment. Please share this page with your friends so that they can see it too. </p>
<p>You can read more about <a href="http://www.adityaravishankar.com/2011/11/command-and-conquer-programming-an-rts-game-in-html5-and-javascript/" title="Command and Conquer - Programming an RTS game in HTML5 and Javascript |">the development of this game</a> on my blog. You can also check out some of the <a href="http://www.adityaravishankar.com/software-projects/games/" title="Games have written">other games I have written</a> or read some of my <a href="http://www.adityaravishankar.com/category/programming/game-programming/" title="Game Programming Articles">game programming articles</a>.</p>
My goal is to take this game as far as possible - Add more units, optimize the code, add better AI and multiplayer games. You would be able to come to this page, find a random partner and start playing!!<br> <br>
Several developers have volunteered to help with this effort. I am grateful to everyone who came forward to help.
<br><br> If you enjoyed playing this game and would like to support the continued development of the game with donations/contributions, please use the donate button below. Every little bit would help.<br>
<br>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHiAYJKoZIhvcNAQcEoIIHeTCCB3UCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV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EJBDEWBBQ4y/2zRvqG920d6RzjRJBQOff/gjANBgkqhkiG9w0BAQEFAASBgGD/DOJHt0IJ+iCdPR44tDdW71K60qeVzC2d6ss8BjWgf9pR0RI4b/yXCe5O6WyIiDA//jHuznwTZPtchnZZDeA5MsXsIfDF5Pfo8PalSVZIeCeFKm/L7z3nK55Ownp2UinSvP6sC4hSLsaWc0zU0EyQxteSXtxla7d+ahSBRLkg-----END PKCS7-----
">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
<br>
NOTE: Donations help me pay for hosting (which I currently pay for out of my own pocket). While welcome and appreciated, donations are not necessary to play this game. <br><br>This game will always be free for everyone to enjoy.
<br><br>
<div id="socialbadges" style="margin-bottom:10px;text-align:right;">
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;js.async=true;
js.src = "http://connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-like" data-href="www.adityaravishankar.com/projects/games/command-and-conquer/" data-send="true" data-width="440" data-show-faces="true" data-font="arial"></div>
<br>
<div class="fb-like" data-send="false" data-href="www.adityaravishankar.com/projects/games/command-and-conquer/" data-layout="box_count" data-show-faces="false"></div>
<!-- Place this tag in your head or just before your close body tag -->
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<!-- Place this tag where you want the +1 button to render -->
<div class="g-plusone" data-size="tall" data-href="http://www.adityaravishankar.com/projects/games/command-and-conquer/"></div>
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.adityaravishankar.com/projects/games/command-and-conquer/" data-via="adityarshankar" data-count="vertical">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
<div class="fb-comments" data-href="www.adityaravishankar.com/projects/games/command-and-conquer/" data-num-posts="5" data-colorscheme="dark" data-width="450"></div>
</div>
<div id="rightcontent">
<canvas id="canvas" width="640" height="535">
Your browser does not support the HTML5 Canvas feature. This game uses new HTML5 features and will only work on the latest versions of Firefox, Safari or Chrome (and maybe Internet Explorer 9).
</canvas>
<div id='specialcontrols'>
<label for="debug_mode">Debug Mode: </label><input type="checkbox" name="debug_mode" id="debug_mode">
</div>
<div id = "featuresdiv">
<p style="clear:all;float:right;margin-left:10px;margin-top:10px;"><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" id="Player_b03de607-447c-483c-a742-4c4c26c1b975" WIDTH="250px" HEIGHT="250px"> <PARAM NAME="movie" VALUE="http://ws.amazon.com/widgets/q?rt=tf_ssw&ServiceVersion=20070822&MarketPlace=US&ID=V20070822%2FUS%2Fwwwadityaravi-20%2F8003%2Fb03de607-447c-483c-a742-4c4c26c1b975&Operation=GetDisplayTemplate"><PARAM NAME="quality" VALUE="high"><PARAM NAME="bgcolor" VALUE="#FFFFFF"><PARAM NAME="allowscriptaccess" VALUE="always"><embed src="http://ws.amazon.com/widgets/q?rt=tf_ssw&ServiceVersion=20070822&MarketPlace=US&ID=V20070822%2FUS%2Fwwwadityaravi-20%2F8003%2Fb03de607-447c-483c-a742-4c4c26c1b975&Operation=GetDisplayTemplate" id="Player_b03de607-447c-483c-a742-4c4c26c1b975" quality="high" bgcolor="#ffffff" name="Player_b03de607-447c-483c-a742-4c4c26c1b975" allowscriptaccess="always" type="application/x-shockwave-flash" align="middle" height="250px" width="250px"></embed></OBJECT> <NOSCRIPT><A HREF="http://ws.amazon.com/widgets/q?rt=tf_ssw&ServiceVersion=20070822&MarketPlace=US&ID=V20070822%2FUS%2Fwwwadityaravi-20%2F8003%2Fb03de607-447c-483c-a742-4c4c26c1b975&Operation=NoScript">Amazon.com Widgets</A></NOSCRIPT></p>
<div id="debugger">
Debugging off.
</div>
<br>
<p style="font-size:smaller;">Updates:
<ul style="font-size:smaller;">
<li>v0.3d Released
<ul>
<li>Harvester saved when refinery is sold</li>
<li>Ctrl + 0-9 can be used to set unit control groups</li>
<li>No building on fog of war or half outside screen</li>
<li>Canceling returns money</li>
<li>Can start building with insufficient funds. Waits when out of money</li>
</ul>
</li>
<br>
<li>v0.3c Released - Performance patch
<ul>
<li>Harvesters collect 700 per trip</li>
<li>Using sprite sheets for faster loading and processing.</li>
</ul>
</li>
<br>
<li>Special thanks to <a href="http://www.nahklick.de/">http://www.nahklick.de/</a> for hosting during periods of high traffic. <br><br>Please continue to bookmark & share <a href="http://www.adityaravishankar.com/projects/games/command-and-conquer/">http://www.adityaravishankar.com/projects/games/command-and-conquer/</a> instead of the temporary redirect page.
</li><br>
<li>v0.3b Released - Bugfixes - Thank you for all your feedback!!
<ul>
<li>Tanks can turn in place</li>
<li>Tooltip shows unit/building cost</li>
<li>Harvester life does not regenerate inside refinery</li>
<li>Can pan to the right edge of the map even with sidebar visible</li>
</ul>
</li>
<br>
<li>v0.3 Released
<ul>
<li>Can repair or sell buildings</li>
<li>Refinery and Harvesters to process tiberium (cash)</li>
<li>Lots of bug fixes and Speed/Performance optimization</li>
</ul>
</li>
<br>
<li>v0.2 Released
<ul>
<li>Improved pathfinding</li>
</ul>
</li>
<br>
<li>v0.1 Released</li>
</ul>
</p>
<p style="font-size:smaller;margin-top:10px;">Controls:
<ul style="font-size:smaller;">
<li>Unit Selection
<ul>
<li>Single Unit - Click on a unit to select it</li>
<li>Drag Selection - Drag mouse to select multiple units</li>
<li>Multiple Selection - Shift + Click to add unit multiple units</li>
</ul>
</li>
<li>Movement/Attacking
<ul>
<li>Move - Select unit(s) and click on destination to move</li>
<li>Attack - Select unit(s) and click on target building or unit to attack</li>
<li>Map panning - Move cursor near edge of map to pan and scroll around</li>
</ul>
</li>
<li>Building
<ul>
<li>Build Construction Yard - Move MCV to where you want, and click on it to deploy</li>
<li>Expand Sidebar and click on construction options to build them. Once you finish contruction, more options become available</li>
</ul>
</li>
</ul>
</p>
<p style="font-size:smaller;">DISCLAIMER: This project is only intended as a technical proof of concept to demonstrate the basic working elements of an RTS game in HTML5. No commercial use is intended. All images and sounds used are from C&C - Tiberian Dawn and are property of the original game creators. </p>
</div>
</div>
<div style="float:left;margin-left:20px;padding:20px;">
<div style="">
<script type="text/javascript">
google_ad_client = "ca-pub-4565102206556382";
/* SmallSquare1 */
google_ad_slot = "9663428057";
google_ad_width = 200;
google_ad_height = 200;
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<div style="padding:20px;">
<script type="text/javascript">
google_ad_client = "ca-pub-4565102206556382";
/* Small Square 2 */
google_ad_slot = "3705220259";
google_ad_width = 200;
google_ad_height = 200;
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<div>
<script type="text/javascript">
google_ad_client = "ca-pub-4565102206556382";
/* Skyscraper */
google_ad_slot = "9356447655";
google_ad_width = 160;
google_ad_height = 600;
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</div>
</body>
</html>