I see opportunities for consolidation. Can we take advantage of them? Let’s see. We change something unexpected. Is it too clever? Nahhh! The Button content object now supports two different textures, one showing it up, and one with it down. The Dungeon sends interact_with_player When Dot steps into the Button’s cell. The Button publishes two messages, its name + ‘button_pressed’, and ‘state_number’. The code in the Button’s ContentView listens for the ‘state_number’ event and sets the displayed texture to the corresponding texture in the Sprite. Meanwhile, the AppearingContent object subscribes to name + ‘button_pressed’, and when it sees that message, it publishes ‘item_visibility’. Meanwhile, DungeonView currently subscribes to three publications: ‘remove_item’, ‘item_visibility’, and ‘state_number’. It handles ‘remove_item’ itself, and passes the other two publications on to the view corresponding to the content item that published the message. Meanwhile, the ContentView handles…
No comments yet. Log in to reply on the Fediverse. Comments will appear here.