Hi im making a mario like game for fun and i am stuck with making mario animate himself, as in make his arms/legs move. I have the code for it, and if i break it down it works, however I have so far failed to space it so that it is actually visible. So far I have tried setTimeout and .delay however neither has worked
here is my js code at the moment with the .delay function.
function animateMario() {
// cycles through other 4 images
for (var i=1; i<5; i++) {
$('#mario').attr('src', 'images/mario/mario_f_'+i+'.png').delay(100);
}
// returns to original image
$('#mario').attr('src', 'images/mario/mario_f_0.png').delay(100);
};
If anyone could help it would be much appreciated :) Thank you very much If you have any questions please ask