-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New gulp tesk and increased test coverage
- Loading branch information
Showing
3 changed files
with
39 additions
and
9 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
describe("engine/Collision", function() { | ||
var el = document.createElement("div"); | ||
el.id = 'stage'; | ||
document.body.appendChild(el); | ||
|
||
var collision = new App.engine.Collision(); | ||
|
||
it("should return same position when the target position is blocked", function() { | ||
var fromX = 5; | ||
var fromY = 5; | ||
var toX = 10; | ||
var toY = 10; | ||
var radius = 0.35; | ||
var miniMap = { mapHeight: 8, mapWidth: 8 }; | ||
var screen = {}; | ||
|
||
var newPosition = collision.checkCollision(fromX, fromY, toX, toY, radius, miniMap, screen); | ||
|
||
expect(newPosition.x).toEqual(fromX); | ||
}); | ||
|
||
}); |