Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

263 lines (227 sloc) 11.995 kB
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Command and Conquer - Tiberian Dawn - HTML5</title>
<link rel="shortcut icon" href="http://www.adityaravishankar.com/favicon.ico" />
<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' />
<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.3b.js" type="text/javascript" charset="utf-8">
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-9874019-1']);
_gaq.push(['_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>
</head>
<body>
<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>
<div id="leftcontent">
<img style="float:left;"src="images/logo.jpg" width="400" height="146" alt="Command and Conquer">
<h1 >C&amp;C - HTML5 v0.3b 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 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>
<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>
&nbsp;
<!-- 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>
&nbsp;
<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.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&amp;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>
Jump to Line
Something went wrong with that request. Please try again.