Change your game by adding new components, including tokens and obstacles.

  • Create the list of words that you want the player to click on. In game design, these are called tokens.
  • Create the list of words that you want to player to avoid. These are called obstacles.
  • The tokens go in the strong_pws list. The obstacles go in weak_pws. Change the list names to fit your game.
  • Consult your packet and prototype to determine which new components you want to add to your game.

To navigate the page using the TAB key, first press ESC to exit the code editor.

stage.set_background("underwater") score = 0 score_board = codesters.Display(score) weak_pws = ["password", "password123", "123456", "hello1", "snuffles", "emma2003"] strong_pws = ["GgbvTa581!@", "@Mjrc0olguy!", "007jmSB0nd!", "108turt!es762", "Avv3SoMe!305"] all_pws = strong_pws + weak_pws password = codesters.Text("password") def interval(): rand_x = random.randint(-225, 225) rand_y = random.randint(-225, 225) rand_pw = random.choice(all_pws) password.set_text(rand_pw) password.go_to(rand_x, rand_y) stage.event_interval(interval, 3) def click(sprite): global score pw_text = password.get_text() if pw_text in weak_pws: score -= 1 score_board.update(score) if pw_text in strong_pws: score += 1 score_board.update(score) rand_x = random.randint(-240, 240) rand_y = random.randint(-240, 240) rand_pw = random.choice(all_pws) password.set_text(rand_pw) password.go_to(rand_x, rand_y) if score == 10: text = codesters.Text("You Win!", 0, 150, "red") password.hide() password.event_click(click)
  • Run Code
  • Enviar Trabajo
  • Actividad Siguiente
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)