Hello, I have an unusual question.
Is it possible to change dynamically comparison operators in if statements? I created an algorithm for a Tetris-like game. And created few methods for detecting collisions between blocks and borders of the board. Each method for every direction. Next I tried to merge them in one, and I almost did that, but in few places, I need to dynamically change comparison operator, like this:
ActionScript Code: _actualBlock.actualPosition[i1][a] + _blockYPosition > temp[i2][a] + _blockYPosition
To that:
ActionScript Code: _actualBlock.actualPosition[i1][a] + _blockYPosition < temp[i2][a] + _blockYPosition
If it is not possible, anyone knows any workarounds for these situations?
Regards.
Comparison operator as variable?
Saturday, June 2, 2012
[Action Script] Comparison operator as variable? June,2012
Posted by Bimo Hery Prabowo at 11:13 AM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment