You should check the tutorial for the platformer, it has something similar to what you are doing, when player hits enemy, player bounces to the opposite direction, now you can change your direction based on your events to whenever you want, the tutorial is simple and very helpful.
Oh cool! I never needed to use that thing where the player hits the enemy from above, so I never read that part of the tutorial. It really was helpful, thanks for directing me ^_^ I also made the enemies flash and lose their colissions while they do, so if you get lucky you can make the enemies fall of the screen. It looks so cool!