|
| 1 | +<!DOCTYPE HTML> |
| 2 | +<html> |
| 3 | + <head> |
| 4 | + <script src="../../../tests/lib/jquery.min.js"></script> |
| 5 | + <script type="text/javascript" src="../../../crafty.js"></script> |
| 6 | + </head> |
| 7 | + <body> |
| 8 | + <h1>Collision playground:</h1> |
| 9 | + <div id="cr-stage" style="border: solid black 8px;"></div> |
| 10 | + <script type="text/javascript" src="collision.js"></script> |
| 11 | + <div> |
| 12 | + <h4>Hit checks (these are written to the console):</h4> |
| 13 | + <style>th,td{border: solid 1px; padding: 4px; text-align: center }</style> |
| 14 | + <table style="border-spacing: 0"> |
| 15 | + <tr> |
| 16 | + <th></th> |
| 17 | + <th>Trapezoid</th> |
| 18 | + <th>Parallelogram</th> |
| 19 | + <th>Square (Yellow)</th> |
| 20 | + <th>Square (Purple)</th> |
| 21 | + <th>Square (Green)</th> |
| 22 | + </tr> |
| 23 | + <tr> |
| 24 | + <th>Trapezoid</th> |
| 25 | + <td></td> |
| 26 | + <td><input type='checkbox' onclick="setHitEvents(this.checked, trapezoid, 'Parallelogram');"></input></td> |
| 27 | + <td><input type='checkbox' onclick="setHitEvents(this.checked, trapezoid, 'Yellow');"></input></td> |
| 28 | + <td><input type='checkbox' onclick="setHitEvents(this.checked, trapezoid, 'Purple');"></input></td> |
| 29 | + <td><input type='checkbox' onclick="setHitEvents(this.checked, trapezoid, 'Green');"></input></td> |
| 30 | + <td><button onclick="trapezoid.resetHitChecks();">Reset check</button></td> |
| 31 | + </tr> |
| 32 | + <tr> |
| 33 | + <th>Parallelogram</th> |
| 34 | + <td><input type='checkbox' onclick="setHitEvents(this.checked, parallelogram, 'Trapezoid');"></input></td> |
| 35 | + <td></td> |
| 36 | + <td><input type='checkbox' onclick="setHitEvents(this.checked, parallelogram, 'Yellow');"></input></td> |
| 37 | + <td><input type='checkbox' onclick="setHitEvents(this.checked, parallelogram, 'Purple');"></input></td> |
| 38 | + <td><input type='checkbox' onclick="setHitEvents(this.checked, parallelogram, 'Green');"></input></td> |
| 39 | + <td><button onclick="parallelogram.resetHitChecks();">Reset check</button></td> |
| 40 | + </tr> |
| 41 | + <tr> |
| 42 | + <th>Square (Yellow)</th> |
| 43 | + <td><input type='checkbox' onclick="setHitEvents(this.checked, yellow, 'Trapezoid');"></input></td> |
| 44 | + <td><input type='checkbox' onclick="setHitEvents(this.checked, yellow, 'Parallelogram');"></input></td> |
| 45 | + <td></td> |
| 46 | + <td><input type='checkbox' onclick="setHitEvents(this.checked, yellow, 'Purple');"></input></td> |
| 47 | + <td><input type='checkbox' onclick="setHitEvents(this.checked, yellow, 'Green');"></input></td> |
| 48 | + <td><button onclick="yellow.resetHitChecks();">Reset check</button></td> |
| 49 | + </tr> |
| 50 | + <tr> |
| 51 | + <th>Square (Purple)</th> |
| 52 | + <td><input type='checkbox' onclick="setHitEvents(this.checked, purple, 'Trapezoid');"></input></td> |
| 53 | + <td><input type='checkbox' onclick="setHitEvents(this.checked, purple, 'Parallelogram');"></input></td> |
| 54 | + <td><input type='checkbox' onclick="setHitEvents(this.checked, purple, 'Yellow');"></input></td> |
| 55 | + <td></td> |
| 56 | + <td><input type='checkbox' onclick="setHitEvents(this.checked, purple, 'Green');"></input></td> |
| 57 | + <td><button onclick="purple.resetHitChecks();">Reset check</button></td> |
| 58 | + </tr> |
| 59 | + <tr> |
| 60 | + <th>Square (Green)</th> |
| 61 | + <td><input type='checkbox' onclick="setHitEvents(this.checked, green, 'Trapezoid');"></input></td> |
| 62 | + <td><input type='checkbox' onclick="setHitEvents(this.checked, green, 'Parallelogram');"></input></td> |
| 63 | + <td><input type='checkbox' onclick="setHitEvents(this.checked, green, 'Yellow');"></input></td> |
| 64 | + <td><input type='checkbox' onclick="setHitEvents(this.checked, green, 'Purple');"></input></td> |
| 65 | + <td></td> |
| 66 | + <td><button onclick="green.resetHitChecks();">Reset check</button></td> |
| 67 | + </tr> |
| 68 | + </table> |
| 69 | + </div> |
| 70 | + </body> |
| 71 | +</html> |
0 commit comments