mima-engine 0.2.0__tar.gz → 0.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of mima-engine might be problematic. Click here for more details.

Files changed (134) hide show
  1. {mima_engine-0.2.0 → mima_engine-0.2.2}/PKG-INFO +1 -1
  2. mima_engine-0.2.2/src/mima/__init__.py +1 -0
  3. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/backend/pygame_events.py +41 -38
  4. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/creature.py +1 -1
  5. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/world/color_gate.py +13 -12
  6. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/world/gate.py +15 -11
  7. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/commands/close_dialog.py +2 -1
  8. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/util/input_defaults.py +8 -8
  9. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima_engine.egg-info/PKG-INFO +1 -1
  10. mima_engine-0.2.0/src/mima/__init__.py +0 -1
  11. {mima_engine-0.2.0 → mima_engine-0.2.2}/README.md +0 -0
  12. {mima_engine-0.2.0 → mima_engine-0.2.2}/pyproject.toml +0 -0
  13. {mima_engine-0.2.0 → mima_engine-0.2.2}/setup.cfg +0 -0
  14. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/backend/__init__.py +0 -0
  15. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/backend/pygame_assets.py +0 -0
  16. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/backend/pygame_audio.py +0 -0
  17. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/backend/pygame_backend.py +0 -0
  18. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/backend/pygame_camera.py +0 -0
  19. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/collision.py +0 -0
  20. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/engine.py +0 -0
  21. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/maps/__init__.py +0 -0
  22. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/maps/template.py +0 -0
  23. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/maps/tile.py +0 -0
  24. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/maps/tile_animation.py +0 -0
  25. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/maps/tile_info.py +0 -0
  26. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/maps/tile_layer.py +0 -0
  27. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/maps/tiled/__init__.py +0 -0
  28. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/maps/tiled/tiled_layer.py +0 -0
  29. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/maps/tiled/tiled_map.py +0 -0
  30. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/maps/tiled/tiled_object.py +0 -0
  31. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/maps/tiled/tiled_objectgroup.py +0 -0
  32. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/maps/tiled/tiled_template.py +0 -0
  33. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/maps/tiled/tiled_tile.py +0 -0
  34. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/maps/tiled/tiled_tileset.py +0 -0
  35. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/maps/tilemap.py +0 -0
  36. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/maps/tileset.py +0 -0
  37. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/maps/tileset_info.py +0 -0
  38. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/maps/transition_map.py +0 -0
  39. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/mode_engine.py +0 -0
  40. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/__init__.py +0 -0
  41. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/animated_sprite.py +0 -0
  42. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/attribute_effect.py +0 -0
  43. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/attributes.py +0 -0
  44. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/dynamic.py +0 -0
  45. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/effects/__init__.py +0 -0
  46. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/effects/colorize_screen.py +0 -0
  47. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/effects/debug_box.py +0 -0
  48. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/effects/light.py +0 -0
  49. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/effects/show_sprite.py +0 -0
  50. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/effects/walking_on_grass.py +0 -0
  51. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/effects/walking_on_water.py +0 -0
  52. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/loader.py +0 -0
  53. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/projectile.py +0 -0
  54. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/sprite.py +0 -0
  55. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/world/__init__.py +0 -0
  56. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/world/color_switch.py +0 -0
  57. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/world/container.py +0 -0
  58. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/world/floor_switch.py +0 -0
  59. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/world/light_source.py +0 -0
  60. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/world/logic_gate.py +0 -0
  61. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/world/movable.py +0 -0
  62. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/world/oneway.py +0 -0
  63. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/world/pickup.py +0 -0
  64. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/world/switch.py +0 -0
  65. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/objects/world/teleport.py +0 -0
  66. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scene_engine.py +0 -0
  67. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/__init__.py +0 -0
  68. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/command.py +0 -0
  69. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/commands/__init__.py +0 -0
  70. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/commands/add_quest.py +0 -0
  71. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/commands/change_map.py +0 -0
  72. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/commands/equip_weapon.py +0 -0
  73. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/commands/give_item.py +0 -0
  74. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/commands/give_resource.py +0 -0
  75. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/commands/move_map.py +0 -0
  76. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/commands/move_to.py +0 -0
  77. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/commands/oneway_move.py +0 -0
  78. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/commands/parallel.py +0 -0
  79. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/commands/play_sound.py +0 -0
  80. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/commands/present_item.py +0 -0
  81. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/commands/progress_quest.py +0 -0
  82. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/commands/quit_game.py +0 -0
  83. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/commands/save_game.py +0 -0
  84. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/commands/screen_fade.py +0 -0
  85. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/commands/serial.py +0 -0
  86. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/commands/set_facing_direction.py +0 -0
  87. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/commands/set_spawn_map.py +0 -0
  88. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/commands/show_choices.py +0 -0
  89. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/commands/show_dialog.py +0 -0
  90. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/commands/take_coins.py +0 -0
  91. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/scripts/script_processor.py +0 -0
  92. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/states/__init__.py +0 -0
  93. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/states/game_state.py +0 -0
  94. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/states/memory.py +0 -0
  95. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/states/quest.py +0 -0
  96. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/types/__init__.py +0 -0
  97. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/types/alignment.py +0 -0
  98. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/types/blend.py +0 -0
  99. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/types/damage.py +0 -0
  100. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/types/direction.py +0 -0
  101. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/types/gate_color.py +0 -0
  102. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/types/graphic_state.py +0 -0
  103. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/types/keys.py +0 -0
  104. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/types/mode.py +0 -0
  105. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/types/nature.py +0 -0
  106. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/types/object.py +0 -0
  107. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/types/player.py +0 -0
  108. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/types/position.py +0 -0
  109. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/types/start.py +0 -0
  110. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/types/terrain.py +0 -0
  111. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/types/tile_collision.py +0 -0
  112. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/types/weapon_slot.py +0 -0
  113. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/types/window.py +0 -0
  114. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/usables/__init__.py +0 -0
  115. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/usables/item.py +0 -0
  116. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/usables/weapon.py +0 -0
  117. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/util/__init__.py +0 -0
  118. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/util/colors.py +0 -0
  119. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/util/constants.py +0 -0
  120. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/util/functions.py +0 -0
  121. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/util/logging.py +0 -0
  122. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/util/property.py +0 -0
  123. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/util/runtime_config.py +0 -0
  124. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/util/trading_item.py +0 -0
  125. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/view/__init__.py +0 -0
  126. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/view/camera.py +0 -0
  127. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/view/mima_mode.py +0 -0
  128. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/view/mima_scene.py +0 -0
  129. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/view/mima_view.py +0 -0
  130. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima/view/mima_window.py +0 -0
  131. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima_engine.egg-info/SOURCES.txt +0 -0
  132. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima_engine.egg-info/dependency_links.txt +0 -0
  133. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima_engine.egg-info/requires.txt +0 -0
  134. {mima_engine-0.2.0 → mima_engine-0.2.2}/src/mima_engine.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mima-engine
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: A game engine based on pygame.
5
5
  Author-email: Stephan Balduin <stephan.balduin@mailbox.org>
6
6
  Classifier: Programming Language :: Python :: 3
@@ -0,0 +1 @@
1
+ __version__ = "0.2.2"
@@ -277,16 +277,19 @@ class PygameUserInput:
277
277
  if event.type == pygame.FINGERDOWN:
278
278
  tap = time.time()
279
279
  for key, area in DEFAULT_TOUCHSCREEN_MAP.items():
280
+
280
281
  if (
281
282
  area[0][0] <= event.x < area[1][0]
282
283
  and area[0][1] <= event.y < area[1][1]
283
284
  ):
284
- if key == K.UP:
285
+ if key == K.P1_UP:
285
286
  self._left_finger_tap_pos = finger_pos
286
287
  if tap - self._last_left_tap < DOUBLE_TAP_SPEED:
287
288
  # print("Left Double Tap")
288
- self.set_key(K.SELECT)
289
+ self.set_key(K.P1_SELECT)
289
290
  self._last_left_tap = tap
291
+ elif key == K.P1_L:
292
+ self.set_key(K.P1_L)
290
293
  else:
291
294
  self.set_key(key)
292
295
  self._right_finger_tap_pos = finger_pos
@@ -346,23 +349,23 @@ class PygameUserInput:
346
349
  # print("Left Single Tap")
347
350
  # # self.set_key(K.START)
348
351
 
349
- self.unset_key(K.SELECT)
350
- self.unset_key(K.RIGHT)
351
- self.unset_key(K.LEFT)
352
- self.unset_key(K.UP)
353
- self.unset_key(K.DOWN)
354
- self.unset_key(K.L)
352
+ self.unset_key(K.P1_SELECT)
353
+ self.unset_key(K.P1_RIGHT)
354
+ self.unset_key(K.P1_LEFT)
355
+ self.unset_key(K.P1_UP)
356
+ self.unset_key(K.P1_DOWN)
357
+ self.unset_key(K.P1_L)
355
358
  # print(
356
359
  # f"Left Finger moved {finger_dist} "
357
360
  # f"({release - self._last_left_tap} s)"
358
361
  # )
359
362
  else:
360
- self.unset_key(K.START)
361
- self.unset_key(K.A)
362
- self.unset_key(K.B)
363
- self.unset_key(K.Y)
364
- self.unset_key(K.X)
365
- self.unset_key(K.R)
363
+ self.unset_key(K.P1_START)
364
+ self.unset_key(K.P1_A)
365
+ self.unset_key(K.P1_B)
366
+ self.unset_key(K.P1_Y)
367
+ self.unset_key(K.P1_X)
368
+ self.unset_key(K.P1_R)
366
369
  # print(f"Right Finger Up: {finger_pos}")
367
370
  # if (
368
371
  # SINGLE_TAP_MIN
@@ -396,45 +399,45 @@ class PygameUserInput:
396
399
  if event.type == pygame.FINGERMOTION:
397
400
  if event.x < 0.5:
398
401
  vd = finger_pos - self._left_finger_tap_pos
399
- self.unset_key(K.RIGHT)
400
- self.unset_key(K.LEFT)
401
- self.unset_key(K.UP)
402
- self.unset_key(K.DOWN)
402
+ self.unset_key(K.P1_RIGHT)
403
+ self.unset_key(K.P1_LEFT)
404
+ self.unset_key(K.P1_UP)
405
+ self.unset_key(K.P1_DOWN)
403
406
  if abs(vd.x) > 2 * abs(vd.y):
404
407
  # Horizontal
405
408
  if vd.x > 5.0:
406
- self.set_key(K.RIGHT)
407
- self.unset_key(K.LEFT)
408
- self.unset_key(K.UP)
409
- self.unset_key(K.DOWN)
409
+ self.set_key(K.P1_RIGHT)
410
+ self.unset_key(K.P1_LEFT)
411
+ self.unset_key(K.P1_UP)
412
+ self.unset_key(K.P1_DOWN)
410
413
  elif vd.x < -5.0:
411
- self.set_key(K.LEFT)
412
- self.unset_key(K.RIGHT)
413
- self.unset_key(K.UP)
414
- self.unset_key(K.DOWN)
414
+ self.set_key(K.P1_LEFT)
415
+ self.unset_key(K.P1_RIGHT)
416
+ self.unset_key(K.P1_UP)
417
+ self.unset_key(K.P1_DOWN)
415
418
  elif abs(vd.x) * 2 < abs(vd.y):
416
419
  # Vertical
417
420
  if vd.y > 5.0:
418
- self.unset_key(K.RIGHT)
419
- self.unset_key(K.LEFT)
420
- self.unset_key(K.UP)
421
- self.set_key(K.DOWN)
421
+ self.unset_key(K.P1_RIGHT)
422
+ self.unset_key(K.P1_LEFT)
423
+ self.unset_key(K.P1_UP)
424
+ self.set_key(K.P1_DOWN)
422
425
  elif vd.y < -5.0:
423
- self.unset_key(K.LEFT)
424
- self.unset_key(K.RIGHT)
425
- self.set_key(K.UP)
426
- self.unset_key(K.DOWN)
426
+ self.unset_key(K.P1_LEFT)
427
+ self.unset_key(K.P1_RIGHT)
428
+ self.set_key(K.P1_UP)
429
+ self.unset_key(K.P1_DOWN)
427
430
  elif abs(vd.x) * 1.05 > abs(vd.y) or abs(vd.x) < 1.05 * abs(
428
431
  vd.y
429
432
  ):
430
433
  if vd.x < 0:
431
- self.set_key(K.LEFT)
434
+ self.set_key(K.P1_LEFT)
432
435
  elif vd.x > 0:
433
- self.set_key(K.RIGHT)
436
+ self.set_key(K.P1_RIGHT)
434
437
  if vd.y < 0:
435
- self.set_key(K.UP)
438
+ self.set_key(K.P1_UP)
436
439
  elif vd.y > 0:
437
- self.set_key(K.DOWN)
440
+ self.set_key(K.P1_DOWN)
438
441
  # else:
439
442
  # vd = finger_pos - self._right_finger_tap_pos
440
443
  # self.unset_key(K.A)
@@ -75,7 +75,7 @@ class Creature(Dynamic):
75
75
  }
76
76
  self._light = None
77
77
 
78
- self.attributes.speed = 5.0
78
+ # self.attributes.speed = 1.0
79
79
  # self.use_acceleration = True
80
80
  # self.use_friction = True
81
81
  # self.attributes.friction = 0.1
@@ -15,28 +15,29 @@ class ColorGate(Gate):
15
15
  self,
16
16
  px: float,
17
17
  py: float,
18
+ name: str = "ColorGate",
19
+ *,
20
+ color: GateColor,
21
+ tilemap=None,
22
+ dyn_id: int = -1,
18
23
  tileset_name: str,
19
24
  image_name: str,
20
25
  sprite_name: str,
21
26
  graphic_state: GraphicState,
22
27
  facing_direction: Direction,
23
- color: GateColor,
24
- tilemap=None,
25
- dyn_id: int = -1,
26
- name: str = "ColorGate",
27
28
  ):
28
29
  super().__init__(
29
30
  px,
30
31
  py,
31
32
  name,
32
- tileset_name,
33
- image_name,
34
- sprite_name,
35
- graphic_state,
36
- facing_direction,
37
- False,
38
- tilemap,
39
- dyn_id,
33
+ tilemap=tilemap,
34
+ dyn_id=dyn_id,
35
+ tileset_name=tileset_name,
36
+ image_name=image_name,
37
+ sprite_name=sprite_name,
38
+ graphic_state=graphic_state,
39
+ facing_direction=facing_direction,
40
+ bombable=False,
40
41
  )
41
42
  self.color = color
42
43
  self.type = ObjectType.COLOR_GATE
@@ -15,24 +15,28 @@ class Gate(Dynamic):
15
15
  self,
16
16
  px: float,
17
17
  py: float,
18
+ name: str = "Gate",
19
+ *,
20
+ tilemap=None,
21
+ dyn_id: int = 0,
18
22
  tileset_name: str,
19
23
  image_name: str,
20
24
  sprite_name: str,
21
25
  graphic_state: GraphicState,
22
26
  facing_direction: Direction,
23
27
  bombable: bool = False,
24
- tilemap=None,
25
- dyn_id: int = 0,
26
- name: str = "Gate",
27
28
  ):
28
- assert graphic_state in [
29
+ if graphic_state not in (
29
30
  GraphicState.OPEN,
30
31
  GraphicState.CLOSED,
31
32
  GraphicState.LOCKED,
32
- ], (
33
- f"graphic_state of Gate {name}{dyn_id} must be either 'open'"
34
- f", 'closed', or 'locked', but it {graphic_state}"
35
- )
33
+ ):
34
+ msg = (
35
+ f"graphic_state of Gate {name}{dyn_id} must be either 'open'"
36
+ f", 'closed', or 'locked', but it {graphic_state}"
37
+ )
38
+
39
+ raise ValueError(msg)
36
40
 
37
41
  super().__init__(px, py, name, tilemap, dyn_id)
38
42
 
@@ -126,6 +130,9 @@ class Gate(Dynamic):
126
130
  Gate(
127
131
  px=px,
128
132
  py=py,
133
+ name=obj.name,
134
+ tilemap=tilemap,
135
+ dyn_id=obj.object_id,
129
136
  tileset_name=obj.get_string("tileset_name"),
130
137
  image_name=obj.get_string("tileset_name"),
131
138
  sprite_name=obj.get_string("sprite_name"),
@@ -136,9 +143,6 @@ class Gate(Dynamic):
136
143
  obj.get_string("facing_direction", "south").upper()
137
144
  ],
138
145
  bombable=obj.get_bool("bombable"),
139
- tilemap=tilemap,
140
- dyn_id=obj.object_id,
141
- name=obj.name,
142
146
  )
143
147
  ]
144
148
 
@@ -3,6 +3,7 @@ from ..command import Command
3
3
 
4
4
  class CommandCloseDialog(Command):
5
5
  def start(self):
6
- self.engine.dialog_active = False
6
+ for player in self.players:
7
+ self.engine.trigger_dialog(False, player)
7
8
  self.engine.exit_dialog_active = False
8
9
  self.completed = True
@@ -147,12 +147,12 @@ DEFAULT_JOYSTICK_MAP = {
147
147
  }
148
148
 
149
149
  DEFAULT_TOUCHSCREEN_MAP = {
150
- K.UP: [[0, 0], [0.5, 1.0]],
151
- K.L: [[0, 0], [0.0625, 0.1111]],
152
- K.R: [[0.9375, 0], [1.0, 0.1111]],
153
- K.START: [[0.5, 0], [1.0, 0.3]],
154
- K.Y: [[0.5, 0.3], [0.75, 0.5]],
155
- K.X: [[0.75, 0.3], [1.0, 0.5]],
156
- K.B: [[0.5, 0.5], [0.75, 1.0]],
157
- K.A: [[0.75, 0.5], [1.0, 1.0]],
150
+ K.P1_UP: [[0, 0], [0.5, 1.0]],
151
+ K.P1_L: [[0, 0], [0.0625, 0.1111]],
152
+ K.P1_R: [[0.9375, 0], [1.0, 0.1111]],
153
+ K.P1_START: [[0.5, 0], [1.0, 0.3]],
154
+ K.P1_Y: [[0.5, 0.3], [0.75, 0.5]],
155
+ K.P1_X: [[0.75, 0.3], [1.0, 0.5]],
156
+ K.P1_B: [[0.5, 0.5], [0.75, 1.0]],
157
+ K.P1_A: [[0.75, 0.5], [1.0, 1.0]],
158
158
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mima-engine
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: A game engine based on pygame.
5
5
  Author-email: Stephan Balduin <stephan.balduin@mailbox.org>
6
6
  Classifier: Programming Language :: Python :: 3
@@ -1 +0,0 @@
1
- __version__ = "0.2.0"
File without changes
File without changes
File without changes