Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. <html>
  2. <head>
  3. <meta charset="utf-8">
  4. <title>UNITAROjs</title>
  5. <meta name="viewport" content="width=device-width,user-scalable=no" />
  6. <style>
  7. body{
  8. margin: 0px;
  9. padding: 0px;
  10. }
  11. </style>
  12. <script src="js/unitaro.js"></script>
  13. </head>
  14. <body>
  15. <script>
  16.  
  17. var PLAYER={
  18. w:20,
  19. h:20,
  20. color:'red', // ←③ 別な色を指定してみよう
  21. init:function(x,y){
  22. this.x=x;
  23. this.y=y;
  24. this.tx=x;
  25. this.ty=y;
  26. },
  27. update:function(){
  28. // ←② 1秒に20回呼ばれる処理を書きます
  29. },
  30. };
  31.  
  32. var APP = {
  33. WIDTH: 320,
  34. HEIGHT: 500,
  35. init: function(){
  36. this.player=new unitaro.Task(PLAYER,100,100); // ←① PLAYERタスクの出現位置を指定する
  37. },
  38. update: function(age){
  39. unitaro.dib.box(0,0,this.WIDTH,this.HEIGHT,"rgb(40,40,40)");
  40. unitaro.dib.textout(50,20,"minimum sample","yellow",100);
  41. },
  42. onclick: function(x,y){
  43. }
  44. };
  45.  
  46. window.addEventListener('load',function(){
  47. window.app = new unitaro.App(APP);
  48. },false);
  49.  
  50. </script>
  51. </body>
  52. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement