diff options
-rw-r--r-- | bonnie-bee/bullet.scm | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/bonnie-bee/bullet.scm b/bonnie-bee/bullet.scm index 95c925c..4f79792 100644 --- a/bonnie-bee/bullet.scm +++ b/bonnie-bee/bullet.scm @@ -89,7 +89,7 @@ (quadtree #:getter quadtree #:init-keyword #:quadtree) (batch #:getter batch #:init-thunk make-bullet-sprite-batch) (capacity #:getter capacity #:init-value %max-bullets) - (size #:accessor size #:init-value 0) + (num-bullets #:accessor num-bullets #:init-value 0) (descriptors #:accessor descriptors) (velocities #:accessor velocities) (hitboxes #:accessor hitboxes) @@ -105,7 +105,7 @@ (set! (regions bullets) (make-vector* %max-bullets make-null-rect))) (define-method (clear-bullets (bullets <bullets>)) - (set! (size bullets) 0)) + (set! (num-bullets bullets) 0)) (define-class <bullet> () (parent #:getter parent #:init-keyword #:parent) @@ -126,7 +126,7 @@ (vector-ref (hitboxes (parent bullet)) (index bullet))) (define-method (add-bullet (bullets <bullets>) bullet-type position velocity) - (let ((i (size bullets))) + (let ((i (num-bullets bullets))) (when (< i (capacity bullets)) (let ((bh (hitbox bullet-type)) (d (vector-ref (descriptors bullets) i)) @@ -144,11 +144,11 @@ (set-rect-y! r (- (vec2-y position) 8.0)) (set-rect-width! r 16.0) (set-rect-height! r 16.0) - (set! (size bullets) (+ i 1)) + (set! (num-bullets bullets) (+ i 1)) (quadtree-insert! (quadtree bullets) h d))))) (define-method (remove-bullet (bullets <bullets>) i) - (let* ((s (- (size bullets) 1)) + (let* ((s (- (num-bullets bullets) 1)) (ds (descriptors bullets)) (rs (regions bullets)) (vs (velocities bullets)) @@ -170,7 +170,7 @@ (vector-set! rs s r) (vector-set! vs s v) (vector-set! hs s h) - (set! (size bullets) s) + (set! (num-bullets bullets) s) (quadtree-delete! q h d))) (define-method (render (bullets <bullets>) alpha) @@ -178,7 +178,7 @@ (rs (regions bullets)) (b (batch bullets))) (sprite-batch-clear! b) - (for-range ((i (size bullets))) + (for-range ((i (num-bullets bullets))) (let ((d (vector-ref ds i)) (r (vector-ref rs i))) (sprite-batch-add* b r %identity-matrix @@ -192,7 +192,7 @@ (hs (hitboxes bullets)) (q (quadtree bullets))) (let loop ((i 0)) - (when (< i (size bullets)) + (when (< i (num-bullets bullets)) (let ((d (vector-ref ds i)) (r (vector-ref rs i)) (v (vector-ref vs i)) |