Line
BlitzPlus Forums/BlitzPlus Beginners Area/Line
| ||
I've been told over and over again not to have the line command in the main game loop, but if I'm making a game similar to WireHang, can it be avoided? |
| ||
There is nothing wrong with using the Line command in the main game loop. Many games do. The alternative is to use a line of writepixelfasts, but this will not be faster. |
| ||
I've been told over and over again not to have the line command in the main game loop, Who told you that? and why? |
| ||
If you are doing straight vertical or horizontal lines use rect instead, it's quicker. |
| ||
Everyone says, "To improve game speed, don't use Print, Text, Line, Write, etc. in the game loop." |
| ||
For 2D games there is nothing wrong with any of those. Altho I would avoid Print (cos its crap). "Everyone" are probably refering to 3D games, where you should avoid mixing 2D commands with 3D cos its slows things down. On the whole tho there are many games where speed isn't much of an issue. |
| ||
The Rect command (which is useful for orthogonal lines) is 70% faster than the Line command. Other than that, theres no problem using the Line command. As stated, just don't mix 2D (Line) with 3D as many graphics cards can't handle it well. |
| ||
"orthogonal" now there's a good word. |
| ||
I should have used it on my English midterm today! Thanks, guys. |
| ||
Hint: LockBuffer does speed up also the line command many times! Of course you must then proof that the coordinates aren't out of range. regards D2006 |
| ||
or face an access violation, not good. But bounds checking is pretty damn easy. |
| ||
sounds good |