adding animatronical assets
This commit is contained in:
parent
c60a0ce031
commit
5796b5c582
236 changed files with 139 additions and 1 deletions
41
games/animatronical/q1/a1/src/scenes/scenes.cpp
Normal file
41
games/animatronical/q1/a1/src/scenes/scenes.cpp
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#include "game.h"
|
||||
// 0 1 2 3 4 5 6
|
||||
// 7 8 9 10
|
||||
// 11 12 13
|
||||
// 14 15 16
|
||||
// N S L R
|
||||
std::vector<char>opposites{1,0,3,2};
|
||||
std::vector sides{
|
||||
'n','s','l','r'
|
||||
};
|
||||
#define N (-1)
|
||||
std::vector<std::vector<char>> map{
|
||||
{N,7,N,1} ,{N,8,0,2} , {N,3,1,N} ,{2,4,N,N},{3,N,5,N},{10,N,6,4},{9,N,N,5},
|
||||
|
||||
{0,11,N,8} ,{1,13,7,N}, {N,6,N,10},{N,5,9,6},
|
||||
|
||||
{7,14,N,12},{N,N,11,N}, {8,16,N,N},
|
||||
|
||||
{11,N,N,15},{N,N,14,16},{13,N,15,N}
|
||||
};
|
||||
#undef N
|
||||
|
||||
|
||||
char moveentity(char pos,char dir,bool backwards) {
|
||||
char tmpos=-1;
|
||||
if (backwards)tmpos= map[pos][opposites[dir]];
|
||||
else tmpos=map[pos][dir];
|
||||
if (tmpos==-1) return pos;
|
||||
return tmpos;
|
||||
}
|
||||
std::vector<std::vector<char>> look={
|
||||
{3,2,0,1},
|
||||
{2,3,1,0},
|
||||
{1,0}
|
||||
};
|
||||
char rotateentity(char pos,char dir, bool clockwise) {
|
||||
if (pos==13) {
|
||||
return look[2][dir];
|
||||
}
|
||||
return look[!clockwise][dir];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue