Ejemplo n.º 1
0
  @Override
  public void update(long currentFrame) {

    // Check for moving
    if (!_myState.moving) {
      // Check for destroy
      if (_animation.isStopped()) {
        _level.getLogicManager().detachLogic(this);
      }

      return;
    }

    super.update(currentFrame);

    // Check for squash grunts / spiders
    for (CellLogic cell : _level.getCellManager().getCollisionsWith(this, 16, currentFrame)) {

      // Check for grunt
      try {
        Grunt grunt = (Grunt) cell;
        grunt.getBehaviour().exit("Squash");
      } catch (Exception e) {
      }

      // Check for spider
      try {
        Spider spider = (Spider) cell;
        spider.squash(currentFrame);
      } catch (Exception e) {
      }
    }
  }
Ejemplo n.º 2
0
 public static void main(String[] args) {
   Spider spider = new Spider();
   spider.search("https://www.quora.com/", "computer");
 }
Ejemplo n.º 3
0
 public static void main(String[] args) throws IOException {
   Spider spider = new Spider();
   spider.search("http://wwww.reddit.com/", "testing");
 }
Ejemplo n.º 4
0
 public static void DeleteSpider(Spider spider2) {
   if (spider == spider2) {
     spider.OnDelete();
     spider = null;
   }
 }
Ejemplo n.º 5
0
 public static void OnDraw(Canvas canvas) {
   if (spider != null) spider.OnDraw(canvas);
 }
Ejemplo n.º 6
0
 public static void OnUpdate(long diff) {
   if (spider != null) spider.OnUpdate(diff);
 }