test/snake.c

changeset 59
764fbb013252
parent 58
26ebb2f1e6e6
child 60
3954c551ded3
equal deleted inserted replaced
58:26ebb2f1e6e6 59:764fbb013252
47 } 47 }
48 48
49 static void create_fps_counter(void) { 49 static void create_fps_counter(void) {
50 asc_set_font(asc_font(ASC_FONT_REGULAR, 24)); 50 asc_set_font(asc_font(ASC_FONT_REGULAR, 24));
51 asc_ink_rgb(255, 0, 0); 51 asc_ink_rgb(255, 0, 0);
52 AscSceneNode* node = asc_text(10, 10, NULL); 52 AscSceneNode* node = asc_text( .x = 10, .y = 10 );
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) {
68 } 68 }
69 69
70 static void create_score_counter(void) { 70 static void create_score_counter(void) {
71 asc_set_font(asc_font(ASC_FONT_BOLD, 14)); 71 asc_set_font(asc_font(ASC_FONT_BOLD, 14));
72 asc_ink_rgb(0, 255, 0); 72 asc_ink_rgb(0, 255, 0);
73 AscSceneNode* node = asc_text(0, 0, "Score: 0"); 73 AscSceneNode* node = asc_text( .x = 0, .y = 0, .text = "Score: 0" );
74 asc_scene_add_behavior(node, update_score_counter); 74 asc_scene_add_behavior(node, update_score_counter);
75 asc_add_ui_node(node); 75 asc_add_ui_node(node);
76 } 76 }
77 77
78 int main(int argc, char** argv) { 78 int main(int argc, char** argv) {

mercurial