Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="mobile-web-app-capable" content="yes">
- <title>FlappyJS</title>
- <script src="sprite.js"></script>
- <style>
- canvas {
- display: block;
- position: absolute;
- margin: auto;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- }
- </style>
- </head>
- <body>
- <noscript>
- <p>For full functionality of this page it is necessary to enable JavaScript.
- Here are the <a href="http://www.enable-javascript.com/" target="_blank">
- instructions how to enable JavaScript in your web browser</a>.</p>
- </noscript>
- <script type="text/javascript" src="sprite.js"></script>
- <script>
- var canvas,
- ctx,
- width,
- height,
- frames = 0,
- score = 0,
- best = 0,
- currentstate,
- states = {
- Splash:0 , Game: 1 ,Score:2
- },
- bird = {},
- pipes = {};
- function main(){
- canvas = document.createElement("canvas");
- width = window.innerWidth;
- heigth = window.innerHeight;
- if (width >= 500) {
- width = 320;
- heigth = 480;
- canvas.style.border = "1px solid #000";
- }
- canvas.width = width;
- canvas.height = height;
- ctx = canvas.getContext("2d");
- document.body.appendChild(canvas);
- }
- function run(){
- }
- function update(){
- }
- function render(){
- }
- main();
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement