Advertisement
Guest User

Untitled

a guest
Sep 19th, 2014
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. public void beginContact(Contact contact) {
  2. setColliding(true);
  3. }
  4.  
  5. //updating collition every frame
  6. public void act(){
  7. if (colliding) {
  8. ball.getBody().applyForce(....);
  9.  
  10. }
  11.  
  12. public void act() {
  13. if (colliding) {
  14. ball.getBody().setLinearVelocity(0, 0);
  15.  
  16. ball.getBody().applyForce((portal.getBody().getPosition().x - ball.getBody().getPosition().x) * i,
  17. (portal.getBody().getPosition().y - ball.getBody().getPosition().y) * i,
  18. ball.getBody().getPosition().x, ball.getBody().getPosition().y, true);
  19.  
  20. i++;
  21. } else
  22. i = 10;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement