Thread: Mirror
View Single Post
  #12  
Old 07-26-2016, 06:40 PM
Kirko Kirko is offline
Registered Guest
Join Date: Dec 2014
Location: Texas
Posts: 61
Kirko is a jewel in the roughKirko is a jewel in the rough
oops I never posted the code :o

been a while since I made it so I decided to rewrite it just now to shorten it up.
Only problem is that it only shows your character
PHP Code:

//#CLIENTSIDE
function onPlayerEnters() {
  
setshape(1this.mirror_width 16this.mirror_height 16);
  
showTiles();
  
onTimeOut();
}

function 
onTimeOut() {
  if (
player.x in |thiso.1.5thiso.this.mirror_width 1.5| && 
      
player.y in |thiso.this.mirror_height 1.5+ (this.mirror_height 2) - 2|){ 
    
with (findimg(50)) {
      
player.x;
      
thiso.+ (thiso.playero.y) + thiso.mirror_height 2.5;
      
layer 1;
      
      
ani player.ani.name "[" player.anistep "]";
      
dir player.dir == player.dir == player.dir;
      
head   player.head;
      
shield player.shield;
      for (
temp.0temp.5temp.++) colors[i] = player.colors[i];
      for (
temp.0temp.20temp.++) attr[i] = player.attr[i];
    }
  } else
    
hideimg(50);
    
  
setTimer(0.05);
}

function 
showTiles(){
  
temp.mw this.mirror_width;
  
temp.mh this.mirror_height;

  
temp.area temp.mw temp.mh;
  
temp.y    this.temp.mh 1;
  
  for(
temp.0temp.temp.areatemp.++) {
    
temp.+= (temp.temp.mw) == 0;

    
with (findimg(201 temp.i)) {
      
= (thiso.x) + ((temp.temp.mw) * 1);
      
= (thiso.temp.mh 1) - (int(temp.temp.mh) * 1);
      
      
image gettileset();
      
partx TilesToImage(this.level.tiles[xtemp.y])[0];
      
party TilesToImage(this.level.tiles[xtemp.y])[1];
      
partw parth 16;
      
stretchy = -1;
      
layer 0;
    }
  }
}

//credit to dusty 
function TilesToImage(t) {
  if (
t.type() == 0) {
    
temp.px = (int(t%16)*16)+(int(t/512)*256);
    
temp.py = (int(t/16)*16)%512;
    return {
px,py};
  } else if (
t.type() == 3) {
    
temp.imgarray = new[0];
    for (
temp.t) {
      
temp.px = (int(i%16)*16)+(int(i/512)*256);
      
temp.py = (int(i/16)*16)%512;
      
imgarray.add({px,py}); 
    }
    return 
imgarray;
  } else return -
1;

Reply With Quote