예제 #1
0
파일: flappybird.py 프로젝트: sadekj/wecode
def check_walls(rectangles):
	global score
	for r in rectangles:
		if (r.xcor() <= - wecode.get_screen_width()):
			random_y = wecode.get_random_y()
			if (r.ycor() + r.get_height() < 0 and random_y + r.get_height() < 0):
				r.goto(r.xcor(),random_y)

			random_y = wecode.get_random_y()
			if (r.ycor() > 0 and random_y > 0):
				r.goto(r.xcor(),random_y)

			r.goto(wecode.get_screen_width(),r.ycor())
			r.color("black")
			score +=1
예제 #2
0
파일: flappybird.py 프로젝트: sadekj/wecode
rectangles.append(rectangle)

rectangle = wecode.create_rectangle(rectangle12)
rectangles.append(rectangle)

rectangle = wecode.create_rectangle(rectangle13)
rectangles.append(rectangle)

rectangle = wecode.create_rectangle(rectangle14)
rectangles.append(rectangle)

user_rect = wecode.create_rectangle(user_rect)
rectangles.append(user_rect)

wecode.pd()
wecode.goto(-wecode.get_screen_width(),0)
wecode.goto(wecode.get_screen_width(),0)

def check_walls(rectangles):
	global score
	for r in rectangles:
		if (r.xcor() <= - wecode.get_screen_width()):
			random_y = wecode.get_random_y()
			if (r.ycor() + r.get_height() < 0 and random_y + r.get_height() < 0):
				r.goto(r.xcor(),random_y)

			random_y = wecode.get_random_y()
			if (r.ycor() > 0 and random_y > 0):
				r.goto(r.xcor(),random_y)

			r.goto(wecode.get_screen_width(),r.ycor())