Thank you very much, EngineProgrammer! I think this will still be tough, but you've given me a great head start!
UPDATE: It works! Using some math I found elsewhere, I got my program to run flawlessly! Now for my next project: Randomly-dropped power-ups!