Last active
December 17, 2015 04:59
-
-
Save hyzhak/5554410 to your computer and use it in GitHub Desktop.
Usage of ngCyclic module of darlingjs for simulate cyclic bacgrounds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var w = darlingjs.w('theCyclicWorld', ['ngCyclic']); | |
//add systems for implement cyclic behaviour | |
world.$add('ng2DCyclicLayer'); | |
world.$add('ngMarkIfOutsideOfTheViewPortVertical2D'); | |
world.$add('ngMarkIfOutsideOfTheViewPortHorizontal2D'); | |
world.$add('ngMarkIfInsideOfTheViewPortVertical2D'); | |
world.$add('ngMarkIfInsideOfTheViewPortHorizontal2D'); | |
//add entity | |
world.$e('theEntity', { | |
ng2D: { | |
x: 10.0, | |
y: 10.0 | |
}, | |
ngCyclic: { | |
patternWidth: 1000, | |
patternHeight: 1000 | |
} | |
}); | |
//start simulation | |
world.$start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment