2D Java Game Programming Animation Issue -
i'm working on swimming animation. when player collides watertile
, swimming animation not play when player goes left (lt) , when player goes right (rt), animation plays.
here render method player.java
: -edited-
if (isswimming){ if (up) { swimup.render(g, x, y, game.tilesize * game.scale, game.tilesize * game.scale); } if (dn){ swimdown.render(g, x, y, game.tilesize * game.scale, game.tilesize * game.scale); } if (rt){ swimright.render(g, x, y, game.tilesize * game.scale, game.tilesize * game.scale); } if (lt){ swimleft.render(g, x, y, game.tilesize * game.scale, game.tilesize * game.scale); } } if (!isswimming){ if(up){ upanimation.render(g, x, y, game.tilesize * game.scale, game.tilesize * game.scale); } if (dn){ downanimation.render(g, x, y, game.tilesize * game.scale, game.tilesize * game.scale); } if (rt){ rightanimation.render(g, x, y, game.tilesize * game.scale, game.tilesize * game.scale); } if (lt){ leftanimation.render(g, x, y, game.tilesize * game.scale, game.tilesize * game.scale); } else idle.render(g, x, y, game.tilesize * game.scale, game.tilesize * game.scale); }
also, may worth noting there no errors being displayed.
Comments
Post a Comment