 angular.module('sharkAttackApp', []).controller('SharkAttackCtrl', ['$scope', ($scope) ->
 
   # Game balance variables
-  $scope.fastSharkChance = 0.3
-  $scope.sharksPerSecond = 3.0
+  $scope.fastSharkChance = 0.2
+  $scope.sharksPerSecond = 2.0
   $scope.raftHitPoints = 3
 
   $scope.width = 400

  timestamp = -> window.performance.now()
else
  timestamp = -> (new Date()).getTime()

class Entity
  constructor: (@x, @y, @velocityX, @velocityY) ->

  $scope.frame = ->
    $scope.$apply ->
      now = timestamp()
      # Prevent too many frames occurring at once if user tabs away
      $scope.dt += Math.min(1, (now-$scope.last)/1000)
      while $scope.dt>$scope.step
        $scope.dt -= $scope.step
        $scope.update()
