Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/artbit/super-mario-sky
Creates a scrolling Super Mario inspired sky scape.
https://github.com/artbit/super-mario-sky
demo javascript mario spritesheet
Last synced: about 1 month ago
JSON representation
Creates a scrolling Super Mario inspired sky scape.
- Host: GitHub
- URL: https://github.com/artbit/super-mario-sky
- Owner: ArtBIT
- License: mit
- Created: 2012-06-22T14:48:59.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2017-02-22T13:25:08.000Z (over 7 years ago)
- Last Synced: 2023-03-24T14:34:12.971Z (over 1 year ago)
- Topics: demo, javascript, mario, spritesheet
- Language: JavaScript
- Size: 39.1 KB
- Stars: 8
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Super-Mario-Sky
===============
![Super Mario Sky](images/super_mario_sky.png)Super Mario Sky is a simple jQuery plugin that allows you to easily create simple parallax scrolling clouds from old Super Mario Brothers games.
# Demo
[Click Here](http://artbit.github.io/super-mario-sky/) to see a live demo.# Example Usage
Create a simple html block with set width and height:
And populate it with several layers of Mario clouds:
jQuery(function(){
jQuery('.screen')
.sprite_layer({num_sprites: 5, xspeed: -10})
.sprite_layer({num_sprites: 5, xspeed: -20})
.sprite_layer({num_sprites: 2, xspeed: -30})
});
See the [index.html](http://github.com/ArtBIT/super-mario-sky/blob/master/index.html) file for an example with multiple sprite classes.
# Options
```sprite_layer``` method accepts the following options:
* **num_sprites** - the number of sprites to generate on the layer
* **xspeed** - horizontal speed of the layer (in pixels per second)
* **yspeed** - vertical speed of the layer (in pixels per second)
* **sprite_class** - css class to apply to the sprite html element
* **opacity** - layer opacity