Thread: setshape?
View Single Post
  #2  
Old 03-02-2011, 11:59 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Ah, on iEra I didn't use that system... I used a box which moved around.

Here is a numbers version [imagine the image to be 3x3 boxes- not 2,2]
HTML Code:
function onCreated() {
  setTimer(10);
}

function onTimeout() {
    //There are in total 9 boxes (3 top, 3 middle & 3 bottom [ROWS])
  temp.box_kick = int(random(0, 10));
  
  this.chat = "Kicking Box" SPC temp.box_kick;
  scheduleevent(5, "KickBox", temp.box_kick);
}

function onKickBox(box_kick) {
  temp.p_box = {
    5 + (temp.box_kick * 12),
    5 + (temp.box_kick * 12)
  };
    //Now the boxes in the level start from 5 pixels from the left & 5 from the top
    // the size of the box is 10 tiles either side (width & height) and 4 tiles for
    // the wall size
  for (temp.i: players) {
    if (temp.i.x in |temp.p_box[0], temp.p_box[0] + 12| && temp.i.y in |temp.p_box[1], temp.p_box[1] + 12|) {
      temp.i.chat = "I've been kicked!";
    }
  }

  if (players.size() <= 1) {
    temp.pl = players[0];
    if (temp.pl != null) {
      temp.pl.chat = "Winner";
    }
    //Reset event & kick player etc
  }

  //Do it again etc
  setTimer(10);
}
Attached Thumbnails
Click image for larger version

Name:	boxarea.png
Views:	165
Size:	7.3 KB
ID:	52499  
__________________
Reply With Quote