From 279f17ac0e1b3d019c2b294098e834d249376686 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Tue, 4 Jun 2019 20:49:16 -0400 Subject: Update chickadee manual. --- manuals/chickadee/Grid.html | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'manuals/chickadee/Grid.html') diff --git a/manuals/chickadee/Grid.html b/manuals/chickadee/Grid.html index f6e1cbf..1b578ac 100644 --- a/manuals/chickadee/Grid.html +++ b/manuals/chickadee/Grid.html @@ -1,6 +1,6 @@ - @@ -130,42 +132,42 @@ this filtering technique, a game can resolve collisions between different objects in different ways.

-
Procedure: make-grid [cell-size 64]
+
Procedure: make-grid [cell-size 64]

Return a new grid partitioned into cell-size tiles.

-
Procedure: grid? obj
+
Procedure: grid? obj

Return #t if obj is a grid.

-
Procedure: cell? obj
+
Procedure: cell? obj

Return #t if obj is a grid cell.

-
Procedure: cell-count cell
+
Procedure: cell-count cell

Return the number of items in cell.

-
Procedure: grid-cell-size grid
+
Procedure: grid-cell-size grid

Return the cell size of grid.

-
Procedure: grid-cell-count grid
+
Procedure: grid-cell-count grid

Return the number of cells currently in grid.

-
Procedure: grid-item-count grid
+
Procedure: grid-item-count grid

Return the number of items in grid.

-
Procedure: grid-add grid item x y width height
+
Procedure: grid-add grid item x y width height

Add item to grid represented by the axis-aligned bounding box whose lower-left corner is at (x, y) and is @@ -173,17 +175,17 @@ box whose lower-left corner is at (x, y) and is

-
Procedure: grid-remove grid item
+
Procedure: grid-remove grid item

Return item from grid.

-
Procedure: grid-clear grid
+
Procedure: grid-clear grid

Remove all items from grid.

-
Procedure: grid-move grid item position filter
+
Procedure: grid-move grid item position filter

Attempt to move item in grid to position (a 2D vector) and check for collisions. For each collision, filter will be called with two arguments: item and the item it collided @@ -192,18 +194,18 @@ resolve the colliding objects.

-
Procedure: for-each-cell proc grid [rect]
+
Procedure: for-each-cell proc grid [rect]

Call proc with each cell in grid that intersects rect, or every cell if rect is #f.

-
Procedure: for-each-item proc grid
+
Procedure: for-each-item proc grid

Call proc for each item in grid.

-
Procedure: slide item item-rect other other-rect goal
+
Procedure: slide item item-rect other other-rect goal

Resolve the collision that occurs between item and other when moving item-rect to goal by sliding item-rect -- cgit v1.2.3