Fixed a few things in Circle and added the Point object.

This commit is contained in:
Richard Davey
2013-08-28 15:58:37 +01:00
parent 0f58945212
commit 89fe2855e4
4 changed files with 429 additions and 8 deletions
+44
View File
@@ -0,0 +1,44 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a(nother) new beginning</title>
<script src="../src/Phaser.js"></script>
<script src="../src/system/Device.js"></script>
<script src="../src/core/SignalBinding.js"></script>
<script src="../src/core/Signal.js"></script>
<script src="../src/math/RandomDataGenerator.js"></script>
<script src="../src/math/Math.js"></script>
<script src="../src/geom/Point.js"></script>
<script src="../src/geom/Circle.js"></script>
<script src="../src/net/Net.js"></script>
<script src="../src/time/Time.js"></script>
<script src="../src/animation/Animation.js"></script>
<script src="../src/animation/Frame.js"></script>
<script src="../src/animation/FrameData.js"></script>
<script src="../src/animation/Parser.js"></script>
<script src="../src/loader/Cache.js"></script>
<script src="../src/loader/Loader.js"></script>
<script src="../src/Game.js"></script>
</head>
<body>
<script type="text/javascript">
var game = new Phaser.Game(this, '', 800, 600);
var a = new Phaser.Point(100, 100);
var b = new Phaser.Point(200, 100);
console.log('Point A', a.toString());
console.log('Point B', b.toString());
a.add(b.x, b.y);
console.log('Point A + B', a.toString());
console.log('Distance between A and B', Phaser.Point.distance(a, b));
</script>
</body>
</html>
+9 -7
View File
@@ -8,6 +8,7 @@
<script src="../src/core/Signal.js"></script>
<script src="../src/math/RandomDataGenerator.js"></script>
<script src="../src/math/Math.js"></script>
<script src="../src/geom/Point.js"></script>
<script src="../src/geom/Circle.js"></script>
<script src="../src/net/Net.js"></script>
<script src="../src/time/Time.js"></script>
@@ -25,16 +26,17 @@
var game = new Phaser.Game(this, '', 800, 600);
var data = Phaser.Math.sinCosGenerator(10);
var a = new Phaser.Point(100, 100);
var b = new Phaser.Point(200, 100);
console.log('Sin', data.sin);
console.log('Cos', data.cos);
console.log('Point A', a.toString());
console.log('Point B', b.toString());
console.log('Shift value 1', Phaser.Math.shift(data.sin));
console.log('Shift value 2', Phaser.Math.shift(data.sin));
console.log('Shift value 3', Phaser.Math.shift(data.sin));
a.add(b.x, b.y);
console.log('Sin', data.sin);
console.log('Point A + B', a.toString());
console.log('Distance between A and B', Phaser.Point.distance(a, b));
</script>