def incr_health(state, points): hp = get_health(state) hp += points user.set_data(state, USERDATA_HEALTH, hp) text.set_text_sprite(state, ENT_TEXT_HEALTH, get_health_text(state), FONT_NAME, True)
def incr_score(state, points): score = user.get_data(state, USERDATA_SCORE) score += points user.set_data(state, USERDATA_SCORE, score) text.set_text_sprite(state, ENT_TEXT_SCORE, get_score_text(state), FONT_NAME, True)