2048 wrapper¶
- class pyboy.plugins.game_wrapper2048.GameWrapper2048(*args, **kwargs)[source]¶
Bases:
PyBoyGameWrapperThis class wraps 2048 for Game Boy, and provides easy access for AIs.
This game wrapper only works with the release of 2048 with MD5 1efd562975966b55ada5fb88e7a95f6e. It’s required to also have the .map file for the ROM. See PyBoy mirror of open-source ROMs https://pyboy.dk/mirror/
If you call
printon an instance of this object, it will show an overview of everything this object provides.- score¶
The current score
- winner¶
True if the player has reached 2048
- board¶
The 5x5 board
- start_game(timer_div=None)[source]¶
Call this function right after initializing PyBoy. This will navigate through the boot/title screen and start the game at the first playable state.
The state of the emulator is saved, and using
reset_game, you can get back to this point of the game instantly.
- game_over()[source]¶
After calling
start_game, you can call this method at any time to know if the game is over.