;; The first three lines of this file were inserted by DrRacket. They record metadata ;; about the language level of this file in a form that our tools can easily process. #reader(lib "htdp-beginner-reader.ss" "lang")((modname Game) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ()))) (require "Teachpacks/bootstrap-teachpack.rkt") (require "Teachpacks/bootstrap-teachpack.rkt") ;; DATA: ;; The World is a: ; define-struct: ;; STARTING WORLD ;; GRAPHICS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; GRAPHICS FUNCTIONS: ;; draw-world: world -> Image ;; place DANGER, TARGET, CLOUD and PLAYER onto BACKGROUND at the right coordinates ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; UPDATING FUNCTIONS: ;; update-world: world -> world ;; What does your update-world function do? ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; KEY EVENTS: ;; keypress: world string -> world ;; What does your keypress function do? ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; TESTS FOR COND: ;; off-left? : number -> boolean ;; Checks whether an object has gone off the left side of the screen ;; off-right? : number -> boolean ;; Checks whether an object has gone off the right side of the screen ;; line-length : number number -> number ;; Finds 1D distance ;; distance : number number number number -> number ;; Finds the 2D distance between two points ;; collide? : number number number number -> boolean ;; determines whether two objects are within 50 pixels of eachother ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; big-bang using the START world ;; on a tick-event, use update-world ;; on a draw-event, use draw-world ;; on a key-event, use keypress ;(big-bang START ; (on-tick update-world) ; (on-draw draw-world) ; )