Fix for left/right sprite rotation startup

This commit is contained in:
Joshua Litt 2014-06-01 17:01:48 -07:00
parent b3a1a3fb81
commit a4e0c88bb0

View file

@ -35,8 +35,12 @@ var Sprite = function(data) {
this.scale = data.scale || 1.0;
this.direction = data.direction || 90;
this.rotation = (data.direction - 90) || 0;
this.rotationStyle = data.rotationStyle || 'normal';
if (this.rotationStyle === 'normal' && data.direction !== undefined) {
this.rotation = data.direction - 90;
} else {
this.rotation = 0;
}
this.isFlipped = data.direction < 0 && data.rotationStyle == 'leftRight';
this.costumes = data.costumes || [];
this.currentCostumeIndex = data.currentCostumeIndex || 0;