flappy-bird-gym环境安装

如题

conda create -n flappy-bird-gym python=3.8
pip install setuptools==65.5.0	//需要降低版本,不然无法安装低版本的gym
pip install gym=0.18.0	//安装0.18.x版本的gym
pip install flappy-bird-gym
import time
import flappy_bird_gym
env = flappy_bird_gym.make("FlappyBird-v0")

obs = env.reset()
while True:
    # Next action:
    # (feed the observation to your agent here)
    action = ...  # env.action_space.sample() for a random action

    # Processing:
    obs, reward, done, info = env.step(action)
    
    # Rendering the game:
    # (remove this two lines during training)
    env.render()
    time.sleep(1 / 30)  # FPS
    
    # Checking if the player is still alive
    if done:
        break

env.close()

运行成功


flappy-bird-gym环境安装
https://lmc20020909.github.io/flappy-bird-gym安装/
作者
Liu Mingchen
发布于
2023年7月21日
许可协议