Pokitto turn based strategy game.
Diff: wars.cpp
- Revision:
- 5:ef209f39269a
- Parent:
- 4:e77580278416
- Child:
- 6:2b8e70d68247
--- a/wars.cpp Sun Dec 10 04:03:16 2017 +0000 +++ b/wars.cpp Sun Dec 10 04:19:20 2017 +0000 @@ -233,12 +233,13 @@ char id_names[][8] { {"SOLDIER"}, {"ORC"}, - {"HEAVY"} + {"HEAVY"}, + {"SNIPER"} }; char TRAITS[][8] { {""}, {"FAST"}, - {"SLOW"}, + {"HULKISH"}, }; struct Hero { @@ -286,6 +287,15 @@ disp.invisiblecolor = 13; if (draw) disp.drawBitmap((dx)+ox,(dy)+oy,sprites[spr_id], 0, flip); disp.invisiblecolor = 12; + if (id==ID_SNIPER&&team==TEAM_USER) { + int lx = dx+ox+16; + int ly = dy+oy+5; + if (game.frameCount/10%2==1) ly++; + if (flip) lx-=18; + + disp.setColor(0); + disp.drawLine(lx,ly,lx+1,ly); + } }; bool inRange(Hero * enemy) { return (dist(x, y, enemy->x, enemy->y)<=range); @@ -315,11 +325,11 @@ int spawn_points; Base() {}; Base(int _x, int _y, int _id, int _team) { - spawn_points = 10; x = _x; y = _y; id = _id; team = _team; + spawn_points = 10; }; void Draw() {