-
Notifications
You must be signed in to change notification settings - Fork 0
/
transition-animations.rkt
41 lines (29 loc) · 1 KB
/
transition-animations.rkt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#lang racket
(require 2htdp/universe)
; GENERAL TRANSITION LOGIC
; on-draw:
; if state.transcounter == 0 draw-state
; if state.transcounter != 0 draw-tween(transcounter)
; on-tick:
; decrement state.transcounter
; on-key:
; (optionally) set state.transcounter to transition-length
; ?? where to store per-transformation transition fns?
; (optionally) set state.draw-tween to transition-tween
; NEW STUFF NEEDED:
; draw-tween(t) where t \in {transition-length,0} satisying:
; draw-tween(transition-length) == draw-state(previous-state)
; draw-tween(0) == draw-state(new-state)
; state.transcounter, initially 0
; and each transform with a transition needs a transition-length
; other transforms should be unaffected
; EXPERIMENT 0:
; slowly flashing ball
; EXPERIMENT 1:
; two actual states (room ball empty)
; (room empty ball)
; when press down starts transition animation
; EXPERIMENT 2:
; two actual state
; with different position/sizes of a rectangle
; tween frames smoothly take one rectangle to the other