Could be a useful thread
Quote: "2. Try and declare all your variables that you use throughout your project also at the beginning of the main.agc before any nitty gritty coding is made
eg,
Global
Dim
Arrays [ ]
Types"
Dim is a legacy declaration, you shouldn't use this anymore.
Quote: "4. Try to avoid "load" and "create's" functions within main game loops
eg,
CreateSprite..........
LoadSound........"
I agree with trying to avoid
loading of assets. However
creating sprites, sound instances etc should not be an issue. This is simply wrapping existing assets into a small packet of data.
Quote: "5. Try to avoid Loops within loops within loops - eg using of re-cursive FOR loops."
This is a good tip to be wary of, but not something that has to be avoided. You need to be aware of the implications. That is, an outer loop of 5 iterations with an inner loop of 5 iterations is 25 executions of the inner code.
But there are scenarios that require this. If I have 6 characters with 6 attributes then I need a nested loop to process all 36 attributes.
Technically this isn't recursion. Recursion is where a function calls itself.
I look forward to more tips that can be discussed and fine-tuned to help newcomers. It would be good to maintain the definitive list in your first post.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt