Lets eliminate the if all together.
make a variable called direction. set it to -1;
For the flipper goes:
Key down -> right -> script editor->
- Code: Select all
direction = direction * -1; // I think you could also go direction =*;
Key up -> right -> script editor->
- Code: Select all
direction = direction * -1;
For the ball goes:
Collision -> top side of flipper -> script editor ->
- Code: Select all
yvelocity = yvelocity*direction; // you might want to bleed a little speed off this to account for frictional forces.
When it collides with something else, you will have to set the xvelocity and yvelocity again, perhaps using the same system as this.
This will make the ball go up when it touches the flipper and the key is pressed.[/quote]