Currently, I am experimenting with creating a tank game inspired by Isaac Sukin's "Nemesis" game for AngelHack. The specific change I want to make involves using a model of a tank ("Tank.obj") instead of the default cube used as an enemy.
However, I keep encountering this error message: Uncaught TypeError: vector.subSelf is not a function
I'm puzzled by what this error implies and how to resolve it.
Just to provide some context: I have made sure that my Three.js file is fully updated and the OBJLoader.js is correctly included in my file structure.
Below are the modified files (the changes made are minimal):
/**
* Notes:
* - Coordinates are specified as (X, Y, Z) where X and Z are horizontal and Y
* is vertical
*/
var map = [ // 1 2 3 4 5 6 7 8 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1,], // 0
[1, 1, 0, 0, 0, 0, 0, 1, 1, 1,], // 1
[1, 1, 0, 0, 2, 0, 0, 0, 0, 1,], // 2
[1, 0, 0, 0, 0, 2, 0, 0, 0, 1,], // 3
[1, 0, 0, 2, 0, 0, 2, 0, 0, 1,], // 4
[1, 0, 0, 0, 2, 0, 0, 0, 1, 1,], // 5
[1, 1, 1, 0, 0, 0, 0, 1, 1, 1,], // 6
[1, 1, 1, 0, 0, 1, 0, 0, 1, 1,], // 7
[1, 1, 1, 1, 1, 1,...
// Additional code removed for brevity
<!DOCTYPE html>
<html>
<head>
<title>WebGL FPS - AngelHack SV 2012 - Isaac Sukin</title>
<style>
body {
background-image: url('images/screenshot.jpg');
cursor: crosshair;
font-family: Georgia, Helvetica, sans-serif;
font-weight: bold;
margin: 0;
overflow: hidden;
padding: 0;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
/* Additional CSS styles removed for brevity */
</style>
<script src="jquery-1.7.2.min.js"></script>
<script src="Three.js"></script>
<script src="OBJLoader.js"></script>
<script src="Three.FirstPersonControls.js"></script>
<script src="main.js"></script>
</head>
<body>
</body>
</html>
If anyone can offer assistance or guidance on resolving the above issue, I would greatly appreciate it!
Thank you, Noah