View Single Post
  #12  
Old 07-10-2013, 01:45 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
This is something that could work. Not 100% sure but I can't see something wrong


PHP Code:
//#CLIENTSIDE

const JUMP_HEIGHT 1//Player can jump one tile high

function onKeyPressed(codekey) {
    
//Won't change the player.canJump as you could keep it as a check
    //If the player could jump in theory for other scripts
  
if (key == "s" && player.canJump == true && player.== 0) {

      
//Create the shadow image
    
showImg(20"shadow.png"player.x+0.5player.y+1.5);
    
changeImgVis(201);
    
findImg(20).layer 0;
      
      
//I rathered to make it into one for() loop and have if statements
      //Inside of it instead of creating 2 loops, probably just a personal
      //Preference
    
for (temp.0temp.JUMP_HEIGHT*2temp.+= 0.05) {

        
//Since i took the JUMP_HEIGHT times 2, I can create such a check
      
if (temp.JUMP_HEIGHT) {
        
player.+= 0.05//Move the player up
      
}
      else {
        
player.-= 0.05//Move the player down
      
}
    }

      
//failsafe reset the player.z
    
player.0;

      
//hide the shadow as you will probably move back to the original one
    
hideImg(20);
  }

__________________
MEEP!
Reply With Quote