# 1. Starting

### Initializing

Firstly, you need to initialize your animation

#### Example

```java
public final Animation animation = new Animation();
```

### Animation#animate()

After initializing, you need to call animate method, it will animate value to your

#### Example

```java
animation.animate(valueTo, duration, easing, safe);
```

### What does means safe?

safe means that animation will not animate if animation's target value == valueTo in Animation#animate()

### Animation#isAlive()

Returns true if animation is animating

### Animation#isDone()

Returns true if animation is not animating

### What does means easing?

**Easing functions** specify the rate of change of a parameter over time.

Objects in real life don’t just start and stop instantly, and almost never move at a constant speed. When we open a drawer, we first move it quickly, and slow it down as it comes out. Drop something on the floor, and it will first accelerate downwards, and then bounce back up after hitting the floor.

#### Example

```java
Easings.BACK_BOTH
```

### Important Thing

Because you dont updating animation, after .animate() you need to update animation calling Animation#update()

#### Example

```java
animation.update();
```

### Done!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hogoshi.gitbook.io/animations/guide/1.-starting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
