Thứ Ba, 25 tháng 3, 2014

Các file cần thiết

Bài viết sẽ hướng dẫn dùng frame tạo game HTML5 trên web trước. Để sử dụng frame thì cần có các file như tạo 1 ứng dụng HTML5 thông thường:

File index.html
<!DOCTYPE HTML>
<html>
   <head>
    <style>
   body {
    margin: 0;
    padding: 0;
   }
   canvas {
    margin: 0;
    padding: 0;
    position: absolute;
   }
  </style>
     <title>Preview</title>
     <meta charset="utf-8" />
     <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
     <script type="text/javascript" charset="utf-8" src = "js/bkgm.js"></script>
  <script type="text/javascript" charset="utf-8" src = "js/states.js?v=1"></script>
        <script type="text/javascript" charset="utf-8" src = "js/actor.js?v=1"></script>
  <script type="text/javascript" charset="utf-8" src = "js/main.js?v=1"></script>
 </head>
   <body>
   </body>
</html>
Trong đó thì file bkgm.js, states.js và actor.js là các file của thư viện BKGM, file main là file chúng ta dùng để code. Ngoài những file trên, ta có thể thêm thư viện dùng kể kết nối fb là fbconnect.js, và phải thêm dòng
<script src="//connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript" charset="utf-8" src = "js/fbconnect.js?v=1"></script>
để load thư viện

Không có nhận xét nào:

Đăng nhận xét