It’s great to see all of the wonderful things that the Hype community is generating. By chance has anyone tried to tackle a positive reinforcement mechanism utilizing physics elements? For instance, a pinball machine that has elements that send data to a tabulation script of some sort so points can be displayed? I would love to see any examples or methods to accomplish this, thanks in advance!
any responses as counting the collisions of elements (of any shape) with applied physics within can not be solved satisfiable with some utstanding js-collision-detect-library because there’s no event to catch for a element moving. that said MutationObserver records changes in the dom, so you can record the dom-changes of a element. This returns a record which gives you the ability to detect collisions, but you would have to write the collision-detection-code yourself as js-collision-detect-libraries will work with live-calls …
So, any hype-solution using the underlying physicsmachine, which surely offers collissions-response, would be great!
Just give us the abilty to grab the collision-event within the hype-js-api
Well said, Hans. Also, I haven't seen any js libraries that can detect collisions without a dragged element. GameQuery is a jQuery plug in that may work, but it is too complicated, for me, to set up.
We'll definitely look into this post 3.0; it is an astonishingly popular request.
Your method of using the MutationObservers is pretty clever, just do note that it might be the transform or the top/left properties changing, and I believe the mutation api is only available new browsers. Also from an official standpoint we don't support this, so the technique may not work against future versions.
Oh well, thought i figured it out but I can’t seem to get it to work. I saw the script looked for class names ‘buffer’ to use observe and count/compare differences. And that the buffers individually had been itemized. So i tried to copy & paste, call the elements by the IDs and adjust the number of buffers in the class. Somehow I must have done something wrong, will keep trying. (pssst… Dave, learn some Java man!..) I’m much better at the visual artsNewYearsCardAlt.zip (3.9 MB) than talking in alien languages
[Error] ReferenceError: Can't find variable: jQuery
global code (e-smart-hittest-jquery.min.js, line 13)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (touch-icon-192x192.png, line 0)
[Error] TypeError: undefined is not a function (evaluating '$('#observe-' + observerID ).objectHitTest({"object":$('#buffer' + i), "transparency":true})')
observerChanges (undefined, line 38)
So it looks like ya missed something somehow (maybe ;-))
Look to see if you missed one of the '#' on one of the #buffer or #observe calls in the script.