Hello.
I have a question concerning Fields in user-types.
Disclaimer: I've wrote this message countless times because my english is not that good and i might not have formulated things exactly how i meant them so dont be afraid to ask questions if this makes no sens.
I'm currently working on the framework i will want to use to develop all my games.
I like to keep each Type in a different file, unless its simply a structure (A Type without Functions or Methods)
So i have these types nested this way:
Gfx_Engin
Gfx_Sprite
Gfx_Image
Gfx_Animation
In my Gfx_Animation object i have all the fields and method i need for an animation (Current Frame, TimeToNextFrame, Start(), Play(), Stop() and stuff like that).
So i can instanciated an animation object and use it.
Also, my animations are not simple frame 1 to x. Each animation has an array of frames (each frame telling me what gfx frame to use, how long to show it, and possible F/Xs).
We'll call that Animation_Sequence
So since i dont want to create all the frames each time i assign a new animation to a game object, i want to store all the Animation_Sequences types in an array. Thats where i figured creating a Global Sequences():Animation_Sequences in my Gfx_Animation type would be a good idea.
I hope your following me because i have trouble myself ;)
So now, i have an include of my gfx_animation in my gfx_sprite type, and in my gfx_engin type.
If i add a new sequence from my Gfx_Sprite type, will it be visible from my Gfx_Engin type (and vice versa)? Does the include command creates an instance of the class for each include or does every file in the project be able to access the globals? What is the scope? Are Globals accessible only to all the modules that included the type?
I have a question concerning Fields in user-types.
Disclaimer: I've wrote this message countless times because my english is not that good and i might not have formulated things exactly how i meant them so dont be afraid to ask questions if this makes no sens.
I'm currently working on the framework i will want to use to develop all my games.
I like to keep each Type in a different file, unless its simply a structure (A Type without Functions or Methods)
So i have these types nested this way:
Gfx_Engin
Gfx_Sprite
Gfx_Image
Gfx_Animation
In my Gfx_Animation object i have all the fields and method i need for an animation (Current Frame, TimeToNextFrame, Start(), Play(), Stop() and stuff like that).
So i can instanciated an animation object and use it.
Also, my animations are not simple frame 1 to x. Each animation has an array of frames (each frame telling me what gfx frame to use, how long to show it, and possible F/Xs).
We'll call that Animation_Sequence
So since i dont want to create all the frames each time i assign a new animation to a game object, i want to store all the Animation_Sequences types in an array. Thats where i figured creating a Global Sequences():Animation_Sequences in my Gfx_Animation type would be a good idea.
I hope your following me because i have trouble myself ;)
So now, i have an include of my gfx_animation in my gfx_sprite type, and in my gfx_engin type.
If i add a new sequence from my Gfx_Sprite type, will it be visible from my Gfx_Engin type (and vice versa)? Does the include command creates an instance of the class for each include or does every file in the project be able to access the globals? What is the scope? Are Globals accessible only to all the modules that included the type?