Long Source Codes

BlitzPlus Forums/BlitzPlus Beginners Area/Long Source Codes

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

In the example above 'While cont=True' could be shortened to 'While cont' as the True test is implicit. It may compile the same either way, though.

The Ifs would probably be faster if implemented as a select case statement. The speed difference may not be worth the trouble, though:-

eg.
Select p
    Case 1
        pic1()
    Case 2
        pic2()
    Case 3
        pic3()
    Case 4
        pic4()
    Case 5
        pic5()
    Case 6
        pic6()
End Select


And within each level functions are the general functions that control the mouse, interface, game elements, etc.


I gather you mean that you're calling the code for these functions from inside your level function and not that you're implementing the code inside each function? Duplicating common functionality isn't efficient.

The approach you're using may make it difficult to add to your program in future, and may result in a lot of redundant code. In the long term, you will probably want to take a more data driven approach.

For your first few games, your main priority should be in getting a finished and working product out the door, whether it is freeware or commercial. These first games will be a learning experience. Over time, you will learn what you need to know to code more efficiently.