Browse Source

removing debug console logs; changing sell button to open shop

Justin Gilman 3 weeks ago
parent
commit
4bceb2cb0e
3 changed files with 10 additions and 12 deletions
  1. 9 10
      game.js
  2. 1 1
      index.html
  3. 0 1
      ui/gamestatusui.js

+ 9 - 10
game.js

@@ -45,16 +45,16 @@ const shelfSlots = [
     { "position": new THREE.Vector3(-3.5, 1.5, -3.5), "motionPath": [{ x: -3, y: 1.3, z: -3.5 }, { x: -1.5, y: 2, z: 0 }, { x: -0.5, y: 2, z: 0 }, { x: 0, y: 0.5, z: 0 }] },
     { "position": new THREE.Vector3(-4.5, 1.5, -3.5), "motionPath": [{ x: -3, y: 1.3, z: -3.5 }, { x: -1.5, y: 2, z: 0 }, { x: -0.5, y: 2, z: 0 }, { x: 0, y: 0.5, z: 0 }] },
     { "position": new THREE.Vector3(-4.5, 0, -3.0), "motionPath": [{ x: -3, y: 1.3, z: -3.5 }, { x: -1.5, y: 2, z: 0 }, { x: -0.5, y: 2, z: 0 }, { x: 0, y: 0.5, z: 0 }] },
-    { "position": new THREE.Vector3(-4.5, 3, -3.5), "motionPath": [{ x: -3, y: 1.3, z: -3.5 }, { x: -1.5, y: 2, z: 0 }, { x: -0.5, y: 2, z: 0 }, { x: 0, y: 0.5, z: 0 }] }
+    { "position": new THREE.Vector3(-3.3, 3, -3.5), "motionPath": [{ x: -3, y: 1.3, z: -3.5 }, { x: -1.5, y: 2, z: 0 }, { x: -0.5, y: 2, z: 0 }, { x: 0, y: 0.5, z: 0 }] }
 ]
 
 const storeShelfSlots = [
-    { "position": new THREE.Vector3(-12.5, 2.75, -3.25), "motionPath": [] },
-    { "position": new THREE.Vector3(-11.5, 2.75, -3.25), "motionPath": [] },
-    { "position": new THREE.Vector3(-8.5, 2.75, -3.25), "motionPath": [] },
-    { "position": new THREE.Vector3(-7.5, 2.75, -3.25), "motionPath": [] },
-    { "position": new THREE.Vector3(-8.5, 1.25, -3.25), "motionPath": [] },
-    { "position": new THREE.Vector3(-7.5, 1.25, -3.25), "motionPath": [] },
+    { "position": new THREE.Vector3(-12.5, 2.75, -3.25), "motionPath": [{ x: -11.5, y: 2.75, z: -3.25 }, { x: -12, y: 2, z: -2 }, { x: -13, y: 0.75, z: 2.5 }] },
+    { "position": new THREE.Vector3(-11.5, 2.75, -3.25), "motionPath": [{ x: -11.5, y: 2.75, z: -3.25 }, { x: -12, y: 2, z: -2 }, { x: -13, y: 0.75, z: 2.5 }] },
+    { "position": new THREE.Vector3(-8.5, 2.75, -3.25), "motionPath": [{ x: -11.5, y: 2.75, z: -3.25 }, { x: -12, y: 2, z: -2 }, { x: -13, y: 0.75, z: 2.5 }] },
+    { "position": new THREE.Vector3(-7.5, 2.75, -3.25), "motionPath": [{ x: -11.5, y: 2.75, z: -3.25 }, { x: -12, y: 2, z: -2 }, { x: -13, y: 0.75, z: 2.5 }] },
+    { "position": new THREE.Vector3(-8.5, 1.25, -3.25), "motionPath": [{ x: -11.5, y: 2.75, z: -3.25 }, { x: -12, y: 2, z: -2 }, { x: -13, y: 0.75, z: 2.5 }] },
+    { "position": new THREE.Vector3(-7.5, 1.25, -3.25), "motionPath": [{ x: -11.5, y: 2.75, z: -3.25 }, { x: -12, y: 2, z: -2 }, { x: -13, y: 0.75, z: 2.5 }] },
 ]
 
 const customerSlots = [
@@ -234,7 +234,6 @@ export function addValueToSave(container, key, value) {
 
 export function addAmountToSave(key, value) {
     let amount = parseInt(localStorage.getItem(`${GAME_SAVE_KEY}-${key}`)) ?? 0
-    console.log('reading from save', amount)
     amount += value
 
     localStorage.setItem(`${GAME_SAVE_KEY}-${key}`, amount)
@@ -381,7 +380,8 @@ export async function init(inGame) {
     })
 
     stageData.candycorn = await loadGltf(game, 'models/candycorn.gltf')
-    stageData.candycorn.position.x = -3.3
+
+    stageData.candycorn.position.x = -4.5
     stageData.candycorn.position.z = -3.5
     game.scene.add(stageData.candycorn)
 
@@ -951,7 +951,6 @@ export function onClick() {
                                             updatePotionShelfDisplay()
                                             firstCustomer.acceptPotion()
                                             stageData.soundEffects['audio/cash-register.ogg'].play()
-                                            console.log(`getting money: ${potion.potionData.value}`)
                                             stageData.currency = addAmountToSave("currency", potion.potionData.value)
                                             updateGameStatusUI(game, stageData)
                                             //move money from customer to chest

+ 1 - 1
index.html

@@ -229,7 +229,7 @@
             </div>
             <div id="shop-button-container">
                 <div id="shop-button-inner-container">
-                    <button id="start-selling">Sell</button>
+                    <button id="start-selling">Open Shop</button>
                 </div>
             </div>
         </div>

+ 0 - 1
ui/gamestatusui.js

@@ -11,7 +11,6 @@ export function hideGameStatusUI(game, stageData) {
 }
 
 export function updateGameStatusUI(game, stageData) {
-    console.log("updating game currency", stageData.currency)
     document.getElementById("currency-progress").value = stageData.currency
     document.getElementById("currency-progress").title = stageData.currency