Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
  6.  
  7.     <meta name="apple-mobile-web-app-capable" content="yes">
  8.     <meta name="mobile-web-app-capable" content="yes">
  9.  
  10.     <title>FlappyJS</title>
  11.  
  12.     <script src="sprite.js"></script>
  13.  
  14.     <style>
  15.     canvas {
  16.         display: block;
  17.         position: absolute;
  18.         margin: auto;
  19.         top: 0;
  20.         bottom: 0;
  21.         left: 0;
  22.         right: 0;
  23.     }
  24.     </style>
  25. </head>
  26. <body>
  27. <noscript>
  28. <p>For full functionality of this page it is necessary to enable JavaScript.
  29. Here are the <a href="http://www.enable-javascript.com/" target="_blank">
  30. instructions how to enable JavaScript in your web browser</a>.</p>
  31. </noscript>
  32. <script type="text/javascript" src="sprite.js"></script>
  33. <script>
  34.  
  35. var canvas,
  36. ctx,
  37. width,
  38. height,
  39.  
  40. frames = 0,
  41. score = 0,
  42. best = 0,
  43.  
  44. currentstate,
  45. states = {
  46.  
  47.     Splash:0 , Game: 1 ,Score:2
  48. },
  49.  
  50. bird = {},
  51. pipes = {};
  52.  
  53. function main(){
  54.  
  55.     canvas      = document.createElement("canvas");
  56.     width       = window.innerWidth;
  57.     heigth      = window.innerHeight;  
  58.  
  59.  
  60.         if (width >= 500) {
  61.             width  = 320;
  62.             heigth = 480;
  63.             canvas.style.border = "1px solid #000";
  64.         }
  65.  
  66.         canvas.width    = width;
  67.         canvas.height   = height;
  68.         ctx = canvas.getContext("2d");
  69.  
  70.         document.body.appendChild(canvas);
  71.  
  72.        
  73.  
  74. }
  75.  
  76. function run(){
  77.  
  78. }
  79. function update(){
  80.  
  81. }
  82. function render(){
  83.  
  84.  
  85. }
  86.  
  87. main();
  88.  
  89. </script>
  90. </body>
  91. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement