Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

working both x and y

  • Loading branch information...
commit e0bce2e957cb5e61a7321d01d45bf75e32930cbf 1 parent fc84b5d
@seanhess authored
Showing with 7 additions and 2 deletions.
  1. +6 −1 public/directives/sprite.ts
  2. +1 −1  public/partials/game.html
View
7 public/directives/sprite.ts
@@ -79,6 +79,11 @@ angular.module('directives')
if (frame >= TOTAL_FRAMES) stopWalking()
}
- scope.$watch(attrs.spriteWalking, startWalking)
+ scope.$watch(attrs.spriteWalking + ".x", startWalking)
+ scope.$watch(attrs.spriteWalking + ".y", startWalking)
}
})
+
+
+// TODO more generic form you can use for missiles, or the explosion, etc
+// just some way to kick off a Y-based animation when a property changes?
View
2  public/partials/game.html
@@ -34,7 +34,7 @@ <h1 class="winner" ng-show="players.winner">{{players.winner.name}} Wins!</h1>
ng-repeat="player in players.all | filter:{state:'alive'}"
ng-style="player | position"
sprite-direction="player.direction"
- sprite-walking="player.x"
+ sprite-walking="player"
>
<!--sprite-walking="player.x + player.y"-->
Please sign in to comment.
Something went wrong with that request. Please try again.