Skip to content

IchigoJam/PixelJam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PixelJam.js

PixelJam.js は、コンパクトなJS用ミニゲームライブラリです

sample

<script type="module">
import { pj } from "https://js.sabae.cc/pj.js";

for (let i = 0;; i++) {
  pj.cls(i % 16);
  pj.text(i, 10, 10);
  await pj.wait(10);
}
</script>

reference

functions

  • cls(color = 0) // 画面クリア
  • pset(x, y, color = 7) // 点描画
  • rectfill(x0, y0, w, h, color = 7) // 矩形描画
  • line(x0, y0, x1, y1, color = 7) // 線描画
  • colorrcfill(cx, cy, r, color = 7) // 円描画
  • text(s, x, y, color = 7) // 文字描画
  • stamp(hex_or_n, x, y, w = 8, transparentColor = 0) // スタンプ描画 0-Fで色指定するHEXまたはPanCakeのスプライト番号
  • btn(n = 4) // ボタンが押下チェック 0..6 = ←→↑↓ space Z X
  • await wait(nframe = 1) // nframe分(1/60秒)だけ待つ ※ await を付けて呼び出す!

color number

  • 0:黒、1:白、2:赤、3:ピンク、4:橙、5:黄、6:薄茶、7:茶、8:薄緑、9:緑、10:薄青、11:青、12:紺、13:青紫、14:赤紫、15:灰 (from CC BY PanCake)

Releases

No releases published

Packages

No packages published