Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void moveForward(){
- slow();
- if((_Y + 100) < 800){
- _Y = _Y + 100;
- updateFrame();
- if(_cones.collideWithCone(this)){
- _Y = _Y - 100;
- updateFrame();
- }
- }
- }
- public void moveBackward(){
- slow();
- if((_Y - 100) > 0){
- _Y = _Y - 100;
- updateFrame();
- if(_cones.collideWithCone(this)){
- _Y = _Y + 100;
- updateFrame();
- }
- }
- }
- public void moveRight(){
- slow();
- if((_X + 100) < 800){
- _X = _X + 100;
- updateFrame();
- if(_cones.collideWithCone(this)){
- _X = _X - 100;
- updateFrame();
- }
- }
- }
- public void moveLeft(){
- slow();
- if((_X - 100) > 0){
- _X = _X - 100;
- updateFrame();
- if(_cones.collideWithCone(this)){
- _X = _X + 100;
- updateFrame();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement