i tested your game on my oldest device, Sony Xperia Ray.
When i press the button there is a little delay till mario jumps but its always the same so i think its intentional? Feels almost like playing an old lcd/handheld electronic game.
is there an intented delay or does it lag?
Sitenote, the game doesnt scale well, getting it to scale wright on every device is hard with cocoon but there are instructions that can be find on the forum here.
You should also try to build your app with Intel XDK cordova and see how it performs.
The delay is because web browsers have a 300milisecond click delay , there is a javascript library that makes the delay go away but I didnt know about it yet. As far as the scaling I didn't code it with auto-scale because the regular codes I used didn't work (still beginner) .
Just to show you how much code I needed to make this game. You will see how much easier things are in construct2 vs coding. This is the game in pure javascript and it took me 2 weeks for that simple game.
<!DOCTYPEhtml>
<head>
<meta name="viewport" content="width=device-width, user-scalable=no">
<style>
body
{
background-image:url('bkone.png');
background-size:600px 300px;
background-repeat:no-repeat;
}
#ad
{
position:absolute;
left:0px;
top:280px;
}
</style>
<script>
function replayer()
{
var r=confirm(" Try Again !! You almost beat the highscore");
if (r==true)
{
x=location.href="level.html";
}
else
{
x=location.href="index.html";
}
}
function jump() // controls player jump
{
pointClick();
document.getElementById("m").style.top = "100px";
document.getElementById("m").src="MarioTwo.png";
setTimeout(function()
{
document.getElementById("m").style.top = "210px";
document.getElementById("m").src="Mario.png";
},700)
}
function colides(elem1, elem2) // colide checker
{
var cr1 = elem1.getClientRects()[0];console.log(cr1);
var cr2 = elem2.getClientRects()[0];console.log(cr2);
var heightOffset = (cr1.bottom - cr2.top); console.log(heightOffset);
var widthOffset = (cr1.right - cr2.left ); console.log(widthOffset);
if ( heightOffset < (elem1.clientHeight + elem2.clientHeight)
&& heightOffset >0
&& widthOffset < (elem1.clientWidth + elem2.clientWidth)
&& widthOffset > 0) return true;
return false;
}
function moving() // controls barrel movement
{
var pp = document.getElementById("b");
var left = parseInt(pp.style.left);
if (colides(pp, document.getElementById("m"))){
pp.style.left = "1000px"
replayer();
} else {
var tim = setTimeout("moving()",60); // controls the speed
left = left-25; // move by 50 pixels
if (left < 0) left = 700;
pp.style.left = left+"px";
}
}
window.onload = moving;
</script>
</head>
<body>
<p style="color:white"> Score</p>
<p id="output" style="color:white" >0</p>
<p style="color:Black"> HighScore</p>
<p id="high" style="color:black" >10000</p>
<img id="m" src="Mario.png" style="position:absolute;top:210px;left:140px;height:60px;width:60px;zdepth:2;" />
<img id="b" src="barrel.png" style="position:absolute;top:220px;left:1200px;height:60px;width:60px;zdepth:2;" />
<img id="g" src="green.png" onclick="jump()" style="position:absolute;top:180px;left:15px;height:100px;width:100px;zdepth:2;" />
<script>
var points = 0;
var higher = 5000;
function pointClick()
{
points = points + 200;
document.getElementById("output").innerHTML = points;
if( points > higher)
{
higher = points;
document.getElementById("high").innerHTML = points;
}
};
</script>
</body>
</html>
Construct2 saves you a ton of freaking time. Thanks for the input.