Last 12 weeks · 0 commits
1 of 6 standards met
Ok, I added support for selector containment, easily used like the following. You can see it illustrated in the default example of my fork. The cat box is bordered by 1px solid red. move('#cat') .add('left', Math.random() \ 30 | 0) .add('top', Math.random() \ 30 | 0) .contain('#cat_box') .end() I also added converse property translation. The converse translation works when I do something like the following: move('#cat') .add('left', Math.random() \ 30 | 0) .add('top', Math.random() \ 30 | 0) .contain({ bottom : '+30-50' }) .end(); Basically, it'll convert the bottom containment to the appropriate top, since that's the prop that's set in the Move object. In this case, you would be contained to the 'top' equivalent of 30 to 50 px from the bottom. This code might need some cleaning up, and I'm totally open to suggestions.
I thought Move could use some containment controls, so I added a Containment class that allows one to set containment constraints (e.g. { top: '+350', left: '-200' } would contain to top-left corner of document ). These constraints are applied on Move's 'start' event. I intend to add support for containment through an object selector string, as well. I love this library! Thanks so much, and I will let you know what prototypes I cut in the near future. An illustrator friend of mine and I are thinking about story-boarding something very soon. ~Ryan
Repository: tj/game-prototypes. Description: JavaScript & CSS3 game prototypes Stars: 74, Forks: 8. Primary language: JavaScript. Languages: JavaScript (100%). Homepage: http://visionmedia.github.com/game-prototypes/ Open PRs: 1, open issues: 0. Last activity: 13y ago. Community health: 28%. Top contributors: tj.