59 posts
Posted 04 January 2013 - 07:15 AM
Ok so i am working on and OS and i almost have the UI done (Thats the hardest part because of the way i set up the handler). Anyway I want these "worms" to draw across the screen(Basically they are lines that move across the screen horizontally) but for some reason i can't get them to update. I tried use parallel but that didn't work :/ then I tried force updating it with os.startTimer but that just caused a ton of flickering. Also look for the functions Update() and UpdateWorms(). Any ideas?
Pastebin:
http://pastebin.com/zA6pSjaUControls:
You can click on App Names to bring up a sub menu
Enter shuts down the program
1190 posts
Location
RHIT
Posted 04 January 2013 - 07:34 AM
-snip-
Looked at your code and noticed that actually my implementation was pretty much the same. You say that you're having screen flickering issues? Try using os.startTimer(0.1) rather than sleep(0.1). Not sure if it will make a difference but you can give it a shot.
59 posts
Posted 04 January 2013 - 07:50 AM
http://pastebin.com/cpaJgrSyI updated the code still doesn't work :/
Also do you like the UI?
59 posts
Posted 04 January 2013 - 08:57 AM
-snip-
Looked at your code and noticed that actually my implementation was pretty much the same. You say that you're having screen flickering issues? Try using os.startTimer(0.1) rather than sleep(0.1). Not sure if it will make a difference but you can give it a shot.
That didn't work either this is so weird….
2088 posts
Location
South Africa
Posted 04 January 2013 - 09:21 AM
I'm confused on what you're trying to do.
What I understand is that you want the text of the Apps or whatever scroll from left to right all the time?
1190 posts
Location
RHIT
Posted 04 January 2013 - 09:25 AM
No he has a "worm" scroll across the page from right to left. My guess is that your problem lies in the number of different places you have "timerID = os.startTimer()". Try putting that in your pullEvent function (and ONLY your pullEvent function) so that while you are waiting for a click the screen updates. Also I was confused by your "wd" variable, which would make it so that the wormDraw function only draws a worm to the screen every 10 cycles. Try removing that too.
59 posts
Posted 04 January 2013 - 09:54 AM
No he has a "worm" scroll across the page from right to left. My guess is that your problem lies in the number of different places you have "timerID = os.startTimer()". Try putting that in your pullEvent function (and ONLY your pullEvent function) so that while you are waiting for a click the screen updates. Also I was confused by your "wd" variable, which would make it so that the wormDraw function only draws a worm to the screen every 10 cycles. Try removing that too.
I got it to work a lot better thanks to you guys :)/> but now I have a problem where the worm stops moving across the screen. I think it happens because the timer goes off at the same time as you do some other thing. New code:
Pastebin:
http://pastebin.com/KTXU1db1The more I think about it the more I think i should rewrite the whole thing with OS in mind instead of UI :)/>
1190 posts
Location
RHIT
Posted 04 January 2013 - 10:02 AM
No he has a "worm" scroll across the page from right to left. My guess is that your problem lies in the number of different places you have "timerID = os.startTimer()". Try putting that in your pullEvent function (and ONLY your pullEvent function) so that while you are waiting for a click the screen updates. Also I was confused by your "wd" variable, which would make it so that the wormDraw function only draws a worm to the screen every 10 cycles. Try removing that too.
I got it to work a lot better thanks to you guys :)/> but now I have a problem where the worm stops moving across the screen. I think it happens because the timer goes off at the same time as you do some other thing. New code:
Pastebin:
http://pastebin.com/KTXU1db1The more I think about it the more I think i should rewrite the whole thing with OS in mind instead of UI :)/>
Yeah build the logic of the OS first and have a clear idea in mind of what you want to do before building the UI. It'll make the process waaay easier.