CMPX2021.BAS - GW-BASIC, 2021 refactor: optimized version of CMPLXM40.BAS
I wanted to refactor the code and optimize away the unused array indexes, so there is no time wasted checking if they are active or not. I also toyed with the colors to make it look nicer. I removed the middle pixel PSET during forward path, and only draw in in reverse. I made another LUT for middle pixel jumps (length 1 not 2). There is more that could be done, such as removing the REM statements, combining more statements into one line, and removing the need for G-10 if I simply used 1,2,3,4 as the path direction colors. Also, there's likely no need to randomly check for making a new path on each iteration; during back tracing, any such made paths almost always terminate without any work to do.
My playlists:
--------------------
- Voxel: https://youtu.be/watch?v=XCVWEuhCCDM&list=PLjnbT4UISq0bQF1g85tE9jTrKfEtdRYlY
- Road: https://youtu.be/watch?v=ck5ALX11YU4&list=PLjnbT4UISq0bnfd1RC3M4PgTgkmhlkikV
- Ray Casting 3D: https://youtu.be/watch?v=zjswXUTMP2o&list=PLjnbT4UISq0YcFtRFjFQqK0g6ONNCtrvY
- Side-Scroll Shmup: https://youtu.be/watch?v=fF4X8zN-Raw&list=PLjnbT4UISq0Y_7IAN_zUzxgZnfhXxo_0Q
- MonoGame Tutorial: https://youtube.com/watch?v=WW1dJnfXWb0&list=PLjnbT4UISq0adw__Y9B2eXA0LL35TyORU
My websites:
---------------------
- my GitHub: https://github.com/JDoucette
- my company: http://xona.com
- my Blog: http://thefirstpixel.com