From 9a7714630675392c35aabaaee01e0d83b69230b7 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sat, 4 Jun 2011 01:05:07 +0200 Subject: digital/io-hub: add score to bonus squares, handle protected squares --- digital/io-hub/src/robospierre/top.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'digital/io-hub/src/robospierre/top.c') diff --git a/digital/io-hub/src/robospierre/top.c b/digital/io-hub/src/robospierre/top.c index f1f14cdd..7e3f4413 100644 --- a/digital/io-hub/src/robospierre/top.c +++ b/digital/io-hub/src/robospierre/top.c @@ -175,7 +175,14 @@ top_go_drop (void) uint8_t backward = logistic_global.collect_direction == DIRECTION_FORWARD ? 0 : ASSERV_BACKWARD; /* Go above or below the drop point. */ - if (drop_pos.v.y > PG_LENGTH / 2) + if (drop_pos.v.y < 350) + { + /* Protected zone. */ + drop_pos.v.x = PG_WIDTH / 2; + drop_pos.v.y = 350; + drop_pos.a = PG_A_DEG (45); + } + else if (drop_pos.v.y > PG_LENGTH / 2) { drop_pos.v.y -= 350 / 2; drop_pos.a = PG_A_DEG (-90); -- cgit v1.2.3