View Single Post
  #22  
Old 03-18-2018, 08:12 PM
MysticalDragon MysticalDragon is offline
Global Administration
MysticalDragon's Avatar
Join Date: Oct 2002
Location: Lynn Ma
Posts: 883
MysticalDragon is just really niceMysticalDragon is just really nice
Send a message via AIM to MysticalDragon Send a message via MSN to MysticalDragon
We did the same thing on delteria but I like your method you did with the array regarding setShape2 I did that aswell. Also use [PHP] tags instead of code tags looks much cleaner.


PHP Code:
//#CLIENTSIDE
function onCreated() {
  
with (findimg(200)) {
    
this.image thiso.bridgeImage;
    
this.layer  1;
    
this.thiso.x;
    
this.thiso.y;
    
this.mode  1;
    
this.alpha 0.75;

    if (
thiso.direction == "vertical")
      
this.+= 2;
    else
      
this.+= 2;
  }

  
this.bridgeWidth  getImgWidth(this.bridgeImage) / 16;
  
this.bridgeHeight getImgHeight(this.bridgeImage) / 16;
  
this.this.bridgeWidth  + (this.direction == "horizontal" 0);
  
this.this.bridgeHeight + (this.direction == "vertical" 0);

  
// 10 16
  // 10 21

  
this.dontBlock();

  
onTimeOut();
}

function 
onBridge(temp.py) {
  if (
player.x in |this.xthis.this.w|) {
    if (
temp.py in |this.ythis.this.h|)
      return 
true
  }

  return 
false;
}

function 
isPlayerEntering(temp.py) {
  if (
player.x in |this.xthis.this.w|) {
    if (
temp.py in |this.ythis.2|)
      return 
true;

    if (
temp.py in |this.this.2this.this.h|)
      return 
true;    
  }

  return 
false;
}

function 
onTimeOut() {
  
temp.py player.vecy(player.dir) * 1.05;

  
temp.entered isPlayerEntering(temp.py);

  if (
temp.entered) {
    if (
player.attached == false) {
      
attachPlayerToObj(0this.id);
      
setshape2(this.wthis.hthis.shape);
    }
  } else if (
player.attached == true && player.attachid == this.id) {
    if (
onBridge(temp.py)) {
    } else {
      
detachplayer();  
    }
    
this.chat "attached";
  } else {
    
this.chat "na";
  }

  
setTimer(0.05);

__________________
~Delteria Support
~Playerworld Support
~PWA Chief
http://support.toonslab.com
[email protected]



Reply With Quote