Thread: Mirror
View Single Post
  #4  
Old 11-07-2015, 06:11 PM
Kirko Kirko is offline
Registered Guest
Join Date: Dec 2014
Location: Texas
Posts: 61
Kirko has a spectacular aura aboutKirko has a spectacular aura about
Quote:
Originally Posted by fowlplay4 View Post
Get the tile data: this.level.tiles[tx, ty]

Use these functions:

PHP Code:
gettileset(); // returns the current tileset image

//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;

use stretchy = -1; to flip an the tile image.

Just make your mirror image dimensions match the tiles so you don't have to do any clipping.
Thanks, tiles show now!! Just gotta make them appear in correct spot now.

edit: I got everything to work but just looks weird to me.
Only problem I have is only yourself will show on mirror and when you swing your sword the gani doesn't play fully.

Last edited by Kirko; 11-07-2015 at 07:45 PM.. Reason: added pic
Reply With Quote