Re: is there a better way to do this? (bgt)

Is there a better way of doing this?
Yes. Most of the time there are way better solutions out there. In your case, it would be wise to create a player class and store the values pertaining to the player in there. It would also have been a smart idea to create a move function, still in the player class, to minimize the amount of code repetition.
The key point here is that you are biting off way more than you could chew. You are not comfortable with the idea of classes, which means that your code is going to spiral into a mess of global variables. This will eventually lead to hard to track bugs in your functions because they will modify some obscure global that is off somewhere in the dark corner of your code. I don't blame you for doing this. I dare say that all of BGT open source projects end up in that state.
I am not going to refactor your code, mostly because that would require a bit more time than I currently have. My advice here is to take on smaller projects. Work through the tutorial games first.

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Gaki_shonen via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : bgt lover via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Gaki_shonen via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : bgt lover via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Gaki_shonen via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Gaki_shonen via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : JayJay via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Gaki_shonen via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : pool via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : JayJay via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Gaki_shonen via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Gaki_shonen via Audiogames-reflector

Reply via email to