Browse Source

add createjs

Load_Fix
Robert Chen 11 years ago
parent
commit
126cf858b5
  1. 16
      createjs-2013.09.25.min.js
  2. 1
      js/screens.js
  3. 24
      js/ui.js

16
createjs-2013.09.25.min.js vendored

File diff suppressed because one or more lines are too long

1
js/screens.js

@ -351,7 +351,6 @@ function MarketScreen( stage, gameState ){ @@ -351,7 +351,6 @@ function MarketScreen( stage, gameState ){
this.uiElems.push( new ImgButton( stage, gameState, 690,0, "res/items/ExitSign.png", "res/items/ExitGlow.png","SwitchScreen", "KitchenScreen", "Click" ) );
var marketItemKeys = Object.keys(gameState.marketItems);
for (var index in marketItemKeys ) {
console.log("drawing"+gameState.marketItems[marketItemKeys[index]].name + " on screen " + gameState.currentScreen );
gameState.marketItems[marketItemKeys[index]].draw( stage );
}

24
js/ui.js

@ -296,6 +296,27 @@ function MarketItem( gameState, name, x, y, cost, mouseOutImg, mouseOverImg, mou @@ -296,6 +296,27 @@ function MarketItem( gameState, name, x, y, cost, mouseOutImg, mouseOverImg, mou
} );
mouseOutKitchen.addEventListener( "mouseover", function(){
document.body.style.cursor='pointer';
mouseOverKitchen.visible = true;
mouseOutKitchen.visible = false;
});
mouseOutKitchen.addEventListener( "mouseout", function(){
document.body.style.cursor='default';
mouseOverKitchen.visible = false;
mouseOverKitchen.visible = true;
} );
mouseOverKitchen.addEventListener( "mouseover", function(){
document.body.style.cursor='pointer';
mouseOverKitchen.visible = true;
mouseOutKitchen.visible = false;
});
mouseOverKitchen.addEventListener( "mouseout", function(){
document.body.style.cursor='default';
mouseOverKitchen.visible = false;
mouseOutKitchen.visible = true;
} );
mouseOver.addEventListener( "click", function(){
if(!that.bought && cost <= gameState.wallet ){
console.log(that.name);
@ -338,7 +359,7 @@ function MarketItem( gameState, name, x, y, cost, mouseOutImg, mouseOverImg, mou @@ -338,7 +359,7 @@ function MarketItem( gameState, name, x, y, cost, mouseOutImg, mouseOverImg, mou
gameState.pubsub.publish("RemoveItems", [mouseOut, mouseOver]);
// replace image with transparency
},
draw: function( stage, newx, newy ){
if( newx && newy ){
@ -347,7 +368,6 @@ function MarketItem( gameState, name, x, y, cost, mouseOutImg, mouseOverImg, mou @@ -347,7 +368,6 @@ function MarketItem( gameState, name, x, y, cost, mouseOutImg, mouseOverImg, mou
}
if( gameState.newScreen == "KitchenScreen" ){
console.log("In the kitchen");
stage.addChild( mouseOutKitchen );
stage.addChild( mouseOverKitchen );
return;

Loading…
Cancel
Save