|
Forum Index : Microcontroller and PC projects : Sprite questions
| Author | Message | ||||
| electricat Senior Member Joined: 30/11/2020 Location: LithuaniaPosts: 299 |
Hi, There i wrote few simple lines of code: box 0,0,50,50,4,rgb(red),rgb(white) sprite read 1,0,0,50,50 a=0 b=0 d=12 do if keydown(1) =129 and a<550 then a=a+1 : sprite show 1,b,a,0:pause d if keydown(1) =128 and a>0 then a=a-1 : sprite show 1,b,a,0:pause d if keydown(1) =130 and b>0 then b=b-1 : sprite show 1,b,a,0:pause d if keydown(1) =131 and b<750 then b=b+1 : sprite show 1,b,a,0:pause d loop While moving up and down sprite i see black horizontal stripes on sprite. While moving left-right black line appears like "standing black strip" And if I realase keys, strips goes away, so it is synchro problem/timing ? (It`s PHILIPS 190S LCD monitor and board CPU runs at 480Mhz ) What I am doing incorrectly? Is it ok only with static things, but with any animations I should route all changes through PAGE COPY ? Or I am doing it somehow totally wrong way? I am reading through forum/manuals etc., I`m really sorry if such question was already discussed, used to use forum search but maybe choosed wrong keywords. My MMBasic 'sand box' |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10590 |
Yes, either that or use getscanline to synchronise Edited 2020-12-19 01:29 by matherp |
||||
| electricat Senior Member Joined: 30/11/2020 Location: LithuaniaPosts: 299 |
Thank you for your precious time matherp! This time I went optimal way and now it works nicely Ha ha its almost Ms. Pacman now :D box 0,0,50,50,4,rgb(red),rgb(white) sprite read 1,0,0,50,50 a=0 b=0 d=1 do sync=getscanline if sync < a+150 and sync > a-150 then goto rep if keydown(1) =129 and a<550 then a=a+1 : sprite show 1,b,a,0 :pause d if keydown(1) =128 and a>0 then a=a-1 : sprite show 1,b,a,0 :pause d if keydown(1) =130 and b>0 then b=b-1 : sprite show 1,b,a,0 :pause d if keydown(1) =131 and b<750 then b=b+1 : sprite show 1,b,a,0 :pause d rep: loop do Edited 2020-12-19 07:18 by electricat My MMBasic 'sand box' |
||||
| electricat Senior Member Joined: 30/11/2020 Location: LithuaniaPosts: 299 |
Matherp, What could cause not clear picture in video I attached below ? Soon after I played with GETSCANLINE I used to test also PAGE COPY , but noticed something like pixel noise, like scanlines blinking, I dont know how to name it exactly, but screen was not clear as could/should be. So I tested example from "Graphics Programming on the Colour Maximite 2" but noticed the same "noise" effects please see video I attached. Might it be my hardware or maximite`s firmware problem? My fw version is 5.05.05 https://youtu.be/q5qoCdZ-W5I My MMBasic 'sand box' |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10590 |
Assuming you have a Waveshare based system you need to install the optional crystal oscillator |
||||
| electricat Senior Member Joined: 30/11/2020 Location: LithuaniaPosts: 299 |
OK. I`ll try that. My MMBasic 'sand box' |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |