7 #pragma disable_warning 85
10 typedef signed char SHORTINT
;
12 void App_PutSprite (SHORTINT x
, SHORTINT y
, SHORTINT spr
)
16 static SHORTINT Labirint_objCell
, Labirint_manX
, Labirint_manY
, Labirint_manDirX
, Labirint_manDirY
;
17 static BOOLEAN Labirint_manPresent
;
19 static SHORTINT
Labirint_GetManSprite (void)
24 static BOOLEAN
Labirint_ManCanGo (void)
29 static BOOLEAN
Labirint_ManGoing (SHORTINT x
, SHORTINT y
)
34 static void Labirint_SetCell (SHORTINT x
, SHORTINT y
, SHORTINT cell
)
38 static void Labirint_TryMoveMan (void)
40 SHORTINT x
, y
, manSprite
;
41 if (Labirint_ManCanGo()) {
42 x
= (Labirint_manX
+ Labirint_manDirX
) + Labirint_manDirX
;
43 y
= (Labirint_manY
+ Labirint_manDirY
) + Labirint_manDirY
;
44 Labirint_manPresent
= Labirint_ManGoing(x
, y
);
45 if (!Labirint_manPresent
) {
48 manSprite
= Labirint_GetManSprite();
49 Labirint_SetCell(x
, y
, manSprite
);
50 App_PutSprite(Labirint_manX
, Labirint_manY
, 0);
51 // Assembly fails for the next two lines.
52 Labirint_manX
= Labirint_manX
+ Labirint_manDirX
;
53 Labirint_manY
= Labirint_manY
+ Labirint_manDirY
;
57 App_PutSprite(Labirint_manX
, Labirint_manY
, manSprite
);