Skip to content
Browse files

Broke Trash out of the Inventory into its own object

Added to Phosphor
  • Loading branch information...
1 parent c30c6c6 commit 181db398638e5e702c97e8af44944778ec20040b @cthulhuology committed Jun 8, 2010
Showing with 16 additions and 11 deletions.
  1. +1 −1 js/phos.js
  2. +0 −10 object/Inventory
  3. +1 −0 object/Phosphor
  4. +14 −0 object/Trash
View
2 js/phos.js
@@ -95,7 +95,7 @@ _root.onload = function() {
_body = _doc.getElementsByTagName('body')[0];
use('Object','Array','String','Box','Widget','Component','Event','Device','Resource',
'Display','Keyboard','Mouse','Screen','Text','Sound','Image','Movie',
- 'Help','Inventory','Objects','Mirror','Phosphor',
+ 'Help','Inventory','Trash','Objects','Mirror','Phosphor',
'Names','HotKey','Block',
'Graphic','Rectangle','Circle',
'Blog','Search','App',
View
10 object/Inventory
@@ -7,16 +7,6 @@ An.object().named('Inventory').from(Widget,{
if (e.on(this)) Inventory.show()
},
}),
- // trash: an(Image,'images/trash.png').at(Display.w-64,Display.h-64).copy({
- // down: false,
- // up: function(e) {
- // var o = null;
- // while(o = this.overlaps([Display,Phosphor,this])) {
- // Sound.trash.play();
- // o.free();
- // };
- // },
- // }),
}).at(10,50).get('objects/',function(txt) {
eval('(' + txt + ')').every(function(v,i) {
localStorage[v] = 'use("' + v + '")';
View
1 object/Phosphor
@@ -73,6 +73,7 @@ An.object().named('Phosphor').from(Widget,{
return this.copy({
help: a(Help,'images/help_button.png').at(Display.w-100,10),
inventory: an(Inventory),
+ trash: a(Trash),
}).at(0,Display.h-64).by(Display.w,64).instance();
},
press: function(e) { if(Keyboard.ctrl || Keyboard.cmd) HotKey.of(e.key); },
View
14 object/Trash
@@ -0,0 +1,14 @@
+An.object().named('Trash').from(Widget,{
+ init: function() {
+ trash: an(Image,'images/trash.png').at(Display.w-64,Display.h-64).copy({
+ down: false,
+ up: function(e) {
+ var o = null;
+ while(o = this.overlaps([Display,Phosphor,this])) {
+ Sound.trash.play();
+ o.free();
+ };
+ },
+ });
+ }
+});

0 comments on commit 181db39

Please sign in to comment.
Something went wrong with that request. Please try again.