// // itemController.js //-------------------- // An item controller for scenes. Allows items to be synced to multiple clients. // by RHY3756547 // // includes: gl-matrix.js (glMatrix 2.0) // window.ItemController = function(scene) { var t = this; t.scene = scene; t.items = []; t.curInd = 0; //next item index. Max value is insanely high so there shouldn't be much of a problem. t.cliID = 0; //client id, used along with item index to specify your items. t.time = 0; t.addItem = addItem; t.changeItem = changeItem; t.update = update; t.draw = draw; t.createItem = createItem; t.removeItem = removeItem; var RedShell, Banana, Bomb, BlueShell, Star, MultiItem, Shroom, TripleShroom, QueenShroom, Bullet, Ghost, Squid //these are all null var itemFunc = [ GreenShell, RedShell, Banana, Bomb, BlueShell, Star, MultiItem, //triple shells, lucky 7 if you're into that kind of thing Shroom, TripleShroom, QueenShroom, Bullet, Ghost, Squid ] function update(scene) { var itC = t.items.slice(0); for (var i=0; i