-
Notifications
You must be signed in to change notification settings - Fork 30
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
Showing
4 changed files
with
648 additions
and
648 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,81 @@ | ||
#include "show_trajectory.hpp" | ||
// #include "show_trajectory.hpp" | ||
|
||
#include <Geode/modify/PlayLayer.hpp> | ||
// #include <Geode/modify/PlayLayer.hpp> | ||
|
||
class CoinFinderNode : public cocos2d::CCDrawNode { | ||
public: | ||
static CoinFinderNode* create() { | ||
CoinFinderNode* ret = new CoinFinderNode(); | ||
if (ret->init()) { | ||
ret->autorelease(); | ||
return ret; | ||
} | ||
// class CoinFinderNode : public cocos2d::CCDrawNode { | ||
// public: | ||
// static CoinFinderNode* create() { | ||
// CoinFinderNode* ret = new CoinFinderNode(); | ||
// if (ret->init()) { | ||
// ret->autorelease(); | ||
// return ret; | ||
// } | ||
|
||
delete ret; | ||
return nullptr; | ||
// delete ret; | ||
// return nullptr; | ||
|
||
} | ||
}; | ||
// } | ||
// }; | ||
|
||
cocos2d::CCDrawNode* drawNode() { | ||
// cocos2d::CCDrawNode* drawNode() { | ||
|
||
static CoinFinderNode* instance = nullptr; | ||
// static CoinFinderNode* instance = nullptr; | ||
|
||
if (!instance) { | ||
instance = CoinFinderNode::create(); | ||
instance->retain(); | ||
// if (!instance) { | ||
// instance = CoinFinderNode::create(); | ||
// instance->retain(); | ||
|
||
cocos2d::_ccBlendFunc blendFunc; | ||
blendFunc.src = GL_SRC_ALPHA; | ||
blendFunc.dst = GL_ONE_MINUS_SRC_ALPHA; | ||
// cocos2d::_ccBlendFunc blendFunc; | ||
// blendFunc.src = GL_SRC_ALPHA; | ||
// blendFunc.dst = GL_ONE_MINUS_SRC_ALPHA; | ||
|
||
instance->setBlendFunc(blendFunc); | ||
} | ||
// instance->setBlendFunc(blendFunc); | ||
// } | ||
|
||
return instance; | ||
} | ||
// return instance; | ||
// } | ||
|
||
class $modify(PlayLayer) { | ||
// class $modify(PlayLayer) { | ||
|
||
struct Fields { | ||
std::vector<GameObject*> coins; | ||
}; | ||
// struct Fields { | ||
// std::vector<GameObject*> coins; | ||
// }; | ||
|
||
void addObject(GameObject * obj) { | ||
PlayLayer::addObject(obj); | ||
// void addObject(GameObject * obj) { | ||
// PlayLayer::addObject(obj); | ||
|
||
if (obj->m_objectType == GameObjectType::UserCoin || obj->m_objectType == GameObjectType::SecretCoin) | ||
m_fields->coins.push_back(obj); | ||
// if (obj->m_objectType == GameObjectType::UserCoin || obj->m_objectType == GameObjectType::SecretCoin) | ||
// m_fields->coins.push_back(obj); | ||
|
||
} | ||
// } | ||
|
||
void setupHasCompleted() { | ||
PlayLayer::setupHasCompleted(); | ||
// void setupHasCompleted() { | ||
// PlayLayer::setupHasCompleted(); | ||
|
||
m_objectLayer->addChild(drawNode(), 499); | ||
// m_objectLayer->addChild(drawNode(), 499); | ||
|
||
} | ||
// } | ||
|
||
void postUpdate(float dt) { | ||
PlayLayer::postUpdate(dt); | ||
// void postUpdate(float dt) { | ||
// PlayLayer::postUpdate(dt); | ||
|
||
if (!Global::get().coinFinder) { | ||
drawNode()->setVisible(false); | ||
return; | ||
} | ||
// if (!Global::get().coinFinder) { | ||
// drawNode()->setVisible(false); | ||
// return; | ||
// } | ||
|
||
drawNode()->clear(); | ||
drawNode()->setVisible(true); | ||
// drawNode()->clear(); | ||
// drawNode()->setVisible(true); | ||
|
||
Global::get().safeMode = true; | ||
// Global::get().safeMode = true; | ||
|
||
for (GameObject* coin : m_fields->coins) { | ||
cocos2d::ccColor4F color = { 0.85f, 0.85f, 0.85f, 0.75f }; | ||
// for (GameObject* coin : m_fields->coins) { | ||
// cocos2d::ccColor4F color = { 0.85f, 0.85f, 0.85f, 0.75f }; | ||
|
||
if (coin->m_objectType == GameObjectType::SecretCoin) | ||
color = { 0.96f, 1.f, 0.f, 0.75f }; | ||
// if (coin->m_objectType == GameObjectType::SecretCoin) | ||
// color = { 0.96f, 1.f, 0.f, 0.75f }; | ||
|
||
drawNode()->drawSegment(m_player1->getPosition(), coin->getPosition(), 0.4f, color); | ||
} | ||
} | ||
}; | ||
// drawNode()->drawSegment(m_player1->getPosition(), coin->getPosition(), 0.4f, color); | ||
// } | ||
// } | ||
// }; |
Oops, something went wrong.