Re: I simply do not understand this bug

1) Lets say you have a module that does something. For right now lets just say it's a simple math module and it contains one function:
function sum(a,b)
return a+b
endfunction
You'd have a math_tests module as well, and you would have functions that would test the sum function to see if you're getting what you want out of it. You'll need to create some utility functions especially for BGT, but it'd look something like this (again pseudo code):
function sum_tests()
test_that(sum(1,1), 2)
test_that(sum(0,0), 0)
test_that(sum(-1,1), 0)
endfunction

Your code should not be harder to read if you break it up. Methods should have one purpose and do that well. If you're putting multiple points in your functions they should and can be broken down. If that makes them harder to understand or read, consider adopting a naming convention which allows your code to be easier to read.
While I understand that this is easier said than done, you could have checks like IsTunnel, isSolid, etc which can do some of your checking for you and which you would call from your movement logic.

As to point 3, that was more of a joke. I did want to point out that BGT has many shortcomings, many of which are performance and lack of any sane development paradigms and tools. Most languages have many many tools written for you which you can make great use of, this includes a good system for unit tests. Unit tests are in the most basic form what I shoed you, but you'll end up wanting mach objects, etc and that's something you'd have to do. Basically you're going to have to reinvent the wheel.

_______________________________________________
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : severestormsteve1 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : sorressean via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : sorressean via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector

Reply via email to