fixed bug in debug button where breakable locations would be lost for
languages other than (module ...) made push-pull-ball not a module, so it just runs in FrTime removed velocity display from pong.ss, and moved default location of left controller so it doesn't cause div-by-zero exceptions svn: r3718
This commit is contained in:
parent
6536587e76
commit
c1a85ad061
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
(define-values (paddle1-pos ball-pos ball-vel)
|
(define-values (paddle1-pos ball-pos ball-vel)
|
||||||
(letrec ([paddle1-pos (make-posn
|
(letrec ([paddle1-pos (make-posn
|
||||||
(clip (+ 100
|
(clip (+ 150
|
||||||
(integral (hold
|
(integral (hold
|
||||||
(merge-e
|
(merge-e
|
||||||
(key-strokes
|
(key-strokes
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
((when-e (<= (posn-x paddle1-pos) 30)) . -=> . 0))
|
((when-e (<= (posn-x paddle1-pos) 30)) . -=> . 0))
|
||||||
0)))
|
0)))
|
||||||
30 170)
|
30 170)
|
||||||
(clip (+ 100
|
(clip (+ 150
|
||||||
(integral (hold
|
(integral (hold
|
||||||
(merge-e
|
(merge-e
|
||||||
(key-strokes
|
(key-strokes
|
||||||
|
@ -106,6 +106,6 @@
|
||||||
(make-circle paddle2-pos paddle-radius "black")
|
(make-circle paddle2-pos paddle-radius "black")
|
||||||
(make-graph-string (make-posn 30 30) (number->string p2-score) "black")
|
(make-graph-string (make-posn 30 30) (number->string p2-score) "black")
|
||||||
(make-graph-string (make-posn 350 30) (number->string p1-score) "black")
|
(make-graph-string (make-posn 350 30) (number->string p1-score) "black")
|
||||||
(make-graph-string (make-posn 120 30) (number->string (posn-len ball-vel)) "black")
|
;(make-graph-string (make-posn 120 30) (number->string (posn-len ball-vel)) "black")
|
||||||
(make-line (make-posn 0 150) (make-posn 0 250) "red")
|
(make-line (make-posn 0 150) (make-posn 0 250) "red")
|
||||||
(make-line (make-posn 399 150) (make-posn 399 250) "red")))
|
(make-line (make-posn 399 150) (make-posn 399 250) "red")))
|
||||||
|
|
|
@ -1,35 +1,33 @@
|
||||||
(module push-pull-ball (lib "frtime.ss" "frtime")
|
(require (lib "etc.ss" "frtime")
|
||||||
|
(lib "animation.ss" "frtime"))
|
||||||
(require (lib "etc.ss" "frtime")
|
|
||||||
(lib "animation.ss" "frtime"))
|
|
||||||
|
|
||||||
(define radius (new-cell 20))
|
|
||||||
|
|
||||||
(define pos1
|
|
||||||
(rec pos
|
|
||||||
(until (make-posn 200 200)
|
|
||||||
(delay-by
|
|
||||||
(let ([brnch (posn+ pos
|
|
||||||
(posn* (normalize (posn- mouse-pos pos))
|
|
||||||
(- (posn-diff pos mouse-pos) (sub1 radius))))])
|
|
||||||
(if (> (posn-diff pos mouse-pos) radius)
|
|
||||||
brnch
|
|
||||||
pos))
|
|
||||||
0))))
|
|
||||||
|
|
||||||
(define pos2
|
(define radius (new-cell 20))
|
||||||
(rec pos
|
|
||||||
(until (make-posn 100 100)
|
|
||||||
(delay-by
|
|
||||||
(let ([brnch (posn+ pos
|
|
||||||
(posn* (normalize (posn- pos1 pos))
|
|
||||||
(- (posn-diff pos pos1) (add1 (* 2 radius)))))])
|
|
||||||
(if (< (posn-diff pos pos1) (* 2 radius))
|
|
||||||
brnch
|
|
||||||
pos))
|
|
||||||
0))))
|
|
||||||
|
|
||||||
(display-shapes
|
(define pos1
|
||||||
(list
|
(rec pos
|
||||||
(make-circle pos1 radius "blue")
|
(until (make-posn 200 200)
|
||||||
(make-circle pos2 radius "blue"))))
|
(delay-by
|
||||||
|
(let ([brnch (posn+ pos
|
||||||
|
(posn* (normalize (posn- mouse-pos pos))
|
||||||
|
(- (posn-diff pos mouse-pos) (sub1 radius))))])
|
||||||
|
(if (> (posn-diff pos mouse-pos) radius)
|
||||||
|
brnch
|
||||||
|
pos))
|
||||||
|
0))))
|
||||||
|
|
||||||
|
(define pos2
|
||||||
|
(rec pos
|
||||||
|
(until (make-posn 100 100)
|
||||||
|
(delay-by
|
||||||
|
(let ([brnch (posn+ pos
|
||||||
|
(posn* (normalize (posn- pos1 pos))
|
||||||
|
(- (posn-diff pos pos1) (add1 (* 2 radius)))))])
|
||||||
|
(if (< (posn-diff pos pos1) (* 2 radius))
|
||||||
|
brnch
|
||||||
|
pos))
|
||||||
|
0))))
|
||||||
|
|
||||||
|
(display-shapes
|
||||||
|
(list
|
||||||
|
(make-circle pos1 radius "blue")
|
||||||
|
(make-circle pos2 radius "blue")))
|
||||||
|
|
|
@ -496,7 +496,9 @@
|
||||||
breakpoints
|
breakpoints
|
||||||
(lambda (pos status)
|
(lambda (pos status)
|
||||||
; possible efficiency problem for large files with many breakpoints
|
; possible efficiency problem for large files with many breakpoints
|
||||||
(when (and (>= pos 0) (not (memq pos break-posns)))
|
(when (and (>= pos (syntax-position top-e))
|
||||||
|
(< pos (+ (syntax-position top-e) (syntax-span top-e)))
|
||||||
|
(not (memq pos break-posns)))
|
||||||
(hash-table-remove! breakpoints pos))))
|
(hash-table-remove! breakpoints pos))))
|
||||||
(for-each (lambda (posn)
|
(for-each (lambda (posn)
|
||||||
(hash-table-put!
|
(hash-table-put!
|
||||||
|
|
Loading…
Reference in New Issue
Block a user