Hi all,
I'm working on a very simple project, trying to get the hang of BM. One thing I'm really struggling with is the use of local variables.
Say I want to gently fade in the alpha from 0 to 1 via an if then loop such as:
If fade<1 Then
fade:+0.02
End If
SetAlpha fade
And this is itself within part of the main loop, where do I declare the 'fade' variable? If I declare it within the loop, it 'resets' to 0 everytime it's declared.
I can get around it via global variables, but surely this isn't the way to do it efficiently?
Cheers!
I'm working on a very simple project, trying to get the hang of BM. One thing I'm really struggling with is the use of local variables.
Say I want to gently fade in the alpha from 0 to 1 via an if then loop such as:
If fade<1 Then
fade:+0.02
End If
SetAlpha fade
And this is itself within part of the main loop, where do I declare the 'fade' variable? If I declare it within the loop, it 'resets' to 0 everytime it's declared.
I can get around it via global variables, but surely this isn't the way to do it efficiently?
Cheers!