1 decade ago by paulh
Noob questions, i know :-(
when is it right to use:
ig.game.extend.
ig.class.extend
ig.entity.extend
I basically haven't used class extend at all ... and have used ig.game.extend... and i cant tell you why though really.
My thoughts are:
Regardless if its a seperate .js then they have to be included in the requires of main.js.
that you could just define a class as say var Person = ig.Class.extend and save that as person.js.... does that mean you can access anything in the class at anytime .. i dont really get it from the documentation.
Entities i get ( i think) i spawn one when i need one and kill it when im done with it .. but is that the same with classes is everything loaded at the start? So if i had a var pauls.name in a class is that held in memory at all times and i can call it or does a class have to be "spawned" like an entity ..
Lasty ig.game.extend im not sure why i used that .. i wanted to get me main game logic out of main.js so it wouldn't get too cluttered when i add all the permutations for the different device etc .. was that a bad idea? Im thinking that ig.game.extend is like loading totally new subset of the game, so when i gointo say menu mode .. i could have a menu = ig.game.extend and then options, the same and then a different game.extend for each of the different game modes.. AM I INSANE/HAVE NO IDEA WHAT IM TALKING ABOUT/ALMOST GETTING IT/WILL NEVER UNDERSTAND.
Thanks for your time and patience!
when is it right to use:
ig.game.extend.
ig.class.extend
ig.entity.extend
I basically haven't used class extend at all ... and have used ig.game.extend... and i cant tell you why though really.
My thoughts are:
Regardless if its a seperate .js then they have to be included in the requires of main.js.
that you could just define a class as say var Person = ig.Class.extend and save that as person.js.... does that mean you can access anything in the class at anytime .. i dont really get it from the documentation.
Entities i get ( i think) i spawn one when i need one and kill it when im done with it .. but is that the same with classes is everything loaded at the start? So if i had a var pauls.name in a class is that held in memory at all times and i can call it or does a class have to be "spawned" like an entity ..
Lasty ig.game.extend im not sure why i used that .. i wanted to get me main game logic out of main.js so it wouldn't get too cluttered when i add all the permutations for the different device etc .. was that a bad idea? Im thinking that ig.game.extend is like loading totally new subset of the game, so when i gointo say menu mode .. i could have a menu = ig.game.extend and then options, the same and then a different game.extend for each of the different game modes.. AM I INSANE/HAVE NO IDEA WHAT IM TALKING ABOUT/ALMOST GETTING IT/WILL NEVER UNDERSTAND.
Thanks for your time and patience!