简体   繁体   中英

Is it possible to move a PictureBox (Vb.net Visual Studio) by less then a pixel

I'm just curious because im making a game, at least trying. And i have a little ship, and of course if its moving at a speed of 1 pixel per tick of a timer (16ms (60fps)) and its facing straight up it's Y axis movement is just 1 pixel per tick and X axis is 0... But if its rotated 5 degrees clockwise, its Y axis movement would need to be (1/18 * 17) and X axis would need to be (1/18)... and that would mean the ship is supposed to be moving upwards at about 0.95 pixels per tick and right at about 0.05 pixels per tick, which it obviously cant do because you cant have less than 1 of a pixel... Is there another way i haven't thought of? And did I explain that well, does it make sense?

Thanks to @Martheen

"Maintain the real position elsewhere and only calculate the actual pixel position when rendering. This way after a few frames or so it will move, like watching a radar screen or slowed-down video – Martheen"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM