/**** * Classes ****/ //<Assets used in the game will automatically appear here> // Class for 3D objects var Object3D = Container.expand(function () { var self = Container.call(this); var objectGraphics = self.attachAsset('object3D', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { // Object3D update logic }; }); // Class for the trash can var TrashCan = Container.expand(function () { var self = Container.call(this); var trashCanGraphics = self.attachAsset('trashCan', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { // TrashCan update logic }; }); // Class for the virus var Virus = Container.expand(function () { var self = Container.call(this); var virusGraphics = self.attachAsset('virus', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { // Virus update logic }; }); // Class for weird objects var WeirdObject = Container.expand(function () { var self = Container.call(this); var weirdObjectGraphics = self.attachAsset('weirdObject', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { // WeirdObject update logic self.rotation += 0.1; }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 //Init game with black background }); /**** * Game Code ****/ // Initialize arrays and variables var objects3D = []; var score = 0;
/****
* Classes
****/
//<Assets used in the game will automatically appear here>
// Class for 3D objects
var Object3D = Container.expand(function () {
var self = Container.call(this);
var objectGraphics = self.attachAsset('object3D', {
anchorX: 0.5,
anchorY: 0.5
});
self.update = function () {
// Object3D update logic
};
});
// Class for the trash can
var TrashCan = Container.expand(function () {
var self = Container.call(this);
var trashCanGraphics = self.attachAsset('trashCan', {
anchorX: 0.5,
anchorY: 0.5
});
self.update = function () {
// TrashCan update logic
};
});
// Class for the virus
var Virus = Container.expand(function () {
var self = Container.call(this);
var virusGraphics = self.attachAsset('virus', {
anchorX: 0.5,
anchorY: 0.5
});
self.update = function () {
// Virus update logic
};
});
// Class for weird objects
var WeirdObject = Container.expand(function () {
var self = Container.call(this);
var weirdObjectGraphics = self.attachAsset('weirdObject', {
anchorX: 0.5,
anchorY: 0.5
});
self.update = function () {
// WeirdObject update logic
self.rotation += 0.1;
};
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000 //Init game with black background
});
/****
* Game Code
****/
// Initialize arrays and variables
var objects3D = [];
var score = 0;