No worries! Javascript class hierarchies are something I still struggle with. Mostly, I tend to ignore them I find. I have a strongly typed classical class background, so JS has been a bit tough to learn. What you probably want is to define an object that has the properties and functions you want, then use Object.create(<base_object_instance>) to created derived versions that you then change to be the traps you want. However, it might still be better to ignore the problem of having them derive from some base object, and make an object with all the default properties then use _.defaults(newobj,defobj) to fill them in: var defobj = {
fired: false,
page: Campaign().get('playerpageid'),
xP1: 0,
yP1: 0,
xP2: 70,
yP2: 70,
fireEvent: function(){}
};
// [...]
var newTrap = _.defaults({fireEvent(){ log('fired!');}}, defobj); Something like that... Anyway, feel free to ping me if you want to chat about it!