npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

xiulike

v0.0.9

Published

``` npm install xiulike ```

Downloads

2

Readme

修丽可

游戏

安装
npm install xiulike
使用
必须开启 "enableSkia": "true"
  • json
{
    "usingComponents": {
        "game": "xiulike/xiulike"
    }
}
  • mini.project.json
{
  "node_modules_es6_whitelist": [
    "common-game"
  ]
}
  • js
Page({
  data: {
    gameSource: JSON.stringify({
      penAudioSrc: "http://isv-vod.alibabausercontent.com/RGjZJMdpNgKGVQeEyw8/qzi1JhFmjUlr04cwc9U?auth_key=1620636097-0-0-6061d706c33f9d4e079fd39c35ddb004&w=0&h=0&e=sd&t=212b054316203768970886677e334d",//喷雾音效
      baseOps: {
        speed: { min: 5, max: 15, step: 0 },//移动速度
        firstY: 200,//首次加载游戏第一个元素的底部坐标位置
        intervalStep: 1,//两个物体之间的间隔递减值
        intervalStepH: 50,//移动指定距离递减一次
        minIntervalH: 300,//两个物体之间的最小间隔距离
        maxIntervalH: 500,//两个物体之间的间隔距离
      },
      energy: [
        { src: "https://img.alicdn.com/imgextra/i1/1080040467/O1CN017gVANl1FJvdfnKqzT_!!1080040467.png", width: 131, height: 124, probability: 1, val: 20, delayTime: 1, replace: { src: "https://img.alicdn.com/imgextra/i4/1080040467/O1CN01X2sbzt1FJvdYLlujC_!!1080040467.png", width: 133, height: 124 } },
        { src: "https://img.alicdn.com/imgextra/i3/1080040467/O1CN014NSqtR1FJvdYLmzGF_!!1080040467.png", width: 117, height: 110, probability: 1, val: 20, delayTime: 1, replace: { src: "https://img.alicdn.com/imgextra/i4/1080040467/O1CN01X2sbzt1FJvdYLlujC_!!1080040467.png", width: 133, height: 124 } },
        // { src: "https://img.alicdn.com/imgextra/i4/1080040467/O1CN01X2sbzt1FJvdYLlujC_!!1080040467.png", width: 133, height: 124, probability: 1, val: 20 },
      ],
      scorePos: {
        x: 530,
        y: 78 / 2,
        align: "center",
        numOffset: 42,
        before: {
          src: "https://img.alicdn.com/imgextra/i2/1080040467/O1CN01KuuT3c1FJvdfNMEEG_!!1080040467.png", width: 65, height: 78
        },
        numArr: [
          { src: "https://img.alicdn.com/imgextra/i2/1080040467/O1CN019wNCJO1FJvdXaZS7V_!!1080040467.png", width: 65, height: 78, val: 0 },
          { src: "https://img.alicdn.com/imgextra/i2/1080040467/O1CN017EiH8T1FJvdhtn4Zs_!!1080040467.png", width: 65, height: 78, val: 1 },
          { src: "https://img.alicdn.com/imgextra/i1/1080040467/O1CN01vrS9HH1FJvdgNTjNY_!!1080040467.png", width: 65, height: 78, val: 2 },
          { src: "https://img.alicdn.com/imgextra/i4/1080040467/O1CN01C45s7P1FJvdesmYC4_!!1080040467.png", width: 65, height: 78, val: 3 },
          { src: "https://img.alicdn.com/imgextra/i3/1080040467/O1CN01eqX6WZ1FJvdZV9PhO_!!1080040467.png", width: 65, height: 78, val: 4 },
          { src: "https://img.alicdn.com/imgextra/i4/1080040467/O1CN01kKNQnJ1FJvdbxmcXr_!!1080040467.png", width: 65, height: 78, val: 5 },
          { src: "https://img.alicdn.com/imgextra/i2/1080040467/O1CN01JuLha21FJvdXaXi0J_!!1080040467.png", width: 65, height: 78, val: 6 },
          { src: "https://img.alicdn.com/imgextra/i1/1080040467/O1CN01hSKboZ1FJvdcxLgan_!!1080040467.png", width: 65, height: 78, val: 7 },
          { src: "https://img.alicdn.com/imgextra/i3/1080040467/O1CN01kak39m1FJvde6A8x8_!!1080040467.png", width: 65, height: 78, val: 8 },
          { src: "https://img.alicdn.com/imgextra/i4/1080040467/O1CN01oTshkz1FJvdgNTGFg_!!1080040467.png", width: 65, height: 78, val: 9 },
        ]
      },
      spray: {
        x: 236,
        y: 78 / 2,
        align: "center",
        totalNum: 100,//总能量
        singleNum: 5,//每次喷雾消耗的能量
        numOffset: 42,
        tail: {
          src: "https://img.alicdn.com/imgextra/i1/1080040467/O1CN01dMeNMI1FJvdfNOJ9O_!!1080040467.png", width: 65, height: 78
        },
        numArr: [
          { src: "https://img.alicdn.com/imgextra/i2/1080040467/O1CN019wNCJO1FJvdXaZS7V_!!1080040467.png", width: 65, height: 78, val: 0 },
          { src: "https://img.alicdn.com/imgextra/i2/1080040467/O1CN017EiH8T1FJvdhtn4Zs_!!1080040467.png", width: 65, height: 78, val: 1 },
          { src: "https://img.alicdn.com/imgextra/i1/1080040467/O1CN01vrS9HH1FJvdgNTjNY_!!1080040467.png", width: 65, height: 78, val: 2 },
          { src: "https://img.alicdn.com/imgextra/i4/1080040467/O1CN01C45s7P1FJvdesmYC4_!!1080040467.png", width: 65, height: 78, val: 3 },
          { src: "https://img.alicdn.com/imgextra/i3/1080040467/O1CN01eqX6WZ1FJvdZV9PhO_!!1080040467.png", width: 65, height: 78, val: 4 },
          { src: "https://img.alicdn.com/imgextra/i4/1080040467/O1CN01kKNQnJ1FJvdbxmcXr_!!1080040467.png", width: 65, height: 78, val: 5 },
          { src: "https://img.alicdn.com/imgextra/i2/1080040467/O1CN01JuLha21FJvdXaXi0J_!!1080040467.png", width: 65, height: 78, val: 6 },
          { src: "https://img.alicdn.com/imgextra/i1/1080040467/O1CN01hSKboZ1FJvdcxLgan_!!1080040467.png", width: 65, height: 78, val: 7 },
          { src: "https://img.alicdn.com/imgextra/i3/1080040467/O1CN01kak39m1FJvde6A8x8_!!1080040467.png", width: 65, height: 78, val: 8 },
          { src: "https://img.alicdn.com/imgextra/i4/1080040467/O1CN01oTshkz1FJvdgNTGFg_!!1080040467.png", width: 65, height: 78, val: 9 },
        ],
        bg: {
          showPos: {
            width: 200,
            height: 80,
            x: 136,
            y: 0
          },
          def: { src: "https://img.alicdn.com/imgextra/i3/1080040467/O1CN01cIa8L41FJvdfbH2VI_!!1080040467.png", width: 200, height: 80 },
          active: { src: "https://img.alicdn.com/imgextra/i3/1080040467/O1CN01nEV2PZ1FJvddAuThZ_!!1080040467.png", width: 200, height: 80 },
        }
      },
      player: {
        src: "https://img.alicdn.com/imgextra/i3/1080040467/O1CN01HikdDK1FJvdXa8fK1_!!1080040467.png",
        moveY: false,
        width: 87,
        height: 396,
        autoOps: {
          // 自动移动设置参数
          speed: 5
        },
      },
      penwu: {
        width: 179,
        height: 421,
        boomSpeed: 0.2,
        anchor: { x: 0.5, y: 1 },
        bound: {
          left: 48,
          top: 88,
          right: 48,
          bottom: 0
        },
        srcArr: [
          { src: "https://img.alicdn.com/imgextra/i4/1080040467/O1CN01krwP7Q1FJvdhAzWR6_!!1080040467.png", width: 179, height: 421 },
          { src: "https://img.alicdn.com/imgextra/i3/1080040467/O1CN01HHHSFu1FJvdZ2Bttj_!!1080040467.png", width: 179, height: 421 },
          { src: "https://img.alicdn.com/imgextra/i3/1080040467/O1CN01L7FWJv1FJvdZbep2l_!!1080040467.png", width: 179, height: 421 },
          { src: "https://img.alicdn.com/imgextra/i4/1080040467/O1CN01FP0JiE1FJvdcnJHWU_!!1080040467.png", width: 179, height: 421 },
        ]
      },
      triggerType: "drag",//click:点击瓶子触发喷雾 drag:拖动瓶子放开时触发喷雾 不传递则不触发,需手动调用send触发
    }),
  },
  onLoad(query) {
  },

  playFun() {
    this.gameComponent.onEvent("start");
  },
  resetFun() {
    this.gameComponent.onEvent("reset");
  },
  sendFun() {
    // 手动触发游戏
    this.gameComponent.onEvent("send");
  },

  onRef(game) {
    this.gameComponent = game;
    console.log("进入游戏")
  },
  onInitDone() {
    // my.alert({
    //   content: "游戏初始化完成"
    // })
    // this.playFun();
  },
  onUpdate(ops) {
    // { totalScore: 0, imgObj: { } }
    console.log(ops)
  },
  onGameOver({ totalScore }) {
    console.log(totalScore)
  }
})
  • xaml
  <game gameSource="{{gameSource}}" 
    onRef="onRef"
    onInitDone="onInitDone" 
    onUpdate="onUpdate" 
    onGameOver="onGameOver"
    />