Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* Updated emitter tutorial

* Fixing some documentation
  • Loading branch information...
commit 2b9041cd08f123b94f2382007ea9a646aa42b4fd 1 parent ed521b7
@bfattori authored
View
8 build.properties
@@ -1,9 +1,9 @@
## Numeric version of the engine (used in filename)
-app.version=2.0.0.10
+app.version=2.0.0.11
## Text version of the engine (used in docs)
-build.version=v2.0.0.10 beta
-build.date=7/20/2011
+build.version=v2.0.0.11 beta
+build.date=8/14/2011
## Compressor options
compress.option=engine.compile
@@ -11,7 +11,7 @@ compiler.jvm=C:/Program Files (x86)/Java/jdk1.6.0_20/bin/java
## DEMOS TO COPY ##
#demo.set=potris/**,smb/**,spaceroids/**,wii_test/**
-demo.set=empty/**,htmlcontext/**,isometric/**,physics/**,physics2/**,textrender/**,tilemap/**,ui/**,vector/**
+demo.set=empty/**,htmlcontext/**,isometric/**,physics/**,physics2/**,tilemap/**,vector/**
## TOOLS TO COPY ##
#tool.set=support/**,font_editor/**
View
6 engine/baseobject.js
@@ -167,7 +167,7 @@ R.engine.BaseObject = function(){
},
/**
- * Add an event handler to this object, as long as it has an associated HTML element. Within the
+ * Add an event handler to this object. Within the
* event handler, <tt>this</tt> refers to the object upon which the event is being triggered. It is
* possible to bind an event simply by calling <tt>addEvent</tt> with the type and callback, like
* so:
@@ -248,10 +248,10 @@ R.engine.BaseObject = function(){
* <pre>
* // Shorthand
* this.addEvents({
- * "keydown": function(which) {
+ * "keydown": function(evt, which) {
* this.onKeyDown(which);
* },
- * "keyup": function(which) {
+ * "keyup": function(evt, which) {
* this.onKeyUp(which);
* }
* });
View
2  engine/build/engine.intro.js
@@ -84,7 +84,7 @@ R._unsupported = function(method, clazz) {
throw new Error(method + " is unsupported in " + clazz.getClassName());
};
-/** private **/
+/** @private **/
R.str = Object.prototype.toString;
/**
View
14 engine/particles/emitter.js
@@ -40,13 +40,25 @@ R.Engine.define({
});
/**
- * @class Particle emitter class. A particle emitter emits particles at a regular
+ * @class Particle emitter class. Emits particles at a regular
* interval as long as it is active. The function that is passed to generate
* the particles will be called with three arguments: an offset position, the
* current world time, and the delta from when the last frame was drawn. The function
* can either return a single particle or an <code>Array</code> of particles.
* Within the scope of the function, "this" refers to the {@link R.particles.Emitter}
* object.
+ * <pre>
+ * // Create the particle emitter which returns the type of particle
+ * // we want to emit. 5 is the delay between particle emissions and
+ * // 350 is the life of the particle (both in milliseconds)
+ * var emitter = R.particles.Emitter.create(function(offset) {
+ * // Create a particle
+ * return FuseParticle.create(offset, 350);
+ * }, 5);
+ *
+ * // Assign the emitter to the particle engine which will draw it
+ * emitter.setParticleEngine(Tutorial13.pEngine);
+ * </pre>
*
* @param emitFunc {Function} A function that emits new particles.
* @param interval {Number} The time between emissions
View
7 tutorials/tutorial13/bomb.js
@@ -70,10 +70,13 @@ var Bomb = function() {
// Create the particle emitter which returns the type of particle
// we want to emit. 5 is the delay between particle emissions and
// 350 is the life of the particle (both in milliseconds). An emitter
- // only emits one particle per cycle.
+ // can emit multiple particles at a time by returning an array of
+ // particles.
var emitter = R.particles.Emitter.create(function(offset) {
// Create a particle
- return FuseParticle.create(offset, 350);
+ return [FuseParticle.create(offset, 350),
+ FuseParticle.create(offset, 500),
+ FuseParticle.create(offset, 180)];
}, 5);
// Assign the emitter to the particle engine which will draw it
Please sign in to comment.
Something went wrong with that request. Please try again.