Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.3.x Mods

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #29  
Old 02-16-2016, 11:37 AM
NobodysHero's Avatar
NobodysHero NobodysHero is offline
Co-Owner of MystFell
 
Join Date: Nov 2013
Posts: 144
Gender: Female
Credits: 26,170
NobodysHero is on a distinguished road
Default Same issue: No Longer Displays Cards After 1st Turn.

I have that same issue. The only file I changed was the hilo_non.js to update the amount of money offered. Also, doesn't appear that my score is updating? Having the same issue with the Word Scramble game, which used your coding as a foundation.

Below is my hilo_non.js file and some screenshots for reference and piece of mind. Didn't included view and index file screenshots, but both are placed appropriately.

Code:

PHP Code:
$(function() {
    
checkPlays();
});

var 
plays 20;
var 
score 0;
var 
first Math.floor(Math.random()*16);

$(
'.first').html(first);

$(
'.guess').click(function(){
  if (
plays >= 0){
    var 
second Math.floor(Math.random()*16);
    $(
'.second').html(second);
    if ($(
this).hasClass('higher')){
      if (
first <= second){
        
resultIs('correct'second);
        
sendScore(150);
      } else {
        
resultIs('incorrect'second);
        
sendScore(0);
      }
    }
    if ($(
this).hasClass('lower')){
      if (
first >= second){
        
resultIs('correct'second);
        
sendScore(150);
      } else {
        
resultIs('incorrect'second);
        
sendScore(0);
      }
    }
  }
});

function 
resultIs(resultsecond){
  $(
'.result').html(result);
  $(
'.result').fadeIn(1000, function(){
    $(
'.first').fadeOut(500);
      $(
'.second').fadeOut(500, function(){    
      $(
'.first').html(second);
      
first second;
      
plays plays 1;
      $(
'.first').fadeIn(500);
      $(
'.second').html('?');
      $(
'.second').fadeIn(500);      
      $(
'.plays').html(plays);
      if (
result == 'correct'){
        
score score 150;
        
current parseFloat(window.parent.$('.money').text());
        
window.parent.$('.money').fadeTo(1000.1);
        
window.parent.$('.money').text((current score));
        
window.parent.$('.money').fadeTo(1001);
      }
      $(
'.score').html(score);
      if (
plays <= 0){
        
disableGame();
      }
    });
  }); 
  $(
'.result').fadeOut(500);
}

function 
sendScore(amt) {
  var 
values = {
    
'username': $("#username").text(),
    
'amt'amt
  
};
  $.
ajax({
    
url"sendscore.php",
    
type"POST",
    
datavalues,
  }).
done(function(status){
    if (
status == "GameOver"){
      
disableGame();
    } else {
      $(
'.plays').html(status);
      
plays status;
    }
  });
}

function 
disableGame(){
  $(
'.plays').html("0");
  $(
'.guess').off('click');
  $(
'.guess').css'cursor''not-allowed' );
  $(
'.arrow-box').fadeTo('slow'0.3);
  $(
'.first').html('game');
  $(
'.second').html('over');
  $(
'.finalscore').html("<b>Plays Left Today:</b> 0 of 20<h2>See You Tomorrow!</h2>");
}

function 
checkPlays(){
  var 
values = {
    
'username': $("#username").text(),
    
'plays''check'
  
};
  $.
ajax({
    
url"sendscore.php",
    
type"POST",
    
datavalues,
  }).
done(function(status){
    if (
status == "GameOver"){
      
disableGame();
    } else {
      $(
'.plays').html(status);
      
plays status;
    }
  });

Screenshots:




Reply With Quote
 

Tags
ajax, game, higher or lower, javascript


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 03:26 AM.

Currently Active Users: 2103 (0 members and 2103 guests)
Threads: 4,081, Posts: 32,032, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636