Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define ALTO 350)
- (define ANCHO 400)
- (define AUTO .)
- (define MOV 30)
- (define INICIO (/ (image-width AUTO) 2))
- (define (pantalla n) (place-image AUTO n (/ ALTO 2) (empty-scene ANCHO ALTO) ) )
- (define (incrementar n) (cond ((> n (- ANCHO INICIO)) n ) (else (+ n 3))))
- (define (tecla n k) (cond
- ((key=? k " ") INICIO)
- ((and (key=? k "right") (>= (- ANCHO (+ n INICIO)) MOV )) (+ n MOV) )
- ((and (key=? k "left") (>= (- n INICIO) MOV )) (- n MOV) )
- (else n)))
- (define (mouse-handler n x y event) (cond ( (string=? event "button-down" ) x ) (else n)))
- (big-bang INICIO
- (to-draw pantalla)
- (on-tick incrementar)
- (on-key tecla)
- (on-mouse mouse-handler)
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement