+static void on_collect_key(jumpnrun_item *self,
+ jumpnrun_game_state *state,
+ jumpnrun_level *lv) {
+ (void) lv;
+ self->flags |= JUMPNRUN_ITEM_COLLECTED;
+ ++state->keys;
+}
+
+static void on_collect_encrypted(jumpnrun_item *self,
+ jumpnrun_game_state *state,
+ jumpnrun_level *lv) {
+ if(state->keys != 0) {
+ on_collect_win(self, state, lv);
+ }
+}
+