home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer 13 / 1995-12_Disc_13.iso / abuse / lisp / ladder.lsp < prev    next >
Lisp/Scheme  |  1995-08-31  |  1KB  |  44 lines

  1. ;; Copyright 1995 Crack dot Com,  All Rights reserved
  2. ;; See licencing information for more details on usage rights
  3.  
  4. (defun latter_check_area (first)
  5.   (if first
  6.       (progn
  7.     (if (and (<= (x) (with_object first (x)))
  8.          (<= (y) (with_object first (y)))
  9.          (>= (with_object (get_object 0) (x)) (with_object first (x)))
  10.          (>= (with_object (get_object 0) (y)) (with_object first (y))))
  11.         (let ((yd (- (with_object first (y)) (y))))
  12.           (if (eq (with_object first (state)) climbing)
  13.           (let ((newx (/ (+ (x) (with_object (get_object 0) (x))) 2)))
  14.             (with_object first (set_x newx))))
  15.           (with_object first (setq in_climbing_area yd))))
  16.     (latter_check_area (next_focus first)))))
  17.  
  18. (defun latter_ai ()
  19.   (if (> (total_objects) 0)
  20.       (latter_check_area (first_focus)))
  21.   T)
  22.  
  23. (def_char LADDER
  24.   (funs (ai_fun   latter_ai)
  25.     (draw_fun dev_draw))
  26.   (range 50 800)
  27.   (states "art/misc.spe" (stopped "latter")))
  28.  
  29. (defun step_ai ()
  30.   (if (or (eq (total_objects) 0)
  31.        (with_object (get_object 0) (not (eq (aistate) 0))))
  32.       (set_state stopped)
  33.     (set_state running))
  34.   T)
  35.  
  36. (def_char STEP
  37.   (funs (ai_fun   step_ai))
  38.   (flags (can_block T))
  39.   (states "art/chars/step.spe"
  40.       (stopped "step")
  41.       (running "step_gone")))
  42.   
  43.     
  44.