mirror of
https://gitlab.com/drummyfish/anarch.git
synced 2025-01-30 23:00:16 -05:00
Continue AI
This commit is contained in:
parent
b9ff4f4497
commit
f7d70b0a0c
4
levels.h
4
levels.h
@ -237,8 +237,8 @@ SFG_PROGRAM_MEMORY SFG_Level SFG_level0 =
|
||||
{SFG_LEVEL_ELEMENT_BARREL, {12, 4}}, {SFG_LEVEL_ELEMENT_BARREL, {15, 4}},
|
||||
{SFG_LEVEL_ELEMENT_BARREL, {24, 10}}, {SFG_LEVEL_ELEMENT_NONE, {0, 0}},
|
||||
{SFG_LEVEL_ELEMENT_BARREL, {13, 4}}, {SFG_LEVEL_ELEMENT_BARREL, {12, 6}},
|
||||
{SFG_LEVEL_ELEMENT_MONSTER1, {15, 7}}, {SFG_LEVEL_ELEMENT_NONE, {0, 0}},
|
||||
{SFG_LEVEL_ELEMENT_NONE, {0, 0}}, {SFG_LEVEL_ELEMENT_NONE, {0, 0}},
|
||||
{SFG_LEVEL_ELEMENT_MONSTER1, {15, 7}}, {SFG_LEVEL_ELEMENT_MONSTER1, {16, 8}},
|
||||
{SFG_LEVEL_ELEMENT_MONSTER1, {16, 7}}, {SFG_LEVEL_ELEMENT_NONE, {0, 0}},
|
||||
{SFG_LEVEL_ELEMENT_NONE, {0, 0}}, {SFG_LEVEL_ELEMENT_NONE, {0, 0}},
|
||||
{SFG_LEVEL_ELEMENT_NONE, {0, 0}}, {SFG_LEVEL_ELEMENT_NONE, {0, 0}},
|
||||
{SFG_LEVEL_ELEMENT_NONE, {0, 0}}, {SFG_LEVEL_ELEMENT_NONE, {0, 0}},
|
||||
|
36
main.c
36
main.c
@ -1010,28 +1010,38 @@ void SFG_monsterPerformAI(SFG_MonsterRecord *monster)
|
||||
|
||||
if (state == SFG_MONSTER_STATE_IDLE)
|
||||
{
|
||||
switch (SFG_random() % 2)
|
||||
switch (SFG_random() % 8)
|
||||
{
|
||||
case 0: state = SFG_MONSTER_STATE_GOING_E; break;
|
||||
case 1: state = SFG_MONSTER_STATE_GOING_W; break;
|
||||
case 2: state = SFG_MONSTER_STATE_GOING_N; break;
|
||||
case 3: state = SFG_MONSTER_STATE_GOING_S; break;
|
||||
case 4: state = SFG_MONSTER_STATE_GOING_NE; break;
|
||||
case 5: state = SFG_MONSTER_STATE_GOING_NW; break;
|
||||
case 6: state = SFG_MONSTER_STATE_GOING_SE; break;
|
||||
case 7: state = SFG_MONSTER_STATE_GOING_SW; break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case SFG_MONSTER_STATE_GOING_E:
|
||||
coordAdd[0] = 1;
|
||||
break;
|
||||
if (state == SFG_MONSTER_STATE_GOING_E ||
|
||||
state == SFG_MONSTER_STATE_GOING_NE ||
|
||||
state == SFG_MONSTER_STATE_GOING_SE)
|
||||
coordAdd[0] = 1;
|
||||
else if (state == SFG_MONSTER_STATE_GOING_W ||
|
||||
state == SFG_MONSTER_STATE_GOING_SW ||
|
||||
state == SFG_MONSTER_STATE_GOING_NW)
|
||||
coordAdd[0] = -1;
|
||||
|
||||
case SFG_MONSTER_STATE_GOING_W:
|
||||
coordAdd[0] = -1;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (state == SFG_MONSTER_STATE_GOING_N ||
|
||||
state == SFG_MONSTER_STATE_GOING_NE ||
|
||||
state == SFG_MONSTER_STATE_GOING_NW)
|
||||
coordAdd[1] = -1;
|
||||
else if (state == SFG_MONSTER_STATE_GOING_S ||
|
||||
state == SFG_MONSTER_STATE_GOING_SE ||
|
||||
state == SFG_MONSTER_STATE_GOING_SW)
|
||||
coordAdd[1] = 1;
|
||||
}
|
||||
|
||||
int16_t newPos[2];
|
||||
|
Loading…
Reference in New Issue
Block a user