HTML5 functions not working in external js class file
var Player1 = new character;
When I attempt to call the function with "Player1.Logic();" or "Logic();"
I get an error: "Uncaught TypeError: Object # has no method 'Logic'"
Here is my character.js class file:
(function(window){
function character(){
}
function Logic(){
console.log("new character loaded!");
}
window.character = character;
}(window));
Should I be declaring the function differently or calling it differently?
Everything else seems to work fine except for this. The only luck that
I've had so far is with declaring functions with event handlers.
No comments:
Post a Comment