Re: Funny Moves
- Posted by Derek Parnell <dparnell at BIGPOND.NET.AU> Nov 22, 2000
- 433 views
Hi Thomas, I think you're learning lots and your coding style has improved remarkably. Well done. I suspect the problem is that you display first then move to the next position. The usual way to render moving images is ... if image was displayed then hide it at its current position end if move to the new position display the image I'm not expert here so maybe somebody else can elaborate. ------ Derek Parnell Melbourne, Australia (Vote [1] The Cheshire Cat for Internet Mascot) ----- Original Message ----- > Sorry for the enigmatic letter, I don't like to give away what I'm working > on 'till it's decent. So, here is the piece of code that's causing the > problem: Please and thanks for looking at it. > --Thomas > ---/\=== > > --Start your binary! > > integer action > atom LEFT,RIGHT > LEFT=333 > RIGHT=331 > > procedure walkLEFT() > if action=LEFT then > display_image({sides,ups}, walkL[2]) --just BMPs* > pause(.1) > display_image({sides,ups}, blackout[2]) * > display_image({sides,ups}, walkR[2]) * > pause(.1) > sides+=1 > end if > end procedure > > procedure walkRIGHT() > if action=RIGHT then > display_image({sides,ups}, walkL[2]) > pause(.1) > display_image({sides,ups}, blackout[2]) > display_image({sides,ups}, walkR[2]) > pause(.1) > sides-=2 > end if > end procedure > > procedure walkies() > action=get_key() > if action=LEFT then > walkLEFT() > elsif action=RIGHT then > walkRIGHT() > end if > end procedure > > while 1 do > walkies() > end while