  | |  | smooth scrolling/subpixel tweening | smooth scrolling/subpixel tweening 2003-11-23 - By vaccaro3@(protected)
Back Hi all
I'm a beginner/intermediate at lingo programming, and I'm working on a game where the character can jump up/forward/backwards in a set arc. I've got the code for that pretty much working, but the problem is he jumps at the speed of light. I'm not all familiar with Director, so what would be the optimal way of slowing down and maybe interpolating this movement? Awhile ago I saw an article on DOUG, I believe, that talked about subpixel movement, but I can't find it anywhere. Also, is calculating the parabola for the jump a justified solution, or is there a simpler method?
Any advice on this or any other game logic is greatly appreciated, thanks.
-b
the code I'm using (numbers are hardcoded for the moment):
on jump jumpDir -- jumpDir: -- 1 = left -1 = left 0 = up
pX = 0
repeat with pCount = 0 to 10
pX = pCount pY = (-0.32 * power(abs(pX - 5), 2)) + pB
my.locV = GroundPos - (pY * 25)
if jumpDir <> 0 then my.locH = my.locH - (jumpDir * (pCount * inc)) end if updatestage end repeat end
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ dirGames-L mailing list - dirGames-L@(protected) http://nuttybar.drama.uga.edu/mailman/listinfo/dirgames-l
Earn $52 per hosting referral at Lunarpages.
|
|
 |