forked from pygamelib/pygamelib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
breaking-changes.txt
48 lines (39 loc) · 2.73 KB
/
breaking-changes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
BoardItem.size() -> BoardItem.inventory_space()
Utils.get_key() -> Game.get_key() and is not static anymore
Utils colored functions : all in base.Text
All Structures are moved to board_items.
Utils.key -> game.key
Projectile: *args replaced by callback_parameters.
Changing a lot of variables into properties to manage internals ?
Sprites are not describing the same thing as before.
1.2.0 -> 1.3.0
META: We need some sort of code to show the severity of the breaking change. It should reflect the pain to update.
BoardItem: type in constructor is now item_type. This breaks a lot of things...
BoardItem: they are now all able to set/get overlappable, restorable, pickable and can_move
BoardItem: value has been moved to BoardItem.
BoardItem: change of behavior: now if both model and sprixel are given to the constructor, model is ignored (sprixel has priority). Need an example in the release note.
BoardItem: there was a conflict with inventory_space. It was defined both as a property and a method. The method has been removed. Concretely: you might have to remove parenthesis when using any_item.inventory_space (vs the old any_item.inventory_space()).
pygamelib.actuators: all the next_move() methods now returns pygamelib.constants.NO_DIR instead of None if there's no more move to use.
[non breaking][important] Void cells are now initialized with knowing their position.
[non breaking][important] The observer system has some limitations. One being that notifications are not passed down by attributes.
For example:
screen = Game.instance().screen
text = base.Text("This is an example", fg_color=core.Color(125,125,125))
screen.place(text, screen.vcenter, screen.hcenter)
# The screen will be updated
screen.update()
# In that case the screen will also be updated because Text (as all PglBaseObject objects) notify Screen from all it's direct changes.
color = text.fg_color
color.r = 255
text.fg_color = color
screen.update()
# In that case however you have to use Screen.force_update() as the change notification is not passed down (or up) for Color to Text to Screen.
text.fg_color.r = 255
screen.update() # Screen is NOT repainted
screen.force_update() # Screen is going to be repainted
# You can manually attach the color to the screen to force the behavior
text.fg_color.attach(screen)
# And in that case, changing a color element will have the intended effect.
text.fg_color.g = 255
screen.update() # Here the screen is going to be repainted.
[non breaking][important] Player: the player object is not anymore forced to be non overlappable. Overlappable is now a property that can be set, like any board item.