Skip to content

Commit

Permalink
Add "pet" item type
Browse files Browse the repository at this point in the history
  • Loading branch information
alesan99 committed Feb 21, 2024
1 parent e192e7b commit ee4dd2f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
4 changes: 3 additions & 1 deletion website/game/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ function loadGameAssets() {
head: {},
face: {},
body: {},
item: {},

furniture: {},
item: {}
pet: {}
}
// List of all items to load
ITEMS.head["tophat"] = {}
Expand Down
2 changes: 2 additions & 0 deletions website/game/objects/character.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ class Character extends PhysicsObject {
this.body = profile.body || false
this.item = profile.item || false

this.pet = profile.pet || false

// Progress Quests
if (this.controller == PLAYER_CONTROLLER) {
QuestSystem.event("clothes", this.head, this.face, this.body, this.item)
Expand Down
14 changes: 12 additions & 2 deletions website/game/savedata.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,24 @@ function makeSaveData() {
head: {},
face: {},
body: {},
item: {},

furniture: {},
item: {}
pet: {}
},
nuggets: 100,

pets: [],
house: [],

// Equipped pet status
// Persists between play sessions, but only stored for 1 pet at a time
pet: {
name: "",
health: 100,
happiness: 100,
hunger: 100
},

quests: {
// Quest progress
// Each quest progress is a list of numbers Ex: [0, 0, 1]
Expand Down

0 comments on commit ee4dd2f

Please sign in to comment.