git @ Cat's Eye Technologies HTML5-Gewgaws / 8720251
Simplify the superclass-super-calling jazz. Chris Pressey 10 years ago
1 changed file(s) with 3 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
4242 Floater = function(proto) {
4343 this.init = function(cfg) {
4444 // call superclass'es init() method
45 proto.init.apply(this, [cfg]);
45 Floater.prototype.init.apply(this, [cfg]);
4646 this.isClickable = true;
4747 this.counter = 0;
4848 this.rate = 0.07;
170170 };
171171
172172 this.init = function(c) {
173 //Floater.prototype = new yoob.Sprite();
174 var proto = new yoob.Sprite();
175 Floater.prototype = proto;
173 Floater.prototype = new yoob.Sprite();
176174
177175 canvas = c;
178176 ctx = canvas.getContext('2d');
184182
185183 var closeness = 5;
186184 for (var i = 1; i < 30; i++) {
187 var f = new Floater(proto);
185 var f = new Floater();
188186 var w = closeness;
189187 var x = Math.random() * (canvas.width - w * 2);
190188 var y = Math.random() * (canvas.height - w * 2);