body {
  background: #111;
}

#game {
  width: 400px;
  height: 300px;
  background: #222;
  margin: 50px auto;
  overflow: hidden;
  position: relative;
}

#player {
  width: 30px;
  height: 30px;
  background: red;
  position: absolute;
  bottom: 10px;
  left: 20px;
}

#block {
  width: 30px;
  height: 30px;
  background: yellow;
  position: absolute;
  right: -30px;
  bottom: 10px;
  animation: move 2s infinite linear;
}

@keyframes move {
  0% { right: -30px; }
  100% { right: 430px; }
}
