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
Animatorclass 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. TheTimelineconstructor now expects anAnimatorinstance as its first argument. -
Moved
playthrough_countintoTimeline. -
Adapted
Timeline.storeInFrames()to store thexdistanceandydistanceof every cel. -
Rounded all
xdistanceandydistancecalculations to two decimal places.
12/15/11
-
Added
xlimitandylimitmembers to thescrubbersequence 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, andSlidercalls two different sequences on each draw.
12/14/11
-
Finished making the
Sliderclass and combined the previoussliderandscrubberinto a new instance of it.Sliderinherits fromCharacter-- it borrows its prototype. -
Adapted
renderCharacter()to sniff outSliderinstances 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 everyCharacterinstance on every frame in the animation. -
Moved
current_frame,current_bpandbreakpointsinsideTimeline. Scrapped these andfpsfromstage's scope. Everything works.
12/12/11
-
Added a constructor and prototype for a
Timelineclass.Timelinestores history and methods for every frame in the animation.frame_total,current_frame, thebreakpointsarray,current_breakpointandfpsare moving into this class. -
Timeline.init()is now working, though I was wrong about how theframesarray should store members. I'm revising this function. -
Added
Character.countSpan()to store the total number of cels aCharacterputs on the timeline. Having this number handy makes it easier to do some of the mathTimeline.init()needs. -
Switched
pitandpitforegroundto theCharacterdrawing 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 aCharacterand setcurrent_seqto zero when it's finished. -
Updated
Character.setSequenceOrder()to automatically resetstarting_framefor any sequence following the first one. This letssetFrameTotalkeep 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_frames 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
sequenceOrderproperty and asetSequenceOrder()method to theCharacterprototype. These store and alter the calling order of drawing instructions for aCharacter's sequences. -
Modified
setFrameTotal()to work with these new values. -
Added a
runupsequence tovaulter: a loopable series of strides to showthe vaulter approaching the pit. -
Moved
sequenceOrderout of theCharacterprototype and into its constructor, fixing the mistake I just introduced. -
sequenceOrderis now calledsequence_orderto stick with the naming convention for variables. -
Updated
Character.advance()to cycle through sequences. -
Fixed a bad assignment in
Character.advance()that incrementedcurrent_seqtoo 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.cacheis 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
recordmethods into theCharacterprototype. 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 regularCRCmethods. 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
Scrubberclass that inherits fromCharacter. -
Added
xdistance,ydistance,xincandyincmembers to each sequence inCharacter. These are meant to remember x and y increments and total distances from the axes as aCharactermoves 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 theCharacterprototype. -
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
recordmethods. -
Made the new controls a little bigger for easier use on touch screens.
11/28/11
- Added new
Characterinstances:slider,scrubber,backandforward. These draw controls on the stage, though they're not active yet.
11/27/11
-
Made a
Characterinstance 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()arunningproperty. -
Added
emptyCache()to theCharacterprototype and the helperemptyAllCaches(). These clear thecachearray of saved coordinates inside eachCharacter's sequence. -
Gave each
Characteraqueue_indexproperty 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.
-
vaulteris 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_celandcurrent_iterationto 0 when thebreakpointsarray rolls over. -
Added another call to
Character.advanceCels()fromanimate()
11/20/11
-
Created a
setFinalBreakpointfunction 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_frameis equal to or greater thantotal_frames.
11/12/11
-
Moved
updateCels()into theCharacterprototype. -
Added an
advanceCels()method to theCharacterprototype. -
Changed
drawFrame()to expect an argument: an array ofCharacters. All these measures are designed to replace theanim_queueobject 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
breakpointsarray 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
iftest in updateCels to comparecurrent_celtocels.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_frameon every draw. It's clear there needs to be a master count of which frame we're on. -
fthadoesn't resetcurrent_celwhen aCharACTerleavesanim_queue. This leaves theCharACTerat its last position on the stage while others continue to move.
11/9/11
-
CharACTergets acreate()method for instantiation. -
The
sequenceobject in everyCharACTernow has astarting_framemember. This tellsfthathe frame on which to start animating theCharActer. -
breakpointsis now an array, usingcurrent_bpto 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
CharACTersconstructor, 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.