mirror of
https://github.com/id-Software/wolf3d-browser.git
synced 2026-03-20 00:49:33 +01:00
Wolfenstein 3D browser version
This is the code for the browser version of Wolfenstein 3D which is playable on http://www.wolfenstein.com/game_NA.php
This commit is contained in:
64
index.html
Normal file
64
index.html
Normal file
@@ -0,0 +1,64 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<!--
|
||||
Copyright (C) 2012 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the WOLF3D Browser Version GPL Source Code.
|
||||
-->
|
||||
<meta charset="UTF-8">
|
||||
<title>Test Page</title>
|
||||
<style>
|
||||
body {
|
||||
background-color : black;
|
||||
text-align : center;
|
||||
}
|
||||
#wolf3d {
|
||||
margin-top : 100px;
|
||||
border : none;
|
||||
width : 640px;
|
||||
height : 400px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<iframe id="wolf3d" src="wolf3d.html" mozallowfullscreen="true" webkitallowfullscreen="true">
|
||||
</iframe>
|
||||
|
||||
|
||||
<script>
|
||||
window.onfocus = function() {
|
||||
var game = window.frames[0];
|
||||
if (game) {
|
||||
game.focus();
|
||||
}
|
||||
};
|
||||
window.oncontextmenu = function(e) {
|
||||
if (e.preventDefault) {
|
||||
e.preventDefault();
|
||||
}
|
||||
var game = window.frames[0];
|
||||
if (game && game.Wolf && game.Wolf.Input) {
|
||||
if (game.Wolf.Input.rightMouseDown()) {
|
||||
game.Wolf.Input.resetMouse();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
window.onmouseup = function(e) {
|
||||
var game = window.frames[0];
|
||||
if (game && game.Wolf && game.Wolf.Input) {
|
||||
if (game.Wolf.Input.rightMouseDown() || game.Wolf.Input.leftMouseDown()) {
|
||||
game.Wolf.Input.resetMouse();
|
||||
if (e.preventDefault) {
|
||||
e.preventDefault();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user