summaryrefslogtreecommitdiff
path: root/bonnie-bee/bullet.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@vistahigherlearning.com>2022-10-10 09:48:44 -0400
committerDavid Thompson <dthompson@vistahigherlearning.com>2022-10-10 09:48:44 -0400
commitf713890a773a7d6ff666277592eec72f2328a5b6 (patch)
tree82564948af694c33877167fffd241824c44d1469 /bonnie-bee/bullet.scm
parenta1a44fc78d8c0215b8c6ecd51af0c0bcdc6b27f0 (diff)
bullet: Rename size method to num-bullets due to name collision.HEADmaster
The latest version of starling introduces a size slot on <node-2d>.
Diffstat (limited to 'bonnie-bee/bullet.scm')
-rw-r--r--bonnie-bee/bullet.scm16
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))