* {
    padding: 0;
    margin: 0;
}

#game {
    margin-left: auto;
    margin-right: auto;
    width: 500px;
    height: 200px;
    border: 1px solid black;
}

#character {
    width: 20px;
    height: 50px;
    background-color: red;
    position: relative;
    top: 150px;
    left: 10px;
}

.animate {
    animation: jump 500ms infinite;
}

@keyframes jump {
    0% {
        top: 150px;
    }

    30% {
        top: 100px;
    }

    70% {
        top: 100px;
    }

    100% {
        top: 150px;
    }

}

#block {
    width: 20px;
    height: 20px;
    background-color: blue;
    position: relative;
    top: 130px;
    left: 480px;
    animation: block 1s infinite linear;
}

@keyframes block {
    0% {
        left: 480px;
    }

    100% {
        left: -40px;
    }

}