Git Product home page Git Product logo

mooncatrescue-walkcycles's Introduction

mooncatrescue-walkcycles

Based on code originally created by Ponderware

Ponderware MoonCatParser

Demo

Up, Down, Left, Right Arrow Keys to Walk Space Bar to Jump Change the MoonCat # to see a different MoonCat

Live Demo

Import Module

mooncatWalk.js

import {MoonCatWalk} from './mooncatWalk.js';

Usage

let size = 1;
let tokenId = 0;

// Generate the Sprite Sheet for the specific MoonCat
let spriteSheet = MoonCatWalk.generateMoonCatSpriteSheet(tokenId, size);

// TODO updte these as the cat moves 
let frame = 0;
let direction = 0;

let x = frame * 32;
/* columns - left to right in the sprite sheet
  0 = frame 1
  ...
  7 = frame 8
*/
let y = direction * 32;
/* rows - top to bottom in the sprite sheet
  0 = right
  1 = up
  2 = down
  3 = left
  4 = idle right
  5 = idle up
  6 = idle down
  7 = idle left
*/

// Get the dom element that will show the MoonCat walking (CSS for div https://github.com/sudoWright/mooncatrescue-walkcycles/blob/main/css/walk.css#L12-L20)
let animation = document.getElementById('animation');

// Set the Sprite Sheet offset for each of the walk cycles
animation.style.backgroundPosition = `-${x}px -${y}px`;

// Set the background image to the base64 image data sprite sheet generated above
animation.style.backgroundImage = "url('"+spriteSheet+"')";

Sprite Sheet for MoonCat TokenId=0

OpenSea MoonCat 0

0.png


License

Copyright © 2017 ponderware ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Except with the prior written authorization from ponderware ltd., any modifications made to the Software shall not be represented, promoted, or sold as the official or canonical Software or property of MoonCatRescue or ponderware ltd., and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Special thanks to 'vinny-888.github.io' for providing these walk-cycles.

MoonCat​Rescue ChainStation (https://chainstation.mooncatrescue.com/team/contribute#skills)

mooncatrescue-walkcycles's People

Contributors

sudowright avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

kelseysunhaha

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.