LoginSignup
0
0

More than 3 years have passed since last update.

対戦オセロwebapi その2

Posted at

概要

対戦オセロwebapiを作ってみる。
石を使ってみる。
ライブラリーは、jquery,tatenoを使う。

写真

image.png

サンプルコード

var chara = "https://camo.qiitausercontent.com/7873b55118f9bac84a20de35c02770aac1d1f02a/68747470733a2f2f71696974612d696d6167652d73746f72652e73332e61702d6e6f727468656173742d312e616d617a6f6e6177732e636f6d2f302f31383130342f33656230653537342d643430362d326537342d663238312d3561663132396130353834362e706e67";
window.onload = function() {
    game = new Game();
    game.preload(chara);
    game.fps(30);
    game.start();
    var j = 0;
    var isi = new Sprite(40, 40, chara, 3, 1);
    function main() {
        setTimeout(function() {
            j++;
            isi.frame(j);
            if (j > 2)
            {
                j = 0
            }
            main();
        }, 800);
    }
    main();
}

成果物

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0