tetris

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tetris [2009/10/16 21:35]
aspectscript
tetris [2009/10/26 17:35] (current)
aspectscript
Line 1: Line 1:
 ====== Tetris Game ====== ====== Tetris Game ======
  
-At the left it is the [[http://www.gosu.pl/tetris/|original tetris]] game. +This is a demonstration of how the overhead introduced by AspectScript in an interactive application is negligible. Please try the game and let us know if you feel any noticeable difference! 
-At the right it is the instrumented version, with an aspect deployed this way:+ 
 +On the left it is the [[http://www.gosu.pl/tetris/|original tetris]] game, unmodified
 +On the right it is the instrumented version, with one global aspect deployed this way (the pointcut matches all the join points it sees and the advice just proceeds):
  
 <code java> <code java>
-var pointcut = function(){ +var pointcut = function(){ return true; }; 
-  return true; +var advice   = function(jp) { return jp.proceed(); };
-}; +
-var advice   = function(jp) { +
- return jp.proceed(); +
-};+
 AspectScript.around(pointcut, advice); AspectScript.around(pointcut, advice);
 </code> </code>
  
-At the bottom of the page you can observe the number of join points the aspect has seen (and matched).+The counter below the game frames shows the number of jp seen by the aspect.
  
 <html> <html>
-    <iframe src="/aspectscript/external/tetris/tetris.html" width="350" height="400"></iframe> &nbsp;&nbsp;+    <iframe src="/aspectscript/external/tetris/tetris.html" width="350" height="400"></iframe> &nbsp;
     <iframe src="/aspectscript/external/tetris/tetris-t.html" width="350" height="400" name="tetrisFrame"></iframe>     <iframe src="/aspectscript/external/tetris/tetris-t.html" width="350" height="400" name="tetrisFrame"></iframe>
 </html> </html>
  
 <html> <html>
-<div style="text-align: center; font-size: 20pt"><span id="jpCounter" style="font-size: 20pt">0</span> join points matched so far!</div>+<div style="text-align: center; font-size: 20pt"><span id="jpCounter" style="font-size: 20pt">0</span> join points matched so far! <a href="#" onClick="tetrisFrame.nJPs = 0; return false;">[reset]</a></div>
          
 <script type="text/javascript"> <script type="text/javascript">
Line 33: Line 31:
   }, 1000);   }, 1000);
 </script> </script>
 +
 </html> </html>
  • tetris.1255728931.txt.gz
  • Last modified: 2009/10/16 21:35
  • by aspectscript