I'm very inexperienced with pygame & python.. I was wacthing a youtube tutorial about making a platform game with pygame. Everything works just as intended except for one thing..
I want to increase my characters jumping height temporarily but i just don't get it to work the way i want it to. I'm able to increase the jumping height but unfortunately not only temporarily, but until the end of that run. Like i said, i'm very very inexperienced and i'd be glad if anyone could tell me a way to fix my problem
The upper part (boost & mega_boost) work just as planned. Whenever the player character hits them, the character is launched upwards for a few seconds. But "super_jump" shouldn't launch the character in the air, it's only supposed to increase the jumping height, for example the normal jumping height is "20" and i want it to be increased to "40" for 5 seconds.
I've been told that my time checker is inside of the power up function and i should place it somewhere else, but i have no idea where to put it. I'd be really gratefull if anyone could help me Here's the part of the Code:
if pow.type == "super_jump":
self.player.mega_jump_status = 1
now = pg.time.get_ticks()
if now - self.player.last_update > 5000:
self.player.mega_jump_status = 0