RSS Bot Posted January 29, 2018 Share Posted January 29, 2018 While playing Pac-man with a standard Atari Joystick, how often have you missed a turn? I may have a solution, if its due to pushing the joystick to far off the four directional axis. If its due to a slow reaction time then you're still on your own.I noted while playing Pac-man that my granddaughter would rotate the joystick base and start pushing the joystick into the diagonal directions(and so was I to a lesser extent). When 2 directional buttons on the joystick are pressed Pac-man determines that you are not sure which way you want him to go and continues to the end the lane.An Arduino can be used to read a Wii nunchuk analog joystick and determine which of the 4 directions it is closest to and then set the joystick pins. This would double the acceptable error from true UP, DOWN, LEFT and RIGHT.I believe it has improved my Pac-man scores. The first time I used the setup I was able to advance to level 2. The second try got me to level 3. The third game got me to level three with a personal high score of 12,200 points. I'm getting the feeling that I'm RTC (Reaction Time Challenged)?What to do?My first Out of the Pack blog project was using the nunchuk as an Atari Joystick. The circuit hasn't changed much and is still using the same Arduino library from a slightly modified program from "Arduino: A Quick-Start Guide" by Maik Schmidt. You'll need some of this information.http://atariage.com/forums/blog/572/entry-11529-nunchuk-arduino-atari-joystick/The prototype shield built for the Synthdrum project was reused. This shield has been getting a lot of use . A reset button has been added since the last time it was photographed. You can even leave the MIDI shield plugged on the stack but be sure to turn it off.http://atariage.com/forums/blog/572/entry-13921-midi-music-system-and-two-synth-drums/The Arduino program is simple enough. Of course, I could have saved myself a couple of days of frustration if I had paid closer attention in trigonometry class. I can still remember 45 years ago saying to myself, "When am I ever going to use this crap."I suppose that it would have been easier to download the MATH library with the required functions to calculate angles but I found a way…….1. Read the nunchuk x,y2. Adjust x,y to 0,0 point of origin.3. Calculate the Radius of a circle through adjusted x,y (a^2=b^2+c^2)4. Use SIN,COS table to calculate XY limit points at the 45deg limits5. Determine which limit points the XY is between.6. Set the joystick port7. Check the button status8. Start over.Most of the testing was done with the unit plugged into the ATARI8 and using the following program.10 X=STRIG(0):Y=15-STICK(0)20 IF X<>LASTX OR Y<> LASTY THEN ? X,Y30 LASTX=X:LASTY=Y40 GOTO 10Then I remembered that I had made the Joystick Tester for just this situation and that worked too.http://atariage.com/forums/blog/572/entry-11972-pocket-joystick-tester/ Attached thumbnail(s) Attached File(s) atari_nunchuk_4_Pacman.zip (1.87KB)Number of downloads: 0 http://atariage.com/forums/blog/572/entry-14526-nunchuk-your-way-to-a-better-pac-man-score/ Link to comment Share on other sites More sharing options...
Recommended Posts