Re: Can any one please help me with this bullet class, python?

A couple of possibilities:

Firstly, you should probably use constants or an enum for directions, so you can't mistype, and therefore skip the if statements concerning directions. If you're not going to do that, at least do:

if direction == "right:
    # Whatever.
elif direction == "left":
    # Whatever.
else:
    raise NotImplementedError(f"Direction {direction} is invalid.")

The other thing, is your penultimate line. I'm wondering, if you're using >= to check the x coordinate, will that still work if your bullet is moving down the x coordinate, as in to the left?

HTH,



-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ogomez92 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ogomez92 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : redfox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : titan_of_war via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector

Reply via email to