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