Hey Guys, Ive startd myself alittlebit of a project which hopefully will end with a 2d RPG maze... thing (not sure on if you get teh idea)
but Ive hit an obstacle that involves moving right with teh arrow keys without having to visually turn the 'player'.
I want to avoid doing what you do with basic Java using x and y to move the image however it looks to be between that and looking in the Greenfoot library which could be avoided if you guys have any good ideas.
Thanks for the help in advance anyways,
I see no reason to give teh code since its just the basics but it may help give an idea on what im looking for:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | public class Hero extends Actor { /** * Will orientate the player in the correct direction */ public Hero () { turn( 270 ); } public void act() { if (Greenfoot.isKeyDown( "Up" )) { move( 1 ); Greenfoot.delay( 5 ); } if (Greenfoot.isKeyDown( "Right" )) { move( 1 ); Greenfoot.delay( 5 ); } } } |