05 June 2016, 21:13 | #1 |
Prototron
Join Date: Mar 2015
Location: Glasgow, Scotland
Posts: 411
|
Bob jitter with diagonal movement
Hi just a small quick question before I settle down for the night. I'm moving my player using the old X=X+3 for right and Y=Y=3 for up etc.
Works fine but when I push diagonally up and right it jitters (same with all diagonal directions). I think it's because I'm going through the main loop and it's seeing the condition for Go Right and then the condition for Go Left and doing them one at a time in sequence instead of together. It didn't happen before but I'm not sure what I changed to cause it. |
05 June 2016, 22:57 | #2 |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
|
Don't forget the state idea from the other thread. Do a different state for each direction. One advantage of a state variable is that you can do hidden sequences of moves to make super attacks and combos.
|
05 June 2016, 23:54 | #3 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
Unlikely, but it could also be explained by the change of speed magnitude. You have 3 in x and y for speed, but you go to 4.24 (sqrt(vx^2+vy^2) = sqrt(3^2+3^2) = sqrt(18) = 4.2426).
The right vx/vy for a diagonal of the same magnitude is 2.1213 |
06 June 2016, 10:52 | #4 | |
Prototron
Join Date: Mar 2015
Location: Glasgow, Scotland
Posts: 411
|
I managed to sort it thanks to Volvo_one who's been a great help s has everyone.
Quote:
I think you mentioned that I make a custom variable of some sorts? |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Diagonal Lines on TV | eva | support.Hardware | 7 | 24 April 2015 13:38 |
Bob's Bad Day - ... no Bob. | AB Positive | support.Games | 5 | 16 May 2009 01:45 |
How do I map a diagonal left/right for a key in CD32 Emulation? | HyperBolt | support.WinUAE | 1 | 10 June 2006 23:12 |
Joysticks with the faulty diagonal syndrom | StarEye | support.Hardware | 1 | 05 July 2005 13:38 |
Jerky mouse movement | andreas | support.WinUAE | 3 | 02 June 2002 19:14 |
|
|