Making an actor Jump when walking on Ceiling and Walls

Currently working on a game in which I am using acceleration to simulate gravity in different directions. I had no problems getting the actor to jump when the acceleration is down. Does anyone have any ideas on how I should go about getting the actor to jump when walking on the ceiling or the walls. Thanks in advance for your help.
This is a quick rundown of how I am jumping when on the floor.
When space bar is pressed
Change attribute - Self.motion.linear velocity Y = 300
With true/false on a self.jump attribute
This is a quick rundown of how I am jumping when on the floor.
When space bar is pressed
Change attribute - Self.motion.linear velocity Y = 300
With true/false on a self.jump attribute
Comments
that way when your on the ceilieing you jump the other way but jump normal when your supposed too
you can also do the same for your side walls changing motion linear x to 300 and -300 depending on the right or left wall
Make your real attribute called jump, and make a interger attribute and call it playerorientation(or whatver you want) and set it to 0
Now in your jump button have a rule when touch is pressed change attribute jump to true, then in the otherwise section of that rule put a change attribute behavior changing jump to false (so when you touch is changes to true then you let go it goes back to false)
Make a rule in the ground actor when it collides with the player, change attribute playerorientation to 0
Make a rule in the ceiling actor when it collides with the player, change attribute playerorientation to 1
In the player have a rule when attirubte jump is true and attirbute playerorientation=0 change attribute self motion linear velocity y to 300
Make another rule in the player when attribute jump is true and player orentation=1 change attribute self motion linear velcotiy y to -300
then finally for your gravity have 2 rules in the player. The first one is when attirbutge playerorentation=0 accelerate down relative to scene
Then the next rule is when attribute playerorientation=1 accelerate up relative to scene
then it would be the same for the sides except changing your playerorientation attribute to new distinct numbers for the left and right side, and change motion linear x instead of y, and have your extra rules for gravity accelarting in the oppostie direction relative to scene