mx0c / super-mario-python

super mario in python and pygame
520 stars 1.39k forks source link

Koopa shell only kills Mario #62

Closed deltea closed 3 years ago

deltea commented 4 years ago

When you step on a Koopa character and make it move, it only kills the player when you hit it, but not the other enemies

Veguinho commented 3 years ago

I can try to do it! If you assign me I will start working on it

Veguinho commented 3 years ago

In which class should the collision be happening?

mx0c commented 3 years ago

@Veguinho Sure, you should look into entities/Koopa.py, traits/LeftRightWalkTrait.py & classes/Collider.py.

Veguinho commented 3 years ago

Got it! It was farely easy to do. Just added a collider checker inside the Goomba and Koopa classes! Now I need to add the sound of when they die. Could you open another issue for me to add the sound too? That would help me get some more points for the hacktober fest :)

mx0c commented 3 years ago

Great, what you also could do is to make this system more general so if a new enemy type is added to the game you just f.e. inherit from a baseclass achieve this functionality.

Veguinho commented 3 years ago

Yeah this is a good idea! I'm gonna try doing that too.