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

ashley, You need to check the absolute value of bx if you're going to go with your own way of handling bullets. Why? Because if the player is facing left, the x value, as already specified, decreases. Your bullets are not disappearing at all because you have "if bx is greater than max x then disappear" If the player is facing left, and the max x is 40, it means this bullet has a range of 41(be ause you used > not >=). Therefore it is supposed to go until -41 x and then disappear but it doesn't because in your code it is specified that if the bullet's x is only greater than its max x it should disappear. Now, if you use the absolute value for bx in that statement you will have
if math.abs(i.bx) > i.maxx:
    #disappear
Done.

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

Reply via email to