source: abuse-mac/trunk/lisp/ladder.lsp @ 122

Last change on this file since 122 was 102, checked in by Sam Hocevar, 15 years ago
File size: 1.2 KB
Line 
1;; Copyright 1995 Crack dot Com,  All Rights reserved
2;; See licensing information for more details on usage rights
3
4/* written  in C
5(defun latter_check_area (first)
6  (if first
7      (progn
8        (if (and (<= (x) (with_object first (x)))
9                 (<= (y) (with_object first (y)))
10                 (>= (with_object (get_object 0) (x)) (with_object first (x)))
11                 (>= (with_object (get_object 0) (y)) (with_object first (y))))
12            (let ((yd (- (with_object first (y)) (y))))
13              (if (eq (with_object first (state)) climbing)
14                  (let ((newx (/ (+ (x) (with_object (get_object 0) (x))) 2)))
15                    (with_object first (set_x newx))))
16              (with_object first (setq in_climbing_area yd))))
17        (latter_check_area (next_focus first)))))
18
19
20(defun latter_ai ()
21  (if (> (total_objects) 0)
22      (latter_check_area (first_focus)))
23  T)
24*/
25
26(def_char LADDER
27  (funs (ai_fun   latter_ai)
28        (draw_fun dev_draw))
29  (range 50 800)
30  (states "art/misc.spe" (stopped "latter")))
31
32(defun step_ai ()
33  (if (or (eq (total_objects) 0)
34           (with_object (get_object 0) (not (eq (aistate) 0))))
35      (set_state stopped)
36    (set_state running))
37  T)
38
39(def_char STEP
40  (funs (ai_fun   step_ai))
41  (flags (can_block T))
42  (states "art/chars/step.spe"
43          (stopped "step")
44          (running "step_gone")))
45 
46       
47       
Note: See TracBrowser for help on using the repository browser.