changeset 23:330e58fb01aa

simple object selection
author William Morgan <bill@mrgn.org>
date Mon, 13 Jan 2014 23:05:30 -0800
parents b725a715b358
children 2cee3dc5fe4d
files src/main.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/main.c	Mon Jan 13 21:48:22 2014 -0800
+++ b/src/main.c	Mon Jan 13 23:05:30 2014 -0800
@@ -86,9 +86,11 @@
 		clear_cursor();
 		cursor_x += CURSOR_WIDTH;
 	}
+	if (went_down & BUTTON_B && !running) {
+		cursor_selection = (cursor_selection + 1) % GOAL;
+	}
 	if (went_down & BUTTON_A && !running) {
-		//u16 type_to_place = EMPTY;
-		place_object(WALL, cursor_x, cursor_y);
+		place_object(cursor_selection, cursor_x, cursor_y);
 		gen_distances(38, 14);
 		if (distances[122/16] == 0xFFFF)
 		{
@@ -130,7 +132,7 @@
 	{
 		VDP_waitVSync();
 		VDP_updateSprites();
-		if ((getTick() % CURSOR_BLINK_RATE) == 0) {
+		if ((getTick() % CURSOR_BLINK_RATE) == 0 && !running) {
 			VDP_setTileMap(VDP_PLAN_A, tileinfo[cursor_selection][0], cursor_x,     cursor_y);
 			VDP_setTileMap(VDP_PLAN_A, tileinfo[cursor_selection][1], cursor_x + 1, cursor_y);
 			VDP_setTileMap(VDP_PLAN_A, tileinfo[cursor_selection][2], cursor_x,     cursor_y + 1);