I'm trying to instantiate a class like this :
var drawCrash = new DrawCrash;
But I'm getting a TypeError: object is not a function.
I've defined the class like this -
var DrawCrash = {
//Private variables
canvas : ge1doot.Canvas(),
particles: "",
nbrParticles : 160,
speed : 6,
strength : .4,
radius : 4,
perspective : 0.5,
ang : null,
CosOrSin1 : null,
CosOrSin2 : null,
enum : {
Wobble : "wobble",
Twirl : "twirl"
},
setDrawing : function (type) {
if (type === this.enum.Twirl){
Blah blah blah
this.cosOrSin2 = Math.sin;
} else if (type === this.enun.Wobble){
Blah blah blah
} else {alert("Wrong enum for DrawCrash");}
},
startDrawing : function () {
blah blah blah
}
}
Is there something wrong with this syntax?