service/games/13/index.html
soafen e364b9143f wiinet is ready™️
hopefully, after over a year of development, it will have been worth the wait
2022-09-09 23:24:33 +02:00

106 lines
3.2 KiB
HTML

<html>
<head>
<link rel="stylesheet" href="css.css" type="text/css" />
<script language="javascript" type="text/javascript" src="3dfps.js"></script>
<script language="javascript" type="text/javascript">
var mousex=160, mousey=120, angle=180;
Textures = [];
(Textures[0] = new Image()).src = 'tiles/tile-brick.png';
(Textures[1] = new Image()).src = 'tiles/tile-brick.png';
(Textures[2] = new Image()).src = 'tiles/tile-rock.png';
(Textures[3] = new Image()).src = 'tiles/tile-woodwall.png';
(Textures[4] = new Image()).src = 'tiles/tile-win.png';
(Textures[5] = new Image()).src = 'tiles/sky.jpg';
Walls = [];
Walls[0] = [1,1,1,1,1,1,1,1,1,1];
Walls[1] = [1,0,0,0,1,0,0,0,0,1];
Walls[2] = [1,0,0,0,1,0,1,0,0,1];
Walls[3] = [1,0,0,0,0,0,0,1,0,1];
Walls[4] = [1,1,1,1,1,1,0,1,0,1];
Walls[5] = [1,0,0,0,0,0,0,1,0,1];
Walls[6] = [2,0,2,2,2,0,2,0,0,1];
Walls[7] = [2,0,0,0,0,2,0,0,1,1];
Walls[8] = [2,0,2,2,0,0,1,0,0,1];
Walls[9] = [2,0,0,0,2,0,0,2,0,1];
Walls[10] =[2,0,2,0,2,0,2,0,0,1];
Walls[11] =[2,0,2,0,0,2,0,2,2,2];
Walls[12] =[3,0,0,3,0,0,0,2,2,2];
Walls[13] =[3,3,3,3,0,3,0,0,0,3];
Walls[14] =[3,0,0,0,0,3,0,3,0,3];
Walls[15] =[3,0,3,0,3,0,3,0,0,3];
Walls[16] =[3,3,3,0,0,0,0,3,0,3];
Walls[17] =[1,0,0,3,0,3,0,3,0,3];
Walls[18] =[1,0,2,0,3,0,0,3,0,3];
Walls[19] =[1,0,0,0,0,0,2,0,3,3];
Walls[20] =[1,0,0,2,2,2,0,0,0,2];
Walls[21] =[1,0,2,0,0,0,0,2,0,2];
Walls[22] =[3,0,0,0,2,0,2,0,2,2];
Walls[23] =[3,0,2,0,2,2,0,0,0,2];
Walls[24] =[3,0,2,0,0,0,0,2,0,4];
Walls[25] =[1,0,0,1,1,1,1,2,4,4];
Walls[26] =[1,1,0,0,0,0,1,4,0,4];
Walls[27] =[1,1,1,1,1,1,1,2,4,4];
Teleports = [];
Teleports[0] = [8.5,24.5, 8.5,26.5, '../index.html'];
window.onload = function(){
window.onmousemove = function(e){
mousex=e.clientX;
mousey=e.clientY;
return false;
}
window.onkeydown = function(e){
switch(e.keyCode){
case 37: mousex=80; break;
case 39: mousex=240; break;
case 38: mousey=90; break;
case 40: mousey=200; break;
case 13: mousex=160; mousey=160; break;
}
return false;
}
RayCaster.initialize(document.getElementById('thecanvas'));
RayCaster.setSize(400,300);
RayCaster.setLocation(1.5,1.5);
RayCaster.setDirection(angle);
RayCaster.setSkyColor(192,192,255);
RayCaster.setGroundColor(64,32,0);
RayCaster.setSkyImage(5);
RayCaster.setWalls(Walls);
RayCaster.setTextures(Textures);
RayCaster.setTeleports(Teleports);
animate();
}
function animate(){
angle+=(mousex-160)>>3;
angle=(angle+360)%360;
RayCaster.setDirection(angle);
if(mousey<60) RayCaster.moveForward();
if(mousey<100) RayCaster.moveForward();
if(mousey<140) RayCaster.moveForward();
if(mousey>180) RayCaster.moveBackward();
RayCaster.checkTeleports();
RayCaster.generateScene();
setTimeout("animate()", 20);
}
</script>
</head>
<body>
<a href="../index.html"><img src="../../img/GamesLogo.png" style="width:150px;height:50px;"></a>
<br><span style="font-size:36px;font-weight:bold;">Dungeon Escape</span> - by Daniel Gump<br>
<div style="text-align:center">
<canvas id="thecanvas" width="400" height="300" style="background:#000;"></canvas>
</div>
<div id="status"></div>
</body>
</body>
</html>