Make monster flash
This commit is contained in:
@@ -61,6 +61,12 @@ int main (void)
|
|||||||
navswitch_tick++;
|
navswitch_tick++;
|
||||||
if (navswitch_tick >= LOOP_RATE / NAVSWITCH_RATE)
|
if (navswitch_tick >= LOOP_RATE / NAVSWITCH_RATE)
|
||||||
{
|
{
|
||||||
|
static int count = 0;
|
||||||
|
|
||||||
|
count++;
|
||||||
|
if (running && count % 4 == 0)
|
||||||
|
monster_toggle ();
|
||||||
|
|
||||||
navswitch_tick = 0;
|
navswitch_tick = 0;
|
||||||
|
|
||||||
navswitch_update ();
|
navswitch_update ();
|
||||||
|
|||||||
@@ -98,6 +98,13 @@ void monster_move (int8_t dx, int8_t dy)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void monster_toggle (void)
|
||||||
|
{
|
||||||
|
tinygl_pixel_set (things[0].pos, ! tinygl_pixel_get (things[0].pos));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void thing_move (uint8_t this)
|
static void thing_move (uint8_t this)
|
||||||
{
|
{
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
|
|||||||
@@ -3,16 +3,14 @@
|
|||||||
|
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
||||||
void things_create (void);
|
|
||||||
|
|
||||||
void things_twinkle (void);
|
|
||||||
|
|
||||||
void things_display (uint8_t tick);
|
|
||||||
|
|
||||||
bool things_killed_p (void);
|
bool things_killed_p (void);
|
||||||
|
|
||||||
void monster_move (int8_t dx, int8_t dy);
|
void things_create (void);
|
||||||
|
|
||||||
void things_move (void);
|
void things_move (void);
|
||||||
|
|
||||||
|
void monster_move (int8_t dx, int8_t dy);
|
||||||
|
|
||||||
|
void monster_toggle (void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user