This site requires JavaScript, please enable it in your browser!
Greenfoot back
metaleddie13
metaleddie13 wrote ...

2011/10/27

Getting My Character To Flip 360 Degrees

1
2
metaleddie13 metaleddie13

2011/10/28

#
The character flips fine but only in one way.
ez4u2c ez4u2c

2011/10/29

#
Just patched-up your flip method a bit:
#     private void flip(int x)  
#     {  
#         // int flip = 0;  (you've already got "x")
#         for (int i = 1; i <= 8; i++)  
#         {  
#             if(x > 0)  // (use x since you chose it)
#             {  
#             setRotation(getRotation() + 45);  
#             wait(10);  
#             }  
#             if (x < 0)  
#             {  
#             setRotation(getRotation() - 45);  
#             wait(10);  
#             }    
#         }  
#     }  
metaleddie13 metaleddie13

2011/10/29

#
Yep that was the problem, I knew it was something small and easy. I really appreciate it. Now if I can only figure out what's wrong with my output for the character and why Greenfoot.playsound is not working.
You need to login to post a reply.
1
2