0 Members and 3 Guests are viewing this topic.
Quote from: DJ_O on January 02, 2012, 07:44:05 pmLooks quite nice so far. By the way although smooth scrolling cannot be implemented, have you tried 8 pixel scrolling or even 4 pixel scrolling?No but I have tried some sort of smooth scrolling in the past. Way too slow for what it gives back, not worth the pain of implementing it. Well, at least not a this point, maybe if Lua gets a bit faster in the future, then why not.
Looks quite nice so far. By the way although smooth scrolling cannot be implemented, have you tried 8 pixel scrolling or even 4 pixel scrolling?
but it's really nice, why did you change the name to owl (i like it, just to know)?
Quote from: hoffa on January 02, 2012, 07:47:21 pmQuote from: DJ_O on January 02, 2012, 07:44:05 pmLooks quite nice so far. By the way although smooth scrolling cannot be implemented, have you tried 8 pixel scrolling or even 4 pixel scrolling?No but I have tried some sort of smooth scrolling in the past. Way too slow for what it gives back, not worth the pain of implementing it. Well, at least not a this point, maybe if Lua gets a bit faster in the future, then why not.Smooth scrolling for the character's sprite is easily possible... just a for loops over the coordinates from source to destination (maybe with actually a partial window:invalidate() to accelerate the specific screen part refresh)But yeah, smooth scrolling for the rest (background and tiles) would indeed be slow.
This is not the case if you only invalidate a certain spot (by giving arguments to invalidate() ).I've made some stuff with it (smooth scrolling) and it works very good.
sprite = image.new("some 318*212 ti image")drawn = falsefunction on.enterKey() platform.window:invalidate(10, 10, 10, 10)endfunction on.paint(gc) if not drawn then gc:drawImage(sprite, 0, 0) drawn = true endend
well, you make drawn true when painting, so when you press enter, the drawn isn't false anymore and the sprite won't get drawn, just change that drawn=true in =false (or just delete it) and it should workthe rest of the code is correct imo
Your code works with me, although I did not use a fullscreen picture (32*32).When pushing enter only a 10*10 square is cleared.Edit:Also, you can expect improvement in the next OS release.TI did not create Lua for game programming, so its not hard to understand that its not optimized for games.Anyway, I don't have any problem with TI.Image.
Interesting. Could you sum up how you got to improve the speed? Also does it use any undocumented tricks? Because maybe that won't work in future OSes then
EDIT Weird I don't notice much of a frame difference. Is it just due to the getkey speed limitation and lack of smooth character movement?