- Remove any
console.log
calls in update loops - Remove
Crafty.c("BG")
inComponents.js
- Not needed, background already in
Game.load:game.js
- Not needed, background already in
- Remove the
$("#currentDistance")
inCrafty.c("Fish").update
:components.js
- This is not even in use anymore - could remove from reset as well
- Remove the
$("#currentAltitude")
block inCrafty.c("Fish").update
:components.js
- This is not even in use anymore - could remove from reset as well
- Remove the
$("#currentSkips")
block inCrafty.c("Fish").update
:components.js
- This is not even in use anymore - could remove from reset as well
- Remove the
Crafty.c("Killer Fish")
EnterFrame
update
bind because it is empty - Cache dom nodes used in
update
loops
I think there is a memory leak in the original latest code because the heap grows over time. With my modifications (more than listed here), it was a stable saw-tooth pattern.
I am not sure of the extent of the performance improvements as it runs a stable 60 fps when idle. when running a YouTube video just to dumb down the CPU a bit, playing produces variable fps measurements in both the original and modified.