Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added two build.sh file to build crafty.js and doc; reformated the do…

…cument for Gravity
  • Loading branch information...
commit ece7f0065ee4f4af168254f64ef51a336d3f2a0e 1 parent c17130d
@pengyu pengyu authored
View
3  build.sh
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+
+php build.php
View
3  build/build.sh
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+
+php build.php
View
2  demos/fruitassassin/assassin.js
@@ -73,4 +73,4 @@ window.onload = function() {
}
});
-};
+};
View
14 src/2D.js
@@ -650,11 +650,15 @@ Crafty.c("Gravity", {
* @comp Gravity
* @sign public this .gravity([comp])
* @param comp - The name of a component that will stop this entity from falling
- * Enable gravity for this entity. If comp parameter is specified all entities with that component will stop this entity from falling.
+ * Enable gravity for this entity no matter whether comp parameter is not specified,
+ * If comp parameter is specified all entities with that component will stop this entity from falling.
* For a player entity in a platform game this would be a component that is added to all entities
* that the player should be able to walk on.
* ~~~
- * Crafty.e("2D, DOM, Color, Gravity").color("red").attr({ w: 100, h: 100 }).gravity("platform")
+ * Crafty.e("2D, DOM, Color, Gravity")
+ * .color("red")
+ * .attr({ w: 100, h: 100 })
+ * .gravity("platform")
* ~~~
*/
gravity: function (comp) {
@@ -672,7 +676,11 @@ Crafty.c("Gravity", {
* @param g - gravitational constant
* Set the gravitational constant to g. The default is .2. The greater g, the faster the object falls.
* ~~~
- * Crafty.e("2D, DOM, Color, Gravity").color("red").attr({ w: 100, h: 100 }).gravity("platform").gravityConst(2)
+ * Crafty.e("2D, DOM, Color, Gravity")
+ * .color("red")
+ * .attr({ w: 100, h: 100 })
+ * .gravity("platform")
+ * .gravityConst(2)
* ~~~
*/
gravityConst: function(g) {
Please sign in to comment.
Something went wrong with that request. Please try again.