From 8dd0fb4860163e8aaf69ad4c91df5f4f644bb817 Mon Sep 17 00:00:00 2001 From: Serge Vakulenko Date: Thu, 3 Dec 2015 21:43:43 -0800 Subject: [PATCH] Flappy game: reduce flickering. --- share/examples/gpanel/flappy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/share/examples/gpanel/flappy.c b/share/examples/gpanel/flappy.c index 25a1006..090abbe 100644 --- a/share/examples/gpanel/flappy.c +++ b/share/examples/gpanel/flappy.c @@ -225,10 +225,11 @@ void draw_loop() { /* Clear moving items. */ clear_pillar(pillar_pos, gap_pos); - clear_flappy(fx, fy); /* Move items. */ if (running) { + clear_flappy(fx, fy); + fy += fall_rate; fall_rate++; @@ -243,8 +244,8 @@ void draw_loop() } /* Draw moving items & animate. */ - draw_pillar(pillar_pos, gap_pos); draw_flappy(fx, fy); + draw_pillar(pillar_pos, gap_pos); switch (wing) { case 0: case 1: