-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ab32e4c
commit bd25256
Showing
17 changed files
with
202 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
cmake_minimum_required(VERSION 3.11) | ||
|
||
# project name | ||
project(power_up) | ||
|
||
# c++ standard | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED on) | ||
|
||
# define sources to use | ||
set(SRCS PowerUp.cpp PowerUp.hpp) | ||
|
||
# define the binary output | ||
add_library(${PROJECT_NAME} ${SRCS}) | ||
|
||
# expose the headers | ||
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
# define the external libraries to use | ||
target_link_libraries(${PROJECT_NAME} game_object) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
** EPITECH PROJECT, 2020 | ||
** epitech-indiestudio | ||
** File description: | ||
** [enter description here] | ||
*/ | ||
|
||
#include "PowerUp.hpp" | ||
|
||
PowerUp::PowerUp(const std::shared_ptr<IrrlichtController> &ctrl, const std::string name) : GameObject(ctrl, irr::core::vector3df(5, 5, 5), name) | ||
{ | ||
_position = irr::core::vector3df(0, 0, 0); | ||
_rotation = irr::core::vector3df(0, 0, 0); | ||
_node = NULL; | ||
} | ||
|
||
void PowerUp::Init(void) | ||
{ | ||
std::random_device dev; | ||
std::mt19937 _prob(dev()); | ||
std::uniform_int_distribution<std::mt19937::result_type> distribution(1, 2); | ||
|
||
if (distribution(_prob) == 1) | ||
_node = _ctrl->_scene_mgr->addAnimatedMeshSceneNode(_ctrl->_scene_mgr->getMesh(SKATE)); | ||
else | ||
_node = _ctrl->_scene_mgr->addAnimatedMeshSceneNode(_ctrl->_scene_mgr->getMesh(SKATE)); | ||
_node->setMaterialFlag(irr::video::EMF_LIGHTING, false); | ||
_node->setMD2Animation(scene::EMAT_STAND); | ||
} | ||
|
||
void PowerUp::SetPosition(irr::core::vector3df position) | ||
{ | ||
_position = position; | ||
if (_node) | ||
_node->setPosition(position); | ||
_collider->SetPosition(position); | ||
} | ||
|
||
PowerUp::~PowerUp() | ||
{ | ||
|
||
} | ||
|
||
void PowerUp::Update(std::vector<std::shared_ptr<IGameObject>> &obj) | ||
{ | ||
|
||
} | ||
|
||
void PowerUp::Delete(void) | ||
{ | ||
_status = DELETED; | ||
} | ||
|
||
const IGameObject::type_e PowerUp::GetType(void) | ||
{ | ||
if (_id.compare("skate") == 0) | ||
return IGameObject::type_e::PWU_SKATE; | ||
if (_id.compare("wall_pass") == 0) | ||
return IGameObject::type_e::PWU_WALL_PASS; | ||
return IGameObject::type_e::BONUS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
** EPITECH PROJECT, 2020 | ||
** epitech-indiestudio | ||
** File description: | ||
** [enter description here] | ||
*/ | ||
|
||
#ifndef BLOCK_HPP_ | ||
#define BLOCK_HPP_ | ||
|
||
#include "GameObject.hpp" | ||
|
||
#include <random> | ||
#include <iostream> | ||
|
||
#define SKATE "../assets/skate.obj" | ||
|
||
class PowerUp : public GameObject { | ||
public: | ||
PowerUp(const std::shared_ptr<IrrlichtController> &ctrl, const std::string name); | ||
void Init(void); | ||
void Update(std::vector<std::shared_ptr<IGameObject>> &obj); | ||
void Delete(); | ||
void SetPosition(irr::core::vector3df position); | ||
const IGameObject::type_e GetType(void); | ||
~PowerUp(); | ||
private: | ||
irr::scene::IAnimatedMeshSceneNode *_node; | ||
}; | ||
|
||
#endif /* !BLOCK_HPP_ */ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Blender MTL File: 'None' | ||
# Material Count: 1 | ||
|
||
newmtl Material.003 | ||
Ns 323.999994 | ||
Ka 1.000000 1.000000 1.000000 | ||
Kd 0.020902 0.800000 0.710829 | ||
Ks 0.500000 0.500000 0.500000 | ||
Ke 0.000000 0.000000 0.000000 | ||
Ni 1.450000 | ||
d 1.000000 | ||
illum 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Blender v2.83.0 OBJ File: '' | ||
# www.blender.org | ||
mtllib skate.mtl | ||
o Cube_Cube.001 | ||
v 0.247360 1.167307 1.000000 | ||
v 0.247360 1.167307 -1.000000 | ||
v 0.247360 3.167307 -0.007055 | ||
v 0.247360 2.167307 -0.503528 | ||
v 0.247360 2.167307 -0.507050 | ||
v 0.079821 1.167307 1.000000 | ||
v 0.079821 3.167307 -0.007055 | ||
v 0.079821 1.167307 -1.000000 | ||
v 0.079821 2.167307 -0.503528 | ||
vt 0.500000 0.188381 | ||
vt 0.375000 0.250000 | ||
vt 0.500000 0.187941 | ||
vt 0.375000 1.000000 | ||
vt 0.875000 0.624118 | ||
vt 0.875000 0.624118 | ||
vt 0.375000 1.000000 | ||
vt 0.625000 0.125882 | ||
vt 0.625000 0.125882 | ||
vt 0.500000 0.187941 | ||
vt 0.375000 0.250000 | ||
vt 0.375000 0.000000 | ||
vn -1.0000 0.0000 0.0000 | ||
vn 0.0000 0.4497 0.8932 | ||
vn 1.0000 -0.0000 0.0000 | ||
vn 0.0000 0.4447 -0.8957 | ||
vn 0.0000 -1.0000 0.0000 | ||
usemtl Material.003 | ||
s off | ||
f 5/1/1 2/2/1 4/3/1 | ||
f 1/4/2 3/5/2 7/6/2 6/7/2 | ||
f 4/3/1 3/8/1 5/1/1 | ||
f 5/1/3 3/5/3 1/4/3 2/2/3 | ||
f 7/9/1 9/10/1 8/11/1 6/12/1 | ||
f 3/8/4 4/3/4 9/10/4 7/9/4 | ||
f 4/3/4 2/2/4 8/11/4 9/10/4 | ||
f 2/2/5 1/4/5 6/7/5 8/11/5 |