PASO 17: ahora agregaremos newrise a bally para obtener la nueva coordenada y para el balón de fútbol.
En , arrastre Addition .
¡Cambie my_var a end_y y reemplace 2+3 con newrise+bally !
Ahora tenemos una nueva coordenada y para nuestra pelota. Usaremos netx como nuestra coordenada x, ya que queremos que la pelota se mueva hacia la red, pero end_y como la coordenada y para que la pelota solo golpee la red si el usuario estaba en lo correcto.
To navigate the page using the TAB key, first press ESC to exit the code editor.
t = codesters.Teacher()
ends = t.find_text("end_y")
try:
tval1 = ends[0][1].replace(" ", "")
except:
tval1 = "DNE"
t1 = TestObjective()
t1.add_success(tval1 == "end_y=newrise+bally" , "Great Job!")
t1.add_success(tval1 == "end_y=bally+newrise", "Great Job!")
t1.add_failure(tval1 == "DNE", "Did you drag out Addition and change my_var to end_y?")
t1.add_failure("+" not in tval1, "Did you drag out an Addition command?")
t1.add_failure("newrise" not in tval1, "Did you change the 2 to newrise?")
t1.add_failure("bally" not in tval1, "Did you change the 3 to bally?")
tester = TestManager()
tester.add_test_list([t1])
tester.run_tests()
tester.display_first_feedback()
Are you already running a Codesters project in another tab or window?
Micro:bit can only connect to one web page at a time.
Try stopping other Codesters projects or closing
other tabs or windows that may be using your Micro:bit.
If that doesn't fix the problem try disconnecting your Micro:bit,
reloading this page, and reconnecting your Micro:bit.