Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Personal High Scores on Start Screen and Lowered Speed #132

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hextris.io
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
Hextris
==========

Built by @teamsnowman (@meadowstream, @garrettdreyfus, @nmoroze, and @themichaelyang) for HackExeter 2014
Contributors:
- Logan Engstrom (@meadowstream)
- Garrett Finucane (@garrettdreyfus)
- Noah Moroze (@nmoroze)
- Michael Yang (@themichaelyang)

# Releases
#### iOS: https://itunes.apple.com/us/app/hextris/id903769553?mt=8
Expand All @@ -12,8 +16,8 @@ Built by @teamsnowman (@meadowstream, @garrettdreyfus, @nmoroze, and @themichael

## Press kit

hextris.github.io/presskit/info.html
http://hextris.github.io/presskit/info.html

## License

This work is under a GPL license.
This work is under a GPL v3 license.
40 changes: 21 additions & 19 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@
<script type = 'text/javascript' src="vendor/jsonfn.min.js"></script>
<script type = 'text/javascript' src="vendor/keypress.min.js"></script>
<script type = 'text/javascript' src="vendor/jquery.js"></script>
<script type = 'text/javascript' src="js_v8/save-state.js"></script>
<script type = 'text/javascript' src="js_v8/view.js"></script>
<script type = 'text/javascript' src="js_v8/wavegen.js"></script>
<script type = 'text/javascript' src="js_v8/math.js"></script>
<script type = 'text/javascript' src="js_v8/Block.js"></script>
<script type = 'text/javascript' src="js_v8/Hex.js"></script>
<script type = 'text/javascript' src="js_v8/Text.js"></script>
<script type = 'text/javascript' src="js_v8/comboTimer.js"></script>
<script type = 'text/javascript' src="js_v8/checking.js"></script>
<script type = 'text/javascript' src='js_v8/update.js'></script>
<script type = 'text/javascript' src='js_v8/render.js'></script>
<script type = 'text/javascript' src="js_v8/input.js"></script>
<script type = 'text/javascript' src="js_v8/main.js"></script>
<script type = 'text/javascript' src="js_v8/initialization.js"></script>
<script type = 'text/javascript' src="js_v9/save-state.js"></script>
<script type = 'text/javascript' src="js_v9/view.js"></script>
<script type = 'text/javascript' src="js_v9/wavegen.js"></script>
<script type = 'text/javascript' src="js_v9/math.js"></script>
<script type = 'text/javascript' src="js_v9/Block.js"></script>
<script type = 'text/javascript' src="js_v9/Hex.js"></script>
<script type = 'text/javascript' src="js_v9/Text.js"></script>
<script type = 'text/javascript' src="js_v9/comboTimer.js"></script>
<script type = 'text/javascript' src="js_v9/checking.js"></script>
<script type = 'text/javascript' src='js_v9/update.js'></script>
<script type = 'text/javascript' src='js_v9/render.js'></script>
<script type = 'text/javascript' src="js_v9/input.js"></script>
<script type = 'text/javascript' src="js_v9/main.js"></script>
<script type = 'text/javascript' src="js_v9/initialization.js"></script>
<script type = 'text/javascript' charset = 'utf-8' src = 'cordova.js'></script>
</head>
<body>
Expand All @@ -59,7 +59,7 @@
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "http://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0";
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
Expand All @@ -68,7 +68,7 @@
<h2 id = 'clickToExit' style = 'background-color:#fff;color:#000'>Click to exit</h2>
<textarea id ='devtoolsText' style = 'height:300px;width:400px;'></textarea>
</div>
<div id="overlay" class="faded"></div>
<div class="faded overlay"></div>
<div id="attributions">Started by <a href="http://github.com/teamsnowman" target="_blank">@teamsnowman</a> at <a href= 'http://www.hackexeter.com/' target="_blank">HackExeter</a><br>
Finished by <a href="http://github.com/meadowstream" target="_blank">Logan Engstrom</a> & <a href='http://github.com/garrettdreyfus' target="_blank">Garrett Finucane</a> on <a href = 'http://github.com/hextris/hextris' target="_blank">GitHub</a><br>
<a href = 'https://itunes.apple.com/us/app/id903769553?mt=8'><b>iOS</b></a> <b>&</b> <a href ='https://play.google.com/store/apps/details?id=com.hextris.hextris'><b>Android</b></a> apps + <a href ='http://hextris.github.io/presskit/info.html'>press kit</a> @ <a href='http://hextris.github.io/'>http://hextris.github.io/</a>
Expand All @@ -79,14 +79,16 @@ <h1 class = 'instructions_body'>Instructions</h1>
<p class = 'instructions_body' id = 'inst_main_body'></p>
</div>
<div id="openSideBar" class = 'helpText'><i class="fa fa-info-circle fa-lg"></i> <i class="fa fa-arrow-left"><b> Help</b></i></div>
<div id="overlay" class="faded"></div>
<div id = 'pauseBtn'><div id = 'pauseBtnInner'><i class="fa fa-pause fa-2x"></div></i></div>
<div class="faded overlay"></div>
<div id = 'pauseBtn'><div id = 'pauseBtnInner'><i class="fa fa-pause fa-2x"></i></div></div>
<div id = 'restartBtn'><div id = 'restartBtnInner'><i class="fa fa-refresh fa-2x"></i></div></div>
<div id="bottombar">
<div style="bottom:4px; padding-right:4px;" class="fb-like" data-href="http://hextris.github.io/hextris" data-width="20" data-layout="button_count" data-action="like" data-show-faces="false" data-share="true"></div>
<a onClick="tweetblock=true" href="https://twitter.com/intent/tweet?hashtags=hextris&original_referer=http%3A%2F%2F0.0.0.0%3A8080%2F&text=Play%20Hextris!%20-&tw_p=tweetbutton&url=http%3A%2F%2Fhextris.github.io%2F" class="twitter-share-button" data-url="http://hextris.github.io/" data-text="Play Hextris! -" data-hashtags="hextris">Tweet</a>
<a href="https://twitter.com/hextris" class="twitter-follow-button" data-show-count="false" data-show-screen-name="false">Follow @hextris</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
<iframe id = 'ghl' src="http://ghbtns.com/github-btn.html?user=Hextris&repo=Hextris&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="90" height="20" onload='showbottombar()'></iframe>
<iframe id = 'ghl' src="//ghbtns.com/github-btn.html?user=Hextris&repo=Hextris&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="90" height="20" onload='showbottombar()'></iframe>
</div>
<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-51272720-2', 'auto'); ga('send', 'pageview'); </script>
</body>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions js_v8/initialization.js → js_v9/initialization.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ function initialize(a) {
baseBlockHeight: 20,
blockHeight: 20,
rows: 7,
speedModifier: 0.73,
creationSpeedModifier: 0.73,
speedModifier: 0.73/1.5,
creationSpeedModifier: 0.73/1.5,
comboTime: 240
};
} else {
Expand All @@ -107,8 +107,8 @@ function initialize(a) {
baseBlockHeight: 20,
blockHeight: 15,
rows: 8,
speedModifier: 0.65,
creationSpeedModifier: 0.65,
speedModifier: 0.65/1.5,
creationSpeedModifier: 0.65/1.5,
comboTime: 240
};

Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions js_v8/main.js → js_v9/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,18 @@ function setStartScreen() {
requestAnimFrame(animLoop);
}

var spd = 1;

function animLoop() {
switch (gameState) {
case 1:
requestAnimFrame(animLoop);
render();
var now = Date.now();
var dt = (now - lastTime)/16.666 * rush;
if (spd > 1) {
dt *= spd;
}

if(gameState == 1 ){
if(!MainHex.delay) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 13 additions & 4 deletions js_v8/view.js → js_v9/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ function drawScoreboard() {
renderText(trueCanvas.width / 2 + gdx + 6 * settings.scale, trueCanvas.height / 2 + gdy, 60, "rgb(236, 240, 241)", String.fromCharCode("0xf04b"), 'px FontAwesome');
renderText(trueCanvas.width / 2 + gdx + 6 * settings.scale, trueCanvas.height / 2 + gdy - 170 * settings.scale, 150, "#2c3e50", "Hextris");
renderText(trueCanvas.width / 2 + gdx + 5 * settings.scale, trueCanvas.height / 2 + gdy + 100 * settings.scale, 20, "rgb(44,62,80)", 'Play!');


renderText(trueCanvas.width / 2 + gdx + 5 * settings.scale, trueCanvas.height / 2 + gdy + 150 * settings.scale, 25, "rgb(80,62,44)", "Personal High Scores:");

for (i = 0; i < 3; i++) {
if (highscores.length > i) {
renderText(trueCanvas.width / 2 + gdx + 5 * settings.scale, trueCanvas.height / 2 + gdy + 190 + (25 * i) * settings.scale, 20, "rgb(70,62,44)", (i + 1) + " : " + highscores[i] );
}
}
} else if (gameState != 0 && textOpacity > 0) {
textOpacity -= 0.05;
renderText(trueCanvas.width / 2 + gdx + 6 * settings.scale, trueCanvas.height / 2 + gdy, 60, "rgb(236, 240, 241)", String.fromCharCode("0xf04b"), 'px FontAwesome');
Expand Down Expand Up @@ -136,8 +145,8 @@ function showText(text) {
}
}
messages['gameover'] += "<div class='fltrt' id='tweetStuff'><a class='tweet' href='https://twitter.com/intent/tweet?text=Can you beat my score of "+ score +" points at&button_hashtag=hextris ? http://hextris.github.io/hextris @hextris' data-lang='en' data-related='hextris:hextris' target='_blank'>Share Your Score on Twitter!!!</a></div>"
$("#overlay").html(messages[text]);
$("#overlay").fadeIn("1000", "swing");
$(".overlay").html(messages[text]);
$(".overlay").fadeIn("1000", "swing");

if (text == 'gameover') {
if (settings.platform == 'mobile') {
Expand All @@ -162,8 +171,8 @@ function setMainMenu() {
}

function hideText() {
$("#overlay").fadeOut("1000", function() {
$("#overlay").html("");
$(".overlay").fadeOut("1000", function() {
$(".overlay").html("");
})
}

Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions style/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ and (max-device-width : 480px) {
}
}

#overlay {
.overlay {
position:absolute;
height:20%;
width:100%;
Expand Down Expand Up @@ -234,7 +234,7 @@ and (max-device-width : 580px) {
text-align:center;
}

#overlay {
.overlay {
margin-top: -20%;
}
}
Expand Down Expand Up @@ -304,7 +304,7 @@ body {
width:1000px;
text-align:center;
left:50%;
margin-left:-510px;
margin-left:-500px;
bottom:10px;
z-index:98;
}