Why my enemie passes through the cube

My enemie passes through the cube but I have coded it.

my code:

For the enemy or player?

If by cubes you mean Rock and Rock2, it seems you’re only calling a collision test for the player and not the enemy.