View Single Post
  #19  
Old 12-25-2012, 12:44 AM
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
Quote:
Originally Posted by Gunderak View Post
And as for blocking tiles.
PHP Code:
  tiles[x, y]; 
so you expect him to write down all blocking tiles while he could do a simple onwall(), onwall2() or tiletype() check?

Quote:
Originally Posted by Trakan View Post
Thanks dude xD

Okay i now have:

PHP Code:
// Scripted by *Trakan
//#CLIENTSIDE
function onKeyPressed(keyCode, keyName, scanCode) {
  if (
keyName == "e") {
    if (
player.dir == 3 && !indodge) {
      
freezeplayer(1.5);
      
setani gh_gani_roulade, ;
      
set indodge;
      for (
temp.i = 0; temp.i < 4; temp.i++) {
        
player.x += 1;
        
sleep(.1);
      }
      
sleep(0.5);
      unset 
indodge;
      
setani idle, ;
    }
    if (
player.dir == 1 && !indodge) {
      
freezeplayer(1.5);
      
setani gh_gani_roulade, ;
      
set indodge;
      for (
temp.i = 0; temp.i < 4; temp.i++) {
        
player.x -= 1;
        
sleep(.1);
      }
      
sleep(0.5);
      unset 
indodge;
      
setani idle, ;
    }
    if (
player.dir == 0 && !indodge) {
      
freezeplayer(1.5);
      
setani gh_gani_roulade, ;
      
set indodge;
      for (
temp.i = 0; temp.i < 4; temp.i++) {
        
player.y -= 1;
        
sleep(.1);
      }
      
sleep(0.5);
      unset 
indodge;
      
setani idle, ;
    }

  if (
player.dir == 2 && !indodge) {
    
freezeplayer(1.5);
    
setani gh_gani_roulade, ;
    
set indodge;
    for (
temp.i = 0; temp.i < 4; temp.i++) {
      
player.y += 1;
      
sleep(.1);
    }
    
sleep(0.5);
    unset 
indodge;
    
setani idle, ;
  }
}
} 
things you should fix:
PHP Code:
setani("ani", params); //proper gs2; if you dont have params make it NULL (params part)

this.indodge = boolean; //boolean is true or false; should be used instead of using (un)set

for (temp.i = 0; temp.i < 4; temp.i++) {
  if (
onwall2(player.x+0.5, player.y+1+1, 2, 2)) continue;
  
//onwall2(x, y, width, height);
  //at the player.y part i added two +1 because the first is to have it go down to the "default" block check and the
  //2nd one is for the new y position, personal reference of doing it like this; should be fixed with '-' or at the
  //'player.x' parts when you are using it in other directions
  //continue should make it leave the for() loop when you are on the wall (regarding the check)

  
player.y += 1;
  
sleep(.1);
} 
__________________
MEEP!
Reply With Quote