Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Bait = new Class({
- Extends : LibCanvas.Interfaces.Drawable,
- radius : 15,
- color : '#f0f',
- initialize : function () {
- this.bind('libcanvasSet', function (){
- this.shape = new LibCanvas.Shapes.Circle({
- center : this.createPosition(),
- radius : this.radius
- });
- });
- },
- createPosition : function () {
- return this.libcanvas.ctx
- // получаем элемент LibCanvas.Shapes.Rectangle размерами равный нашему холсту
- .getFullRectangle()
- // Берем из него случайную точку
- .getRandomPoint();
- },
- draw : function () {
- this.libcanvas.ctx.fill(this.shape, this.color);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement