-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Br4ggs/dev
Dev
- Loading branch information
Showing
12 changed files
with
453 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//deprecated, do not use | ||
|
||
var Chest = function (yPos, xPos, item) { | ||
this.yPos = yPos; | ||
this.xPos = xPos; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
var Item = function (yPos, xPos, desc) { | ||
this.id = generateId(); | ||
this.desc = desc; | ||
this.yPos = yPos; | ||
this.xPos = xPos; | ||
//this.action = function | ||
}; | ||
|
||
Item.prototype.inspect = function () { | ||
writeToConsole(this.desc); | ||
}; | ||
|
||
Item.prototype.interact = function () { | ||
this.function(); | ||
layer2Generator.removeObject(this); | ||
} | ||
|
||
//How do i get all item variables and functions in item instead of potion | ||
var Potion = function (yPos, xPos, hp) { | ||
Item.call(this, yPos, xPos, "a health potion healing " + hp + " hitpoints."); | ||
this.hp = hp; | ||
this.function = () => { | ||
writeToConsole("you pick up the potion"); | ||
writeToConsole(layer3Generator.healPlayer(this.hp)); | ||
}; | ||
}; | ||
|
||
Potion.prototype = Object.create(Item.prototype); | ||
Potion.prototype.constructor = Potion; | ||
|
||
|
||
var GoldSack = function (yPos, xPos, amount) { | ||
Item.call(this, yPos, xPos, "a sack of gold containing " + amount + " gold."); | ||
this.amount = amount; | ||
this.function = () => { | ||
writeToConsole("you pick up the goldsack"); | ||
writeToConsole(layer3Generator.addPlayerGold(this.amount)); | ||
} | ||
} | ||
|
||
GoldSack.prototype = Object.create(Item.prototype); | ||
GoldSack.prototype.constructor = GoldSack; | ||
|
||
|
||
var Key = function (yPos, xPos) { | ||
Item.call(this, yPos, xPos, "the key to the next floor."); | ||
this.function = () => { | ||
writeToConsole("you pick up the key"); | ||
writeToConsole(layer3Generator.setPlayerKey(true)); | ||
} | ||
} | ||
|
||
Key.prototype = Object.create(Item.prototype); | ||
Key.prototype.constructor = Key; |
Oops, something went wrong.