Frozone212 Posted December 24, 2022 Share Posted December 24, 2022 I RTFM and no luck. Any ideas? Quote Link to comment Share on other sites More sharing options...
DavidC Posted December 24, 2022 Share Posted December 24, 2022 https://www.commodore.ca/manuals/128_system_guide/sect-06b.htm Quote Link to comment Share on other sites More sharing options...
DavidC Posted December 24, 2022 Share Posted December 24, 2022 Quote Link to comment Share on other sites More sharing options...
Casey Posted December 24, 2022 Share Posted December 24, 2022 (edited) I'm not near a 128, but a combination of the JOY function and MOVSPR command should do what you want. JOY(1) returns the position of joystick port 1 such that starting at Up/North as 1, the directions are numbered clockwise from 1-8 (so 8 is NW). The fire button adds 128 to the value returned. Take this value and feed it into MOVSPR - it expects degrees. So, as a quick example: 10 A=JOY(1):IF A>128 THEN A=A-128 15 IF A=0 THEN MOVSPR 1,45*(A-1)#0:GOTO 10 20 MOVSPR 1,45*(A-1)#5 30 GOTO 10 This should move an already defined sprite in the direction the joystick is being pushed at speed 5. It ignores the fire button, but you could put logic in there to check and do something different if the fire button is pressed. If the joystick is released, the sprite stops moving. Edited December 24, 2022 by Casey 1 Quote Link to comment Share on other sites More sharing options...
Frozone212 Posted December 24, 2022 Author Share Posted December 24, 2022 thank you, this is what I wanted Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.