===================================================================
--- original.js
+++ change.js
@@ -1,7 +1,16 @@
/****
* Classes
****/
+//<Assets used in the game will automatically appear here>
+// Class for Background
+var Background = Container.expand(function () {
+ var self = Container.call(this);
+ var backgroundGraphics = self.attachAsset('background', {
+ anchorX: 0,
+ anchorY: 0
+ });
+});
// Class for Cooking Pot
var CookingPot = Container.expand(function () {
var self = Container.call(this);
var potGraphics = self.attachAsset('cookingPot', {
@@ -11,10 +20,8 @@
self.update = function () {
// Update logic for cooking pot if needed
};
});
-//<Assets used in the game will automatically appear here>
-//<Write imports for supported plugins here>
// Class for Ingredients
var Ingredient = Container.expand(function () {
var self = Container.call(this);
var ingredientGraphics = self.attachAsset('ingredient', {
@@ -48,12 +55,9 @@
/****
* Game Code
****/
-var background = game.addChild(LK.getAsset('background', {
- anchorX: 0,
- anchorY: 0
-}));
+var background = game.addChild(new Background());
// Initialize game variables
var ingredients = [];
var score = 0;
var cookingPot = game.addChild(new CookingPot());