Hi,
I try this configuration,
// define a modulevar Vulnerable = {
wound: function(hp) {
this.health -= hp;
alert(this.health);
if (this.health < 0) this.kill();
},
kill: function() {
this.dead = true;
}
};
var Display = {
clear: function() {
....
}
};
// the first argument isn't a class object, so there is no inheritance ...//
simply mix in all the arguments as methods:var Person =
Class.create(Vulnerable, Display {
initialize: function() {
this.health = 100;
this.dead = false;
}
});
But this.healt is undefined.
Is it possible to do that ?
Thank
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/prototype-scriptaculous/-/afNhmNi1eIAJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.