Added: collectibles class. Collectibles are strewn around the level and can be 'picked up' (deactivated, won't be rendered), when the player gets close and jumps.

This commit is contained in:
Foxar
2020-12-05 22:04:38 +01:00
parent b547de9cbb
commit c0ab97585c
7 changed files with 122 additions and 1 deletions
@@ -0,0 +1,39 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2020, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Michał Mostowik <mostek3pl@gmail.com>
*/
#include "collectible.hpp"
#include <loaders/obj_loader.hpp>
#include <loaders/bmp_loader.hpp>
#include <modules/gif_sender.hpp>
#include <utils/debug.hpp>
#include <utils/math.hpp>
Collectible::Collectible()
{
mesh.loadObj("oyster/", "oyster", 10.F, false);
mesh.shouldBeFrustumCulled = false;
mesh.position.set(0.0F, 0.0F, 0.0f);
bActive = true;
}
Collectible::~Collectible()
{
}
void Collectible::setActive(u8 b)
{
bActive = b;
}
u8 Collectible::isActive()
{
return bActive;
}