Initial setup of Monster structures
This commit is contained in:
parent
8547054a60
commit
cbbee7aaa4
@ -129,6 +129,7 @@
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Monster.h" />
|
||||
<ClInclude Include="olcPGEX_TransformedView.h" />
|
||||
<ClInclude Include="olcPixelGameEngine.h" />
|
||||
<ClInclude Include="olcUTIL_Animate2D.h" />
|
||||
@ -137,6 +138,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp" />
|
||||
<ClCompile Include="MonsterData.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
@ -30,10 +30,16 @@
|
||||
<ClInclude Include="olcUTIL_Geometry2D.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Monster.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MonsterData.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
65
Crawler/InitialConcept.txt
Normal file
65
Crawler/InitialConcept.txt
Normal file
@ -0,0 +1,65 @@
|
||||
Intro:
|
||||
Sizes are in proportion to Player Character Size.
|
||||
Character in test will be a Warrior Tank kind of character.
|
||||
Dungeon map can be just a single corridor for first test.
|
||||
Monster Aggro range needs to be figured out.
|
||||
Probably better to only spawn Monster if you get close enough to there location.
|
||||
I will play Realm of the mad god the next days to check how enemy AI works there.
|
||||
I dont want to copy alot of that game but i feel like they are doing combat kinda right.
|
||||
|
||||
|
||||
Player Stats
|
||||
Hp: 100
|
||||
Atk: 10
|
||||
Move-Spd.: 100%
|
||||
Size: 100%
|
||||
Attack Range: 150
|
||||
|
||||
Attack Range: 100 Range = 1x Player Character Hitbox
|
||||
|
||||
Leftclick: (Auto Attack)
|
||||
Cooldown: 0,75 Second
|
||||
|
||||
Righclick: (Block)
|
||||
Cooldown: 15 Seconds
|
||||
Blocks all damage for the next 3 seconds.
|
||||
|
||||
Button 1: Ground Slam
|
||||
Cooldown: 20 Seconds
|
||||
Mana: no Mana during first concept Test
|
||||
Dmg: Atk x 2.5 (25 in this case)
|
||||
Range: 300 (AoE)
|
||||
Location: Center of character.
|
||||
|
||||
Monster:
|
||||
|
||||
Monster A
|
||||
HP: 10
|
||||
Atk: 5
|
||||
Move-Spd: 110%
|
||||
Size: 80%
|
||||
Strategie: Runs Towards Player, damage on collision
|
||||
|
||||
Monster B
|
||||
HP: 30
|
||||
Atk: 10
|
||||
Move-Spd: 80%
|
||||
Size: 100%
|
||||
Strategie: Shoots projectiles with 800 Range, tries to stay 600-700 Range away from player, 1 sec. attack cd
|
||||
|
||||
Monster C
|
||||
HP: 25
|
||||
Atk: 10
|
||||
Move-Spd: 95%
|
||||
Size: 120%
|
||||
Strategie: Runs towards player, damage on collision
|
||||
|
||||
|
||||
Encounter:
|
||||
1: 2x A
|
||||
2: 2x A 1x C
|
||||
3: 2x B
|
||||
4: 3x A 2x B
|
||||
5: 2x B 2x C
|
||||
6: 5x C
|
||||
7: 5x B
|
45
Crawler/Monster.h
Normal file
45
Crawler/Monster.h
Normal file
@ -0,0 +1,45 @@
|
||||
#include "olcPixelGameEngine.h"
|
||||
|
||||
enum MonsterStrategy{
|
||||
RUN_TOWARDS,
|
||||
SHOOT_AFAR
|
||||
};
|
||||
|
||||
struct MonsterData{
|
||||
private:
|
||||
int hp;
|
||||
int atk;
|
||||
float moveSpd;//1.0=100%
|
||||
float size;
|
||||
MonsterStrategy strategy;
|
||||
public:
|
||||
MonsterData(){};
|
||||
MonsterData(int hp,int atk,float moveSpd=1.0f,float size=1.0f,MonsterStrategy strategy=RUN_TOWARDS):
|
||||
hp(hp),atk(atk),moveSpd(moveSpd),size(size),strategy(strategy){}
|
||||
int GetHealth(){
|
||||
return hp;
|
||||
}
|
||||
int GetAttack(){
|
||||
return atk;
|
||||
}
|
||||
float GetMoveSpdMult(){
|
||||
return moveSpd;
|
||||
}
|
||||
float GetSizeMult(){
|
||||
return size;
|
||||
}
|
||||
MonsterStrategy GetAIStrategy(){
|
||||
return strategy;
|
||||
}
|
||||
};
|
||||
|
||||
enum MonsterName{
|
||||
SLIME_GREEN,
|
||||
SLIME_BLUE,
|
||||
SLIME_RED,
|
||||
SLIME_YELLOW,
|
||||
};
|
||||
|
||||
struct Monster{
|
||||
|
||||
};
|
10
Crawler/MonsterData.cpp
Normal file
10
Crawler/MonsterData.cpp
Normal file
@ -0,0 +1,10 @@
|
||||
#include "olcPixelGameEngine.h"
|
||||
#include "Monster.h"
|
||||
|
||||
|
||||
std::map<MonsterName,MonsterData>MONSTER_DATA={
|
||||
{SLIME_GREEN,MonsterData(10,5,1.1f,0.8f,MonsterStrategy::RUN_TOWARDS)},
|
||||
{SLIME_BLUE,MonsterData(30,10,0.8f,1.0f,MonsterStrategy::SHOOT_AFAR)},
|
||||
{SLIME_RED,MonsterData(25,10,0.95f,1.2f,MonsterStrategy::RUN_TOWARDS)},
|
||||
//{SLIME_YELLOW,{}},
|
||||
};
|
@ -4,12 +4,12 @@
|
||||
#define OLC_PGEX_TRANSFORMEDVIEW
|
||||
#include "olcPGEX_TransformedView.h"
|
||||
#include "olcUTIL_Animate2D.h"
|
||||
|
||||
using namespace olc;
|
||||
using namespace olc::utils;
|
||||
#include "Monster.h"
|
||||
|
||||
const vi2d WINDOW_SIZE={24*8,24*8};
|
||||
|
||||
extern std::map<MonsterName,MonsterData>MONSTER_DATA;
|
||||
|
||||
enum AnimationState{
|
||||
WALK_S,WALK_E,WALK_N,WALK_W,
|
||||
IDLE_S,IDLE_E,IDLE_N,IDLE_W
|
||||
@ -121,6 +121,8 @@ public:
|
||||
player.pos={4*24,4*24};
|
||||
player.UpdateAnimation(IDLE_S);
|
||||
|
||||
std::cout<<MONSTER_DATA[SLIME_BLUE].GetHealth()<<std::endl;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -6693,3 +6693,5 @@ namespace olc
|
||||
// O------------------------------------------------------------------------------O
|
||||
// | END OF OLC_PGE_APPLICATION |
|
||||
// O------------------------------------------------------------------------------O
|
||||
|
||||
using namespace olc;
|
@ -210,3 +210,5 @@ namespace olc::utils::Animate2D
|
||||
std::unordered_map<StatesEnum, size_t> m_mapStateIndices;
|
||||
};
|
||||
}
|
||||
|
||||
using namespace olc::utils;
|
@ -256,3 +256,5 @@ namespace olc::utils
|
||||
olc::vi2d m_vScreenSize = { 16,15 };
|
||||
};
|
||||
}
|
||||
|
||||
using namespace olc::utils;
|
@ -1044,3 +1044,5 @@ namespace olc::utils::geom2d
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
using namespace olc::utils;
|
Loading…
x
Reference in New Issue
Block a user