Kirby’s Dream Land wrapper

class pyboy.plugins.game_wrapper_kirby_dream_land.GameWrapperKirbyDreamLand(*args, **kwargs)[source]

Bases: PyBoyGameWrapper

This class wraps Kirby Dream Land, and provides easy access for AIs.

If you call print on an instance of this object, it will show an overview of everything this object provides.

score

The score provided by the game

health

The health provided by the game

lives_left

The lives remaining provided by the game

start_game(timer_div=None)[source]

Call this function right after initializing PyBoy. This will navigate through menus to 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.

Kwargs:
  • timer_div (int): Replace timer’s DIV register with this value. Use None to randomize.

reset_game(timer_div=None)[source]

After calling start_game, you can call this method at any time to reset the game.

Kwargs:
  • timer_div (int): Replace timer’s DIV register with this value. Use None to randomize.

game_area()[source]

Use this method to get a matrix of the “game area” of the screen.

    0   1   2   3   4   5   6   7   8   9
____________________________________________________________________________________
0  | 383 383 383 301 383 383 383 297 383 383 383 301 383 383 383 297 383 383 383 293
1  | 383 383 383 383 300 294 295 296 383 383 383 383 300 294 295 296 383 383 299 383
2  | 311 318 319 320 383 383 383 383 383 383 383 383 383 383 383 383 383 301 383 383
3  | 383 383 383 321 322 383 383 383 383 383 383 383 383 383 383 383 383 383 300 294
4  | 383 383 383 383 323 290 291 383 383 383 313 312 311 318 319 320 383 290 291 383
5  | 383 383 383 383 324 383 383 383 383 315 314 383 383 383 383 321 322 383 383 383
6  | 383 383 383 383 324 293 292 383 383 316 383 383 383 383 383 383 323 383 383 383
7  | 383 383 383 383 324 383 383 298 383 317 383 383 383 383 383 383 324 383 383 383
8  | 319 320 383 383 324 383 383 297 383 317 383 383 383 152 140 383 324 383 383 307
9  | 383 321 322 383 324 294 295 296 383 325 383 383 383 383 383 383 326 272 274 309
10 | 383 383 323 383 326 383 383 383 2   18  383 330 331 331 331 331 331 331 331 331
11 | 274 383 324 272 274 272 274 272 274 272 274 334 328 328 328 328 328 328 328 328
12 | 331 331 331 331 331 331 331 331 331 331 331 328 328 328 328 328 328 328 328 328
13 | 328 328 328 277 278 328 328 328 328 328 328 328 328 277 278 328 328 277 278 277
14 | 328 277 278 279 281 277 278 328 328 277 278 277 278 279 281 277 278 279 281 279
15 | 278 279 281 280 282 279 281 277 278 279 281 279 281 280 282 279 281 280 282 280
Returns:

Simplified two-dimensional array of mapped tile identifiers with dtype numpy.uint32.

Return type:

numpy.ndarray

game_over()[source]

After calling start_game, you can call this method at any time to know if the game is over.