1 decade ago by mimik
Hello
I have found my self writing alot of functions and logic, in my game class file
and it usually gets bloated fast.
my main.js isen't as scaled down as it juste do be,
So I'm Asking if you guys got some good tips for making my main file less blotade with perhaps external files.
Like one file for a save function and one for load.
But also to also to add functionality into my game class
Draw function
Update function
and init function.
I found myself not knowing how to do this.
Can i make a external file and add code to does areas in a easy way?
How do i do it?
Do I creat a continue to
MyGame = ig.Game.extend function or do you got some tips or example how to think about this?
I can have some game logic in the entites ofc but i want to have a good structure with one file for example save.js function
one for draw ui functions etc.
I have found my self writing alot of functions and logic, in my game class file
and it usually gets bloated fast.
my main.js isen't as scaled down as it juste do be,
So I'm Asking if you guys got some good tips for making my main file less blotade with perhaps external files.
Like one file for a save function and one for load.
But also to also to add functionality into my game class
Draw function
Update function
and init function.
I found myself not knowing how to do this.
Can i make a external file and add code to does areas in a easy way?
How do i do it?
Do I creat a continue to
MyGame = ig.Game.extend function or do you got some tips or example how to think about this?
I can have some game logic in the entites ofc but i want to have a good structure with one file for example save.js function
one for draw ui functions etc.