test/snake.c

changeset 62
5a592625e2f9
parent 60
3954c551ded3
child 63
e3cacdd636e4
equal deleted inserted replaced
61:b7954818a6b7 62:5a592625e2f9
53 asc_scene_add_behavior(node, update_fps_counter); 53 asc_scene_add_behavior(node, update_fps_counter);
54 asc_add_ui_node(node); 54 asc_add_ui_node(node);
55 } 55 }
56 56
57 static void update_score_counter(AscSceneNode *node) { 57 static void update_score_counter(AscSceneNode *node) {
58 // tie to bottom left of the screen 58 // tie to bottom right of the screen
59 if (asc_window_active->resized) { 59 if (asc_window_active->resized) {
60 asc_vec2i bottom_left = asc_window_active->dimensions; 60 asc_vec2i bottom_right = asc_window_active->dimensions;
61 asc_vec2i scale = asc_get_scale2d(node); 61 asc_vec2i scale = asc_get_scale2d(node);
62 asc_set_position2d( 62 asc_set_position2d(
63 node, 63 node,
64 bottom_left.x - scale.width - 10, 64 bottom_right.x - scale.width - 10,
65 bottom_left.y - scale.height - 10 65 bottom_right.y - scale.height - 10
66 ); 66 );
67 } 67 }
68 } 68 }
69 69
70 static void create_score_counter(void) { 70 static void create_score_counter(void) {

mercurial