summaryrefslogtreecommitdiffstats
path: root/net/ricketyspace/ror/five/ufo.rkt
blob: 9acdd2c041a694139d9dc3f76492bebb74285019 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#lang racket
(require 2htdp/universe 2htdp/image)

(define WIDTH 300)
(define HEIGHT 325)

(define (add-3-to-state current-state)
  (+ current-state 3))

(define (draw-a-ufo-onto-an-empty-scene current-state)
  (place-image IMAGE-of-UFO (/ WIDTH 2) current-state
               (empty-scene WIDTH HEIGHT)))

(define IMAGE-of-UFO (bitmap/file "resources/zarking-ufo.png"))

(define (state-is-300 current-state)
  (>= current-state 300))

(big-bang 0
          (on-tick add-3-to-state)
          (to-draw draw-a-ufo-onto-an-empty-scene)
          (stop-when state-is-300))