1.3 The Code
1.3.1 Shared
1.3.1.1 Location
1.3.1.2 Direction
1.3.1.3 Entity
1.3.1.4 Request
1.3.1.5 Occupant
1.3.1.6 Reply
8.14
1.3.1.3 Entity🔗

Source code at entity.rkt

The game world is populated with entities. An entity has a unique identifier, and a type.

(struct entity (id type) #:prefab)

Bots are controlled by game clients, and can move around the world. Bases are places where items can be delivered. Blocks are passive, and can be picked up, carried, and dropped by bots. Edges are a special type, generated by the server, to show bots where the edge of the world is.

(define type-bot 0)
(define type-base 1)
(define type-block 2)
(define type-edge 3)

(define (make-edge) (entity 0 type-edge))