# 230301 Class Notes - Tyler ###### tags: `Nova Academy` `Tutoring` `Programming` `Java` ## Make the Tyler move Inside the file, Alien, the "public void moving(String direction)" add another else if statement. ```=java else if(direction.equals("BOUNCE")) { super.setX(super.getX()+10*speed); if ( super.getX() > 200) { speed *= -1; super.setX(200); } else if (super.getX() < 100) { speed *= -1; super.setX(100); } ``` ## Reference - [Stack Overflow: Java, Move Rectangle Back and Forth](https://stackoverflow.com/questions/25599616/java-move-rectangle-back-and-forth)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up