Lines Matching refs:ball_pos
101 static struct x_y ball_pos = BALL_START; variable
190 ball_pos = BALL_START; in game_init()
192 ball_pos.y = -1; in game_init()
232 return (ball_pos.y >= BALL_POS_Y_MIN); in ball_visible()
336 ball_pos.x += ball_vel.x; in game_refresh()
337 ball_pos.y += ball_vel.y; in game_refresh()
340 if (ball_vel.y < 0 && ball_pos.y < BALL_POS_Y_MIN) { in game_refresh()
342 ball_pos.y = -ball_pos.y; in game_refresh()
346 ble_send_ball(BALL_POS_X_MAX - ball_pos.x, ball_pos.y, in game_refresh()
354 if (ball_pos.x < BALL_POS_X_MIN) { in game_refresh()
355 ball_pos.x = -ball_pos.x; in game_refresh()
358 } else if (ball_pos.x > BALL_POS_X_MAX) { in game_refresh()
359 ball_pos.x = (2 * BALL_POS_X_MAX) - ball_pos.x; in game_refresh()
365 if (ball_vel.y > 0 && ball_pos.y > BALL_POS_Y_MAX) { in game_refresh()
366 if (ball_pos.x < REAL_TO_VIRT(paddle_x) || in game_refresh()
367 ball_pos.x >= REAL_TO_VIRT(paddle_x + 2)) { in game_refresh()
375 ball_pos.y = (2 * BALL_POS_Y_MAX) - ball_pos.y; in game_refresh()
395 ball_pos.x = x_pos; in pong_ball_received()
396 ball_pos.y = y_pos; in pong_ball_received()
453 ball_pos.x -= PIXEL_SIZE; in button_pressed()
471 ball_pos.x += PIXEL_SIZE; in button_pressed()
551 img.row[VIRT_TO_REAL(ball_pos.y)] = in main()
552 BIT(VIRT_TO_REAL(ball_pos.x)); in main()