home *** CD-ROM | disk | FTP | other *** search
- // ---------- pointer.cpp
-
- #include "pointer.h"
-
- CUELIST(Pointer)
- KEYSTROKE(UP, on_up)
- KEYSTROKE(DN, on_down)
- ENDCUELIST
-
- Pointer::Pointer(int s1, int s2, int s3, int s4, int s5)
- : Player("pointer.gfx")
- {
- selection = 0;
- sels = 2;
- ys[0] = s1;
- ys[1] = s2;
- ys[2] = s3;
- ys[3] = s4;
- ys[4] = s5;
- if (s3)
- sels++;
- if (s4)
- sels++;
- if (s5)
- sels++;
- set_imageno(1);
- }
- void Pointer::update_position()
- {
- setxy(8, ys[selection]);
- }
-
- void Pointer::on_up()
- {
- if (selection-- == 0)
- selection = sels-1;
- }
- void Pointer::on_down()
- {
- if (++selection == sels)
- selection = 0;
- }
-