topical media & game development

talk show tell print

mobile-query-game-tests-human-tiles-test1.htm / htm



  <html>
      <head>
          <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
          <script src="../../../jquery.gamequery.js"></script>
          <script>
              $(function(){
                  var multiAnimation = new .gameQuery.Animation({imageURL: "m.png", 
                                                                  type: .gameQuery.ANIMATION_HORIZONTAL | .gameQuery.ANIMATION_MULTI, 
                                                                  numberOfFrame: 3, 
                                                                  delta: 10, 
                                                                  distance: 10,
                                                                  rate: 300});
                                                                  
                 var multiAnimationPingpong = new .gameQuery.Animation({imageURL: "m.png", 
                                                                  type: .gameQuery.ANIMATION_HORIZONTAL | .gameQuery.ANIMATION_MULTI | .gameQuery.ANIMATION_PINGPONG, 
                                                                  numberOfFrame: 3, 
                                                                  delta: 10, 
                                                                  distance: 10,
                                                                  rate: 300});
                  var animations = [];
                  animations[0] = new .gameQuery.Animation({imageURL: "s1.png", 
                                                                  type: .gameQuery.ANIMATION_HORIZONTAL, 
                                                                  numberOfFrame: 3, 
                                                                  delta: 10,
                                                                  rate: 300});
                  animations[1] = new .gameQuery.Animation({imageURL: "s2.png", 
                                                                  type: .gameQuery.ANIMATION_HORIZONTAL, 
                                                                  numberOfFrame: 3, 
                                                                  delta: 10,
                                                                  rate: 300});
                  animations[2] = new .gameQuery.Animation({imageURL: "s3.png", 
                                                                  type: .gameQuery.ANIMATION_HORIZONTAL, 
                                                                  numberOfFrame: 3, 
                                                                  delta: 10,
                                                                  rate: 300});
                  
                  var animationsPingpong = [];
                  animationsPingpong[0] = new .gameQuery.Animation({imageURL: "s1.png", 
                                                                  type: .gameQuery.ANIMATION_HORIZONTAL | .gameQuery.ANIMATION_PINGPONG, 
                                                                  numberOfFrame: 3, 
                                                                  delta: 10,
                                                                  rate: 300});
                  animationsPingpong[1] = new .gameQuery.Animation({imageURL: "s2.png", 
                                                                  type: .gameQuery.ANIMATION_HORIZONTAL | .gameQuery.ANIMATION_PINGPONG, 
                                                                  numberOfFrame: 3, 
                                                                  delta: 10,
                                                                  rate: 300});
                  animationsPingpong[2] = new .gameQuery.Animation({imageURL: "s3.png", 
                                                                  type: .gameQuery.ANIMATION_HORIZONTAL | .gameQuery.ANIMATION_PINGPONG, 
                                                                  numberOfFrame: 3, 
                                                                  delta: 10,
                                                                  rate: 300});
                  
                  var tileDef = [[1,2,3],[2,3,1],[3,1,2]];
                  var tileFun = function(i,j){return 1+(i+j)%3;};
                  $("#playground").playground({height: 64, width: 350});
                  
                  .playground()
                      .addTilemap("multiArray",    tileDef, multiAnimation, {width: 10, height: 10, sizex: 3, sizey: 3, posx: 0}).end()
                      .addTilemap("multiFunction", tileFun, multiAnimation, {width: 10, height: 10, sizex: 3, sizey: 3, posx: 40}).end()
                      .addTilemap("arrayArray",    tileDef, animations,     {width: 10, height: 10, sizex: 3, sizey: 3, posx: 80}).end()
                      .addTilemap("arrayFunction", tileFun, animations,     {width: 10, height: 10, sizex: 3, sizey: 3, posx: 120}).end()
                      .addTilemap("multiArrayPingpong", tileDef, multiAnimationPingpong, {width: 10, height: 10, sizex: 3, sizey: 3, posx: 160}).end()
                                          .addTilemap("arrayArrayPingpong", tileDef, animationsPingpong,     {width: 10, height: 10, sizex: 3, sizey: 3, posx: 200}).end()
                                          .addGroup("testGroup", {height: 30, width: 30, posx: -40}).addTilemap("outside",    tileDef, multiAnimation, {width: 10, height: 10, sizex: 3, sizey: 3, posx: 0});
                  $("#testGroup").x(240);
                  .playground().startGame();
              });
          </script>
      </head>
      <body>
          <h2>The four first tiles should be the same and the fith and sixth should be out of phase and the last one like the first:</h2>
          <div id="playground" style="width: 350px; height: 50px; background: white"></div>
      </body>
  </html>


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.