mima-engine 0.1.3__tar.gz → 0.1.5__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.
- {mima_engine-0.1.3 → mima_engine-0.1.5}/PKG-INFO +1 -1
- mima_engine-0.1.5/src/mima/__init__.py +1 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/backend/pygame_assets.py +1 -2
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/creature.py +11 -9
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/view/scene.py +6 -34
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima_engine.egg-info/PKG-INFO +1 -1
- mima_engine-0.1.3/src/mima/__init__.py +0 -1
- {mima_engine-0.1.3 → mima_engine-0.1.5}/README.md +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/pyproject.toml +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/setup.cfg +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/backend/__init__.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/backend/pygame_audio.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/backend/pygame_backend.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/backend/pygame_events.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/collision.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/engine.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/maps/__init__.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/maps/template.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/maps/tile.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/maps/tile_animation.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/maps/tile_info.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/maps/tile_layer.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/maps/tiled/__init__.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/maps/tiled/tiled_layer.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/maps/tiled/tiled_map.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/maps/tiled/tiled_object.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/maps/tiled/tiled_objectgroup.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/maps/tiled/tiled_template.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/maps/tiled/tiled_tile.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/maps/tiled/tiled_tileset.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/maps/tilemap.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/maps/tileset.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/maps/tileset_info.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/maps/transition_map.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/__init__.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/animated_sprite.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/attribute_effect.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/attributes.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/dynamic.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/effects/__init__.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/effects/colorize_screen.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/effects/light.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/effects/walking_on_grass.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/effects/walking_on_water.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/loader.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/projectile.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/sprite.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/world/__init__.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/world/color_gate.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/world/color_switch.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/world/container.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/world/floor_switch.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/world/gate.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/world/light_source.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/world/logic_gate.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/world/movable.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/world/oneway.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/world/pickup.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/world/switch.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/objects/world/teleport.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scene_engine.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/__init__.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/command.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/commands/__init__.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/commands/add_quest.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/commands/change_map.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/commands/close_dialog.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/commands/give_item.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/commands/give_resource.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/commands/move_map.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/commands/move_to.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/commands/oneway_move.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/commands/parallel.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/commands/play_sound.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/commands/present_item.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/commands/progress_quest.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/commands/quit_game.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/commands/save_game.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/commands/screen_fade.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/commands/serial.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/commands/set_facing_direction.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/commands/set_spawn_map.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/commands/show_choices.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/commands/show_dialog.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/commands/take_coins.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/scripts/script_processor.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/states/__init__.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/states/game_state.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/states/quest.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/types/__init__.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/types/alignment.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/types/blend.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/types/damage.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/types/direction.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/types/gate_color.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/types/graphic_state.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/types/keys.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/types/mode.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/types/nature.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/types/object.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/types/start.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/types/terrain.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/types/weapon_slot.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/usables/__init__.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/usables/item.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/usables/weapon.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/util/__init__.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/util/colors.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/util/constants.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/util/functions.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/util/input_defaults.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/util/logging.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/util/property.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/util/runtime_config.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/view/__init__.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima/view/camera.py +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima_engine.egg-info/SOURCES.txt +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima_engine.egg-info/dependency_links.txt +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima_engine.egg-info/requires.txt +0 -0
- {mima_engine-0.1.3 → mima_engine-0.1.5}/src/mima_engine.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.5"
|
|
@@ -10,7 +10,6 @@ import pygame
|
|
|
10
10
|
from ..maps.tiled.tiled_map import TiledMap
|
|
11
11
|
from ..maps.tiled.tiled_template import TiledTemplate
|
|
12
12
|
from ..maps.tiled.tiled_tileset import TiledTileset
|
|
13
|
-
from ..util.colors import WHITE
|
|
14
13
|
|
|
15
14
|
if TYPE_CHECKING:
|
|
16
15
|
from ..util import RuntimeConfig
|
|
@@ -283,7 +282,7 @@ class PygameAssets:
|
|
|
283
282
|
if name is None:
|
|
284
283
|
return None
|
|
285
284
|
else:
|
|
286
|
-
if self.rtc.flags
|
|
285
|
+
if self.rtc.flags.get("use_color", False):
|
|
287
286
|
name_color = f"{name}_color"
|
|
288
287
|
else:
|
|
289
288
|
name_color = name
|
|
@@ -42,6 +42,7 @@ class Creature(Dynamic):
|
|
|
42
42
|
# self.sprite.name = sprite_name
|
|
43
43
|
# self.sprite.num_frames = 2
|
|
44
44
|
self.attackable = True
|
|
45
|
+
self.knockable = True
|
|
45
46
|
|
|
46
47
|
self._knock_vx: float = 0.0
|
|
47
48
|
self._knock_vy: float = 0.0
|
|
@@ -198,15 +199,16 @@ class Creature(Dynamic):
|
|
|
198
199
|
return False
|
|
199
200
|
|
|
200
201
|
def knock_back(self, vx: float, vy: float, dist: float):
|
|
201
|
-
self.
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
202
|
+
if self.knockable:
|
|
203
|
+
self._knock_vx = vx
|
|
204
|
+
self._knock_vy = vy
|
|
205
|
+
self._knock_timer = dist
|
|
206
|
+
self.invincible_timer = dist + 0.2
|
|
207
|
+
# self.solid_vs_dyn = False
|
|
208
|
+
self.controllable = False
|
|
209
|
+
self.invincible = True
|
|
210
|
+
self.sprite.reset()
|
|
211
|
+
self.cancel_attack()
|
|
210
212
|
|
|
211
213
|
def can_act(self):
|
|
212
214
|
actable_states = [
|
|
@@ -5,17 +5,18 @@ from typing import TYPE_CHECKING, List, Optional
|
|
|
5
5
|
from mima.types.nature import Nature
|
|
6
6
|
from mima.util.constants import TILE_HEIGHT, TILE_WIDTH
|
|
7
7
|
|
|
8
|
-
|
|
9
8
|
from ..collision import (
|
|
10
9
|
check_object_to_map_collision,
|
|
11
10
|
check_object_to_object_collision,
|
|
12
11
|
)
|
|
13
12
|
from ..types.mode import Mode
|
|
13
|
+
from ..util.colors import BLACK, WHITE, Color
|
|
14
14
|
from ..util.constants import BIG_FONT_HEIGHT, BIG_FONT_WIDTH
|
|
15
15
|
from .camera import Camera
|
|
16
16
|
|
|
17
17
|
if TYPE_CHECKING:
|
|
18
18
|
from mima.objects.loader import ObjectLoader
|
|
19
|
+
|
|
19
20
|
from ..engine import MimaEngine
|
|
20
21
|
from ..maps.tilemap import Tilemap
|
|
21
22
|
from ..objects.dynamic import Dynamic
|
|
@@ -72,13 +73,10 @@ class Scene:
|
|
|
72
73
|
lines: str,
|
|
73
74
|
px: float,
|
|
74
75
|
py: float,
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
text_color: Optional[Color] = WHITE,
|
|
77
|
+
background_color: Optional[Color] = BLACK,
|
|
78
|
+
border_color: Optional[Color] = WHITE,
|
|
77
79
|
):
|
|
78
|
-
if background_color is None:
|
|
79
|
-
background_color = self.engine.rtc.colors["gb_dark"]
|
|
80
|
-
if border_color is None:
|
|
81
|
-
border_color = self.engine.rtc.colors["gb_light"]
|
|
82
80
|
|
|
83
81
|
max_line_length = 0
|
|
84
82
|
num_lines = len(lines)
|
|
@@ -102,36 +100,10 @@ class Scene:
|
|
|
102
100
|
num_lines * BIG_FONT_HEIGHT + 4,
|
|
103
101
|
border_color,
|
|
104
102
|
)
|
|
105
|
-
# self.apf.draw_line(
|
|
106
|
-
# Vector2D(pos.x - 2, pos.y - 2),
|
|
107
|
-
# Vector2D(pos.x - 2, pos.y + num_lines * BIG_FONT_HEIGHT + 1),
|
|
108
|
-
# border_color,
|
|
109
|
-
# ) # topleft to bottomleft
|
|
110
|
-
# self.apf.draw_line(
|
|
111
|
-
# Vector2D(pos.x + max_line_length * BIG_FONT_WIDTH + 1, pos.y - 2),
|
|
112
|
-
# Vector2D(
|
|
113
|
-
# pos.x + max_line_length * BIG_FONT_WIDTH + 1,
|
|
114
|
-
# pos.y + num_lines * BIG_FONT_HEIGHT + 1,
|
|
115
|
-
# ),
|
|
116
|
-
# border_color,
|
|
117
|
-
# ) # topright to bottomright
|
|
118
|
-
# self.apf.draw_line(
|
|
119
|
-
# Vector2D(pos.x - 2, pos.y - 2),
|
|
120
|
-
# Vector2D(pos.x + max_line_length * BIG_FONT_WIDTH + 1, pos.y - 2),
|
|
121
|
-
# border_color,
|
|
122
|
-
# ) # topleft to topright
|
|
123
|
-
# self.apf.draw_line(
|
|
124
|
-
# Vector2D(pos.x - 2, pos.y + num_lines * BIG_FONT_HEIGHT + 1),
|
|
125
|
-
# Vector2D(
|
|
126
|
-
# pos.x + max_line_length * BIG_FONT_WIDTH + 1,
|
|
127
|
-
# pos.y + num_lines * BGI_FONT_HEIGHT + 1,
|
|
128
|
-
# ),
|
|
129
|
-
# border_color,
|
|
130
|
-
# ) # bottomleft to bottomright
|
|
131
103
|
|
|
132
104
|
for idx, line in enumerate(lines):
|
|
133
105
|
self.engine.backend.draw_big_text(
|
|
134
|
-
line, px, py + idx * BIG_FONT_HEIGHT
|
|
106
|
+
line, px, py + idx * BIG_FONT_HEIGHT, text_color
|
|
135
107
|
)
|
|
136
108
|
|
|
137
109
|
def draw_map_and_objects(self):
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.3"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|