• jamie_
    anyone around that i can ponder with a question?
  • mbrubeck
    jamie_: go for it
  • jamie_
    so right now im playing with some 3d rendering, right now the code im working with is pastebin.mozilla.org/9019332 now im trying to get lines 4-13 to work (obviously does not as camera.position.y is a local var to the render loop) any ideas on how to directly modify the value of camera.position.y? the event listener needs to be outside of the loop but the function it needs cannot be local so also has to be outside of the loop
  • jamie_
    which makes it challenging to modify, now if i assign say var x = camera.postion.y yes... it does pull it but it does not push it back into camera.position.y
  • jamie_
  • jamie_
    thats correct... the other one has a slight diff but not what im working with
  • mbrubeck
    Why does this have `====` instead of `=` on line 9?
  • jamie_
    not sure... probably me being half asleep last night XD
  • jamie_
    ignore lol
  • mbrubeck
    as far as I can tell it should work if you change it to `=`
  • jamie_
    oh... thought it would not be able to modify a local var...
  • jamie_
    camera.postion.y is local to the renderloop
  • mbrubeck
    functions in JavaScript are closures - they can access variables from the scope where the function is defined.
  • jamie_
    hrm... works thanks... sometimes my brain forgets how to work...
  • jamie_
    other than for some odd reason every key is outputing charcode 0...
  • jamie_
    ill just use keycode..
  • mbrubeck
    jamie_: I think charcode is only set during "keypress" events, not "keydown"
  • mbrubeck
    JS key events are kind of a mess :)
  • jamie_
    yeah i know....
  • jamie_
    its easier to do 3d rendering than deal with keyboard events...
  • mbrubeck
    ha
  • jamie_
    sad part is mbrubeck that i just built all that and now i realize i need to use a different physics engine... because gravity is overkill and unrealisitic on this one...
  • jamie_
    firebot: pewpew
  • » firebot Firebots been hit! BOT DOWN BOT DOWN!
  • jamie_
    whelp i guess that is an escapade for a different day... gotta go get ready for work, thanks for helping me with fixing my brainfart