-
Notifications
You must be signed in to change notification settings - Fork 58
Monsters #170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Monsters #170
Conversation
* finish Spider and add to EntityRenderDispatcher * finish Skeleton, Arrow, ArrowRenderer class and add to EntityRenderDispatcher * instantiate Bow in item init fn * adjusted HumanoidMobRenderer to support carried items
* Added platform-agnostic AppPlatform::readAssetFile()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See code comments.
Additionally, the arrows emit the "drr" sound as soon as they are fired, and upon hitting the ground, they disappear.
@@ -192,6 +192,15 @@ void Player::aiStep() | |||
} | |||
} | |||
|
|||
ItemInstance* Player::getCarriedItem() | |||
{ | |||
auto inst = m_pInventory->getItem(m_pInventory->m_selectedHotbarSlot); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't use auto here, need to maintain C++03 support.
|
||
void Skeleton::checkHurtTarget(Entity* ent, float f) | ||
{ | ||
if (f < 10.0f) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation doesn't match everything else.
public: | ||
Skeleton(Level* pLevel); | ||
|
||
std::string getAmbientSound() const override { return "mob.skeleton"; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Random trailing semi-colon.
public: | ||
Spider(Level* pLevel); | ||
|
||
std::string getAmbientSound() const override { return "mob.spider"; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Random trailing semi-colon.
m_attackDamage = 5; | ||
} | ||
|
||
void Zombie::aiStep() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation doesn't match everything else.
{ | ||
min -= Vec3(x, x, x); | ||
max += Vec3(x, x, x); | ||
return *this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this being cloned?
TileID m_lastTile; | ||
bool m_inGround = false; | ||
int m_life; | ||
int m_flightTime = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Member variables must be initialized in the constructor in C++03.
} | ||
} | ||
|
||
if (hit_ent != nullptr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation doesn't match everywhere else.
|
||
float max_dist = 0.0f; | ||
float var10 = 0.3f; | ||
for (Entity* ent : entities) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot use foreach syntax on C++03. Please use ::iterator instead. There are examples of this in the codebase.
return 0; | ||
|
||
float br = (1.0f - reinterpret_cast<Spider*>(spider)->getBrightness(1.0f)) * 0.5f; | ||
glEnable(3042); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The numbers here should be GL_ enums.
How should I feel?
Creatures lie here
Looking through the window
Monster