Search the web
Sign In
New User? Sign Up
gbadev
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Sprite Looping Back Then Fowrard   Message List  
Reply | Forward Message #13810 of 15019 |
Re: [gbadev] Sprite Looping Back Then Fowrard

Hello,
Don't know quite what you were trying to do but I hope this helps some.

// frames 0-11 = walk RIGHT
// frames 12-23 = walk LEFT

if (RIGHT key pressed)
{
if (captin.activeFrame > 11)
captin.activeFrame=0;
else
captin.activeFrame++;
if (captin.x < 220)
captin.x++;
}
else if (LEFT key pressed)
{
if (captin.activeFrame<12 || captin.activeFrame>23)
captin.activeFrame=12;
else
captin.activeFrame++;
if (captin.x>0)
captin.x--;
}

// Do sprite stuff here....

Again, hope that helps a bit.

Martin.





Tue Mar 11, 2003 11:58 am

gibbsteruk
Offline Offline
Send Email Send Email

Forward
Message #13810 of 15019 |
Expand Messages Author Sort by Date

Hello I am looping 24 sprite animations and for some reason they are not looping right. It is a sprtie of captin America Walking, the first 12 are him...
JC Matthews
kreedskulls
Offline Send Email
Mar 11, 2003
9:59 am

Hello, Don't know quite what you were trying to do but I hope this helps some. // frames 0-11 = walk RIGHT // frames 12-23 = walk LEFT if (RIGHT key pressed) {...
Martin Gibbins
gibbsteruk
Offline Send Email
Mar 12, 2003
9:24 am

... I have spotted one of the problems, at least. Lets say you initially press the 'right' key. At the end of the frame, captin.activeFrame is somewhere ...
Mat Scales
mscales@...
Send Email
Mar 12, 2003
9:25 am

you forgot the conditions press right (having been going left) so captin.activeFrame > 11 ... From: "JC Matthews" <kreedskulls@...> To:...
Mike Wynn
mike.wynn@...
Send Email
Mar 12, 2003
9:25 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help