11/28/20
- Bare minimum for publishing.
10/6/19
- Let's try Gatsby.
1/9/14
- Archived the previous code in v1.0 and starting v2.0 with MEAN.
12/16/11
-
Made an
Animator
class that collects all the machinery for drawing images to the screen. You can pass its constructor an optional number representing frames per second in milliseconds; the default is 75. TheTimeline
constructor now expects anAnimator
instance as its first argument. -
Moved
playthrough_count
intoTimeline
. -
Adapted
Timeline.storeInFrames()
to store thexdistance
andydistance
of every cel. -
Rounded all
xdistance
andydistance
calculations to two decimal places.
12/15/11
-
Added
xlimit
andylimit
members to thescrubber
sequence inSlider
. These represent the far extremes of the slider, the scrubber's position after it's traveled 100 percent of the track distance. -
Created
Slider.drawBoundary()
, which helps click detection for the scrubber by drawing a path before runningisPointInPath()
. This was tricky, because it needs to follow the scrubber as it moves, andSlider
calls two different sequences on each draw.
12/14/11
-
Finished making the
Slider
class and combined the previousslider
andscrubber
into a new instance of it.Slider
inherits fromCharacter
-- it borrows its prototype. -
Adapted
renderCharacter()
to sniff outSlider
instances and make sure the track is drawn before the scrubber on each frame.
12/13/11
-
Fixed
Timeline.init()
. The timeline remembers the current cel, current sequence and current iteration for everyCharacter
instance on every frame in the animation. -
Moved
current_frame
,current_bp
andbreakpoints
insideTimeline
. Scrapped these andfps
fromstage
's scope. Everything works.
12/12/11
-
Added a constructor and prototype for a
Timeline
class.Timeline
stores history and methods for every frame in the animation.frame_total
,current_frame
, thebreakpoints
array,current_breakpoint
andfps
are moving into this class. -
Timeline.init()
is now working, though I was wrong about how theframes
array should store members. I'm revising this function. -
Added
Character.countSpan()
to store the total number of cels aCharacter
puts on the timeline. Having this number handy makes it easier to do some of the mathTimeline.init()
needs. -
Switched
pit
andpitforeground
to theCharacter
drawing methods.
12/11/11
-
Painstakingly removed all references to
Character.sequence
. I initially thought it would be a true collection, but it never got used that way. Leaving it seems like it costs an unnecessary lookup. So far, no ill effects. -
Updated
Character.reset()
to cycle through all sequences within aCharacter
and setcurrent_seq
to zero when it's finished. -
Updated
Character.setSequenceOrder()
to automatically resetstarting_frame
for any sequence following the first one. This letssetFrameTotal
keep an accurate count and saves the developer from having to set this value explicitly. -
Found out the hard way that
Character.setSequenceOrder()
can't set thestarting_frame
s accurately if it's called on a sequence that hasn't yet been populated with cels. It fails silently. So I added an error message to catch this. -
For testing, made
vaulter
's run-up sequence loop for 4 iterations. It, and the functions above, seem to work. -
Removed comments and the unused call to pv_cels.js from polevault.html.
12/10/11
-
Added a
sequenceOrder
property and asetSequenceOrder()
method to theCharacter
prototype. These store and alter the calling order of drawing instructions for aCharacter
's sequences. -
Modified
setFrameTotal()
to work with these new values. -
Added a
runup
sequence tovaulter
: a loopable series of strides to showthe vaulter approaching the pit. -
Moved
sequenceOrder
out of theCharacter
prototype and into its constructor, fixing the mistake I just introduced. -
sequenceOrder
is now calledsequence_order
to stick with the naming convention for variables. -
Updated
Character.advance()
to cycle through sequences. -
Fixed a bad assignment in
Character.advance()
that incrementedcurrent_seq
too early.
12/9/11
- Added the pit, the shadow and the updated vaulter to the stage.
12/5/11
-
The scrubber now moves in time with the action, thanks to the new drawing methods.
Character.cache
is almost obsolete. The methods do all the calculations before rendering. -
Fixed the problems with the Play and Step Through button boundaries. The Play path never closed before the Step Through path was drawn.
-
Moved the
record
methods into theCharacter
prototype. This means the functions can accept fewer arguments to know to which objects they're applied -- almost all of them are back to the arguments they'd expect as regularCRC
methods. This also means I removed the "record" part of the name. They live in the namespace of their parent and that's how you call them:vaulter.lineTo(100.0, 200.0);
. -
Started making a
Scrubber
class that inherits fromCharacter
. -
Added
xdistance
,ydistance
,xinc
andyinc
members to each sequence inCharacter
. These are meant to remember x and y increments and total distances from the axes as aCharacter
moves across the stage.
12/3/11
-
Moved
emptyAllCaches()
to the top ofdrawFrame()
. This is a better solution than calling it fromanimate()
, ensuring it gets called once per drawing cycle -- even the first one. -
Added
store()
to theCharacter
prototype. -
Added
recordBeginPath()
,recordClosePath()
,recordFillStyle()
,recordLineWidth()
,recordLineJoin()
,recordMiterLimit()
,recordLinearGradient()
,recordAddColorStop()
,recordStroke()
,recordStrokeStyle()
,recordSave()
andrecordRestore()
. -
Renamed
advanceCels()
toadvance()
andadvanceAllCels()
toadvanceAll()
. -
Moved the scrubber to the far left of the track (by subtracting 155.8 from all the x-values).
11/30/11
-
Gave the new controls
record
methods. -
Made the new controls a little bigger for easier use on touch screens.
11/28/11
- Added new
Character
instances:slider
,scrubber
,back
andforward
. These draw controls on the stage, though they're not active yet.
11/27/11
-
Made a
Character
instance calledtrack
, drawing a track on the canvas. -
Added a condition to
play()
andstepThrough()
that prevents them from being fired before the previous animation is finished running. -
Gave
animate()
arunning
property. -
Added
emptyCache()
to theCharacter
prototype and the helperemptyAllCaches()
. These clear thecache
array of saved coordinates inside eachCharacter
's sequence. -
Gave each
Character
aqueue_index
property that stores theCharacter
's index position withina_queue
.
11/25/11
-
Combined new_polevault.js and polevault.js into one file named polevault.js. Got rid of obsolete comments. Commented out the tests.
-
vaulter
is an instance ofCharacter
. -
Commented out the triggers in polevault.html
11/22/11
- Added
recordBezierCurveTo()
.
11/21/11
-
Added a condition to
Character.advanceCels()
to resetcurrent_cel
andcurrent_iteration
to 0 when thebreakpoints
array rolls over. -
Added another call to
Character.advanceCels()
fromanimate()
11/20/11
-
Created a
setFinalBreakpoint
function to programatically set the last breakpoint to the last frame in the animation. The user (the developer) doesn't have to do this manually. -
Added a condition to
animate()
to exit whencurrent_frame
is equal to or greater thantotal_frames
.
11/12/11
-
Moved
updateCels()
into theCharacter
prototype. -
Added an
advanceCels()
method to theCharacter
prototype. -
Changed
drawFrame()
to expect an argument: an array ofCharacter
s. All these measures are designed to replace theanim_queue
object I was using before, which added an extra step to the animation looping. -
Added a
setFrameTotal()
method.
11/11/11
-
Put 5 new members in the
breakpoints
array to test it out. -
Added
advanceBreakpoint()
to incrementcurrentBreakpoint
. -
Made
play()
andstepThrough()
functions that set different breakpoints before runninganimate()
.
11/10/11
-
Renamed
ftha()
toupdateCels()
. RenamedCharACTer()
toCharacter()
. The internal capitlization was designed to help avoid namespace collisions, but really, it was annoying. I'll keep it out of the global space or wrap it or something. -
Modified the last
if
test in updateCels to comparecurrent_cel
tocels.length
. -
Added a condition to
renderCharacter()
to check whether it's been passed an function. If not, it renders the last cel in the sequence. -
CharACTer.create()
isn't necessary. I removed it. -
CharACTer
's methods have been moved into a prototype. Don't see why each instance needs its own unique copy. -
animate()
once again incrementscurrent_frame
on every draw. It's clear there needs to be a master count of which frame we're on. -
ftha
doesn't resetcurrent_cel
when aCharACTer
leavesanim_queue
. This leaves theCharACTer
at its last position on the stage while others continue to move.
11/9/11
-
CharACTer
gets acreate()
method for instantiation. -
The
sequence
object in everyCharACTer
now has astarting_frame
member. This tellsftha
the frame on which to start animating theCharActer
. -
breakpoints
is now an array, usingcurrent_bp
to identify the index of the current breakpoint.
11/8/11 - Updates go back to May, but alas, the log starts here. The plan is to be way more atomic from now on.
The files polevault.js, new_polevault.js, polevault.html and pv_cels.js all include code for running canvas animations. This will become a subset of bigwheel.js, but I'm testing it here. The project isn't complete, but these are all working. The highlights:
-
The
CharACTers
constructor, for creating objects that keep their own distinct drawing rules. A CharACTer represents an autonomous object on the stage and might be thought of as a cel in traditional animation. -
ftha
(function that handles advancement) which updates the drawing instructions for every CharACTer on every redraw. I'll come up with a better name. -
recordMoveTo
,recordLineTo
,recordStrokeRect
, andrecordFillRect
, which create paths and cache the results of the coordinates passed to them. This is designed to make it easier to do math on the coordinates between redraws. More of these recorder functions to come.