File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export abstract class Actor extends GameObject {
13
13
14
14
public equipt : Item ;
15
15
16
- public inventory : Item [ ] ;
16
+ public inventory : GameObject [ ] ;
17
17
18
18
public debug : boolean = false ;
19
19
Original file line number Diff line number Diff line change @@ -37,15 +37,16 @@ class ShovelAction extends Action {
37
37
toPosY = this . actor . y ;
38
38
}
39
39
40
- // TODO: this is where you add something to inventory
41
- // Change this to "DirtWall" or "DiggableWall"... do we want to be able to dig out any walls?
42
40
if ( room . objects [ toPosX ] [ toPosY ] instanceof Wall ) {
43
- // this.actor.inventory.add(room.objects[toPosX][toPosY]);
41
+ // Add the wall to the actors inventory
42
+ this . actor . inventory . push ( room . objects [ toPosX ] [ toPosY ] ) ;
43
+
44
+ // Put a floor tile where the Wall that we just dug was
44
45
room . objects [ toPosX ] [ toPosY ] = new Floor ( toPosX , toPosY , room . floorTile ) ;
45
46
return true ;
46
47
}
48
+
47
49
return false ;
48
-
49
50
}
50
51
}
51
52
You can’t perform that action at this time.
0 commit comments