Peter Muturi 1 년 전
부모
커밋
2afc559dc5
2개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 2
      resources/views/app/markup.blade.php
  2. 4 2
      resources/views/app/script.blade.php

+ 2 - 2
resources/views/app/markup.blade.php

@@ -243,8 +243,8 @@
           <h6>Max Odds: x3</h6>
         </div>
         <div class="d-flex align-items-start justify-content-between mt-3">
-          <h6>Total Chips: @{{currencyFormat(total)}}</h6>
-          <h6>Bet Placed: @{{bet}}</h6>
+          <h6>Total: @{{currencyFormat(total)}}</h6>
+          <h6>Bet Placed: @{{passChipCount}}</h6>
         </div>
       </div>
     </div>

+ 4 - 2
resources/views/app/script.blade.php

@@ -7,7 +7,6 @@
             chips: [1, 5, 10, 25, 50, 100],
             total: 10000,
             max: 2000,
-            bet: 0,
             selectedChip: 1,
             alert: 'Place your bets by clicking on the Pass Line',
             comeAlert: '',
@@ -37,6 +36,7 @@
             onPassLine: function() {
                 var self = this;
                 if (self.passPoint) return;
+                if (self.passPoint >= 2000) return;
                 self.game = true;
                 self.comeAlert = '';
                 self.alert = 'Place your bets by clicking on the Pass Line';
@@ -63,16 +63,18 @@
                 self.oddsAlert = "";
                 var max = self.passChipCount * 3;
                 if (self.selectedChip > max || (self.oddsChipCount + self.selectedChip) > max) {
+                    self.total += self.oddsChipCount;
                     self.oddschips = self.passchips;
                     self.oddsChipCount = max;
                     self.oddsAlert = "Max odds bet reached! (x3 of your pass bet)";
+                    self.total -= max;
                 } else {
                     self.oddsChipCount += self.selectedChip;
                     if (self.oddschips.indexOf(self.selectedChip) <= -1) {
                         self.oddschips.push(self.selectedChip);
                     };
+                    self.total -= self.selectedChip;
                 }
-                self.total -= self.oddsChipCount;
             },
             resetGame: function() {
                 var self = this;