Skip to content

Commit

Permalink
map start
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita-str committed Feb 19, 2021
1 parent 415f30e commit bc246af
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 2 deletions.
Empty file added GameMap.cpp
Empty file.
5 changes: 5 additions & 0 deletions GameMap.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#ifndef MAIN_Gmap_H
#define MAIN_Gmap_H


#endif
12 changes: 10 additions & 2 deletions LiveObjSprite.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct LiveObjSprite
}
}

cur_spr = &spr_states.find(cur_state)->second.find(cur_dir)->second;
SetCurSprite();
}

bool SetDir(E_Dir new_dir)
Expand Down Expand Up @@ -66,10 +66,18 @@ struct LiveObjSprite
private:
void SpritePrepare()
{
cur_spr = &spr_states.find(cur_state)->second.find(cur_dir)->second;
SetCurSprite();
cur_spr->Restart();
}

inline void SetCurSprite()
{
cur_spr = &spr_states.find(cur_state)->second.find(cur_dir)->second;
if (cur_spr == nullptr) {
cur_spr = &spr_states.find(E_LiveObjState::Idle)->second.find(cur_dir)->second;
}
}

std::map< E_LiveObjState, std::map<E_Dir, Sprite>> spr_states;
E_Dir cur_dir = E_Dir::DOWN;
E_LiveObjState cur_state = E_LiveObjState::Idle;
Expand Down
30 changes: 30 additions & 0 deletions maps/A.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
z+
#############.####################
#C.E...#.........#...............#
#......#.........#........E......#
#......#.........#...............#
#E.E...#.........#...............#
##.######.#####.####.##..........#
#...........#.........#..........#
#...........#.........#####.######
#...........#.........#..........#
#...........#.........#..........#
O....E......#.........#...........
####...###########.####..........#
#.........#...........#..........#
#.........#...........#..........#
#...G............E....#...E...E..#
#.........#...........#..........#
#.........#...........#.....K....#
###########.######################
z-

E: 1, 0, 1, 1, 1, 0, 0, 0

/E: - type of enemies in the same order as they stay on map

/O is openable door (you need a key)
/z+ map begin
/z- map end

/C is chest
33 changes: 33 additions & 0 deletions maps/F.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
z+
####################.####################
#.................#...#.................#
#.................#...#.................#
#....G............#...#.................#
#.................#...#.................#
#.................#.....................#
#.................#...#.................#
#.................#...#.................#
#.................#...#.................#
#.................#...#.................#
#.................#...#.................#
#.................#...#.................#
#.................#...#.................#
#...............###...###...............#
##.##############.......#################
#.......................................O
##.##############.......#################
#...............###...###...............#
#.................#...#.................#
#.................#...#.................#
#.................#...#.................#
#.................#...#.................#
#.................#...#.................#
#.................#...#.................#
#.................#...#.................#
#.................#...#.................#
#.................#.....................#
#...G.............#...#.................#
#.................#...#.................#
#.................#...#.................#
####################.####################
z-
6 changes: 6 additions & 0 deletions maps/M_OF_M.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
AAAAA
AAAAA
AAFAA
AAAAA
AAAAA

0 comments on commit bc246af

Please sign in to comment.