Re: Another question again, still Python, yea?

The last solution you provided is more close to the one i'm using right now in one of my projects. Each level has a list of conditions which decide upon something happens, e.g. winning or losing conditions. If one of my winning conditions returns True whenever their check() method is called, that means that the condition "succeeded". If a winning condition succeeds, you've obviously won, if a losing condition succeeds, you've lost. That way you can add in multiple winning/losing conditions and just need to loop over them at certain times and call their check() methods to see if you've already won/lost.
I also added in some string representation to those conditions. That way i'm able to either tell the player what they must do in order to win or tell the player why they actually lost. I guess you can think about more useful things to be added to such classes later on.
Best Regards.
Hijacker

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/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 : magurp244 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector

Reply via email to