GeezerVison is showing github.com — added test for collision position override · onaluf/gameQuery@d28d5f5
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: tests/human/collision/test1.html +11-2Lines changed: 11 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 10 | 10 | var blue = new $.gameQuery.Animation({imageURL: "blue.png", | 11 | 11 | type: $.gameQuery.ANIMATION_HORIZONTAL}); | 12 | 12 |
| 13 | | - $("#playground").playground({height: 640, width: 350}); | | 13 | + $("#playground").playground({height: 450, width: 350}); | 14 | 14 |
| 15 | 15 | // no group, no translation, no transformation | 16 | 16 | $.playground() | | 54 | 54 | .addSprite("b7",{animation: red, width: 30, height: 30, posx: 30, posy: 315}); | 55 | 55 | $("#b7").scale(1.5); | 56 | 56 |
| | 57 | + // no group, no translation, override | | 58 | + $.playground() | | 59 | + .addSprite("a8",{animation: red, width: 30, height: 30, posx: 0, posy: 370}) | | 60 | + .addSprite("b8",{animation: red, width: 30, height: 30, posx: 40, posy: 385}); | | 61 | + | 57 | 62 |
| 58 | 63 | // now we try to turn every b* sprites blue | 59 | 64 | $("#a1").collision().each(function() { | | 84 | 89 | $(this).setAnimation(blue); | 85 | 90 | }); | 86 | 91 |
| | 92 | + $("#a8").collision({x: 35}).each(function() { | | 93 | + $(this).setAnimation(blue); | | 94 | + }); | | 95 | + | 87 | 96 | $.playground().startGame(); | 88 | 97 | }); | 89 | 98 | </script> | 90 | 99 | </head> | 91 | 100 | <body> | 92 | 101 | <h2>Each line shoud contains a blue square in front of a red one:</h2> | 93 | | - <div id="playground" style="width: 350px; height: 50px; background: white"></div> | | 102 | + <div id="playground" style="width: 350px; height: 450px; background: white"></div> | 94 | 103 | </body> | 95 | 104 | </html> |
Collapse file Copy file name to clipboardExpand all lines: tests/human/index.html +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 6 | 6 | <iframe src="./transformation/test2.html" width="100%" height="200px" frameborder="0"></iframe> | 7 | 7 | <iframe src="./tiles/test1.html" width="100%" height="200px" frameborder="0"></iframe> | 8 | 8 | <iframe src="./tiles/test2.html" width="100%" height="200px" frameborder="0"></iframe> | 9 | | - <iframe src="./collision/test1.html" width="100%" height="400px" frameborder="0"></iframe> | | 9 | + <iframe src="./collision/test1.html" width="100%" height="500px" frameborder="0"></iframe> | 10 | 10 | </body> | 11 | 11 | </html> |
|