adding animatronical assets

This commit is contained in:
kin fuyuki 2026-02-23 12:41:21 -03:00
commit 5796b5c582
No known key found for this signature in database
GPG key ID: 0E4E8E519FB71401
236 changed files with 139 additions and 1 deletions

View 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];
}