---
# System prepended metadata

title: 230301 Class Notes - Tyler
tags: [Nova Academy, Java, Programming, Tutoring]

---

# 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)
