Okay, it just hit me, it should have been this.drawName(); so it was a Syntax error on my part, problem is no tutorial I read said how to use a method/function, only how to define it.
-------------------------
Just started out with JS and am a bit uncertain why the following code works, but my attempt at changing and modularising it lead to some problems. First the original:
I wanted to change it so that all my sprites are added in their own sub-methods, or in this case functions:
-------------------------
Just started out with JS and am a bit uncertain why the following code works, but my attempt at changing and modularising it lead to some problems. First the original:
I wanted to change it so that all my sprites are added in their own sub-methods, or in this case functions:
Appearently this._bg is undefined in the new function, so what am I doing wrong? Is it a simple Syntax error or have I missed something deeper? (I am most familiar with Ruby where this kind of thing should have worked)