// It's not advisable to declare this globally :(
var particleColors = [
new b2ParticleColor(0xff, 0x00, 0x00, 0xff), // red
new b2ParticleColor(0x00, 0xff, 0x00, 0xff), // green
new b2ParticleColor(0x00, 0x00, 0xff, 0xff), // blue
new b2ParticleColor(0xff, 0x8c, 0x00, 0xff), // orange
new b2ParticleColor(0x00, 0xce, 0xd1, 0xff), // turquoise
new b2ParticleColor(0xff, 0x00, 0xff, 0xff), // magenta
new b2ParticleColor(0xff, 0xd7, 0x00, 0xff), // gold
new b2ParticleColor(0x00, 0xff, 0xff, 0xff) // cyan
];
var container;
var world = null;
var threeRenderer;
var renderer;
var camera;
var scene;
var objects = [];
var timeStep = 1.0 / 60.0;
var velocityIterations = 8;
var positionIterations = 3;
var test = {};
var projector = new THREE.Projector();
var planeZ = new THREE.Plane(new THREE.Vector3(0, 0, 1), 0);
var g_groundBody = null;
var windowWidth = window.innerWidth;
var windowHeight = window.innerHeight;
// Other functions and initialization scripts go here...
function getMouseCoords(event) {
// Function to retrieve mouse coordinates in the canvas
}
body {
font-family: Monospace;
background-color: #f0f0f0;
margin: 0;
overflow: hidden;
background-color: red; /* just in case image doesn't load */
background-image: url(https://i.imgur.com/v38pV.jpg);
background-size: cover;
}
<script src="https://google.github.io/liquidfun/testbed/liquidfun.js"></script>
<!-- Include other necessary scripts -->
<body onload="initTestbed()"></body>