Skip to content

Commit

Permalink
Merge pull request #231 from ovicin/GameObjectsRefactoring
Browse files Browse the repository at this point in the history
Last updates from FIMG
  • Loading branch information
ovicin committed Aug 3, 2015
2 parents 43728ae + 06c194e commit f428098
Show file tree
Hide file tree
Showing 23 changed files with 153 additions and 53 deletions.
54 changes: 27 additions & 27 deletions bin/data/FIMG/scenario.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
<color>14423100</color>
<invisible>0</invisible>
<pointsCollision>0</pointsCollision>
<positionX>3.780012608</positionX>
<positionY>-0.979952335</positionY>
<positionX>-8.179975510</positionX>
<positionY>3.400041580</positionY>
<positionZ>-1.625615954</positionZ>
<scaleX>0.211452842</scaleX>
<scaleY>0.211452827</scaleY>
Expand All @@ -85,8 +85,8 @@
<color>4633401</color>
<invisible>0</invisible>
<pointsCollision>2</pointsCollision>
<positionX>-5.894899368</positionX>
<positionY>-0.920033455</positionY>
<positionX>12.805097580</positionX>
<positionY>-9.720052719</positionY>
<positionZ>-2.012315273</positionZ>
<scaleX>0.279472321</scaleX>
<scaleY>0.299472332</scaleY>
Expand All @@ -103,8 +103,8 @@
<color>4633401</color>
<invisible>0</invisible>
<pointsCollision>2</pointsCollision>
<positionX>-0.976687670</positionX>
<positionY>4.340183735</positionY>
<positionX>4.223309994</positionX>
<positionY>0.440195352</positionY>
<positionZ>-2.012315273</positionZ>
<scaleX>0.267044872</scaleX>
<scaleY>0.287044883</scaleY>
Expand Down Expand Up @@ -159,8 +159,8 @@
<color>6438584</color>
<invisible>0</invisible>
<pointsCollision>2</pointsCollision>
<positionX>7.855129242</positionX>
<positionY>-11.254489899</positionY>
<positionX>1.735145092</positionX>
<positionY>-22.654527664</positionY>
<positionZ>-2.807881832</positionZ>
<scaleX>0.318929851</scaleX>
<scaleY>0.318929851</scaleY>
Expand All @@ -177,8 +177,8 @@
<color>6438584</color>
<invisible>0</invisible>
<pointsCollision>3</pointsCollision>
<positionX>5.108355999</positionX>
<positionY>-18.731229782</positionY>
<positionX>-14.471632957</positionX>
<positionY>-17.851228714</positionY>
<positionZ>-2.807881832</positionZ>
<scaleX>0.424209893</scaleX>
<scaleY>0.324209899</scaleY>
Expand All @@ -197,16 +197,16 @@
<color>6438584</color>
<invisible>0</invisible>
<pointsCollision>0</pointsCollision>
<positionX>-6.568281651</positionX>
<positionY>-12.371015549</positionY>
<positionX>-7.008285999</positionX>
<positionY>-13.911018372</positionY>
<positionZ>-2.807881832</positionZ>
<scaleX>0.321520478</scaleX>
<scaleY>0.321520478</scaleY>
<scaleZ>0.321520478</scaleZ>
<rotationX>-0.598771691</rotationX>
<rotationY>0.393107235</rotationY>
<rotationZ>-0.486055046</rotationZ>
<rotationW>0.500689089</rotationW>
<rotationX>-0.598771811</rotationX>
<rotationY>0.393107265</rotationY>
<rotationZ>-0.486055106</rotationZ>
<rotationW>0.500688970</rotationW>
<path>Demo/3DModels/new/totem6.obj</path>
</object>
<object>
Expand All @@ -233,8 +233,8 @@
<color>6438584</color>
<invisible>0</invisible>
<pointsCollision>0</pointsCollision>
<positionX>-11.829972267</positionX>
<positionY>-19.882190704</positionY>
<positionX>-9.529948235</positionX>
<positionY>-34.122276306</positionY>
<positionZ>-3.694581509</positionZ>
<scaleX>0.050530948</scaleX>
<scaleY>0.040530950</scaleY>
Expand Down Expand Up @@ -325,8 +325,8 @@
<color>4633401</color>
<invisible>1</invisible>
<pointsCollision>0</pointsCollision>
<positionX>19.620311737</positionX>
<positionY>-56.340286255</positionY>
<positionX>19.740306854</positionX>
<positionY>-51.020282745</positionY>
<positionZ>-4.088669777</positionZ>
<scaleX>0.505571961</scaleX>
<scaleY>0.805571973</scaleY>
Expand Down Expand Up @@ -397,13 +397,13 @@
<color>4633401</color>
<invisible>1</invisible>
<pointsCollision>0</pointsCollision>
<positionX>-21.692668915</positionX>
<positionY>-7.240075111</positionY>
<positionX>-23.212671280</positionX>
<positionY>-4.040076733</positionY>
<positionZ>-4.384236336</positionZ>
<scaleX>0.322407246</scaleX>
<scaleY>0.522407293</scaleY>
<scaleZ>0.522407293</scaleZ>
<rotationX>-0.135477260</rotationX>
<rotationX>-0.135477215</rotationX>
<rotationY>0.990577400</rotationY>
<rotationZ>-0.017143698</rotationZ>
<rotationW>0.010413628</rotationW>
Expand Down Expand Up @@ -451,8 +451,8 @@
<color>16777215</color>
<invisible>0</invisible>
<pointsCollision>0</pointsCollision>
<positionX>-11.348384857</positionX>
<positionY>-45.699893951</positionY>
<positionX>-22.548425674</positionX>
<positionY>-2.139858484</positionY>
<positionZ>-0.500000119</positionZ>
<scaleX>0.190179527</scaleX>
<scaleY>0.190179527</scaleY>
Expand All @@ -470,8 +470,8 @@
<color>16777215</color>
<invisible>0</invisible>
<pointsCollision>0</pointsCollision>
<positionX>17.027770996</positionX>
<positionY>-46.899486542</positionY>
<positionX>18.907724380</positionX>
<positionY>-25.839454651</positionY>
<positionZ>-0.500000119</positionZ>
<scaleX>0.211583912</scaleX>
<scaleY>0.211583912</scaleY>
Expand Down
Binary file added bin/data/FIMG/sounds/CoroMasOrgano.aif
Binary file not shown.
Binary file removed bin/data/FIMG/sounds/DobleCampanas.aif
Binary file not shown.
Binary file added bin/data/FIMG/sounds/GAMEOVER_campanaIglesia.aif
Binary file not shown.
Binary file not shown.
Binary file added bin/data/FIMG/sounds/VocesRuso2.aif
Binary file not shown.
Binary file added bin/data/FIMG/sounds/campana 01_01.aif
Binary file not shown.
Binary file added bin/data/FIMG/sounds/patos_01_pierde.aif
Binary file not shown.
Binary file added bin/data/FIMG/sounds/patos_02_bancos.aif
Binary file not shown.
Binary file added bin/data/FIMG/sounds/patos_03_bancos.aif
Binary file not shown.
Binary file removed bin/data/FIMG/sounds/pierde.wav
Binary file not shown.
Binary file added bin/data/FIMG/sounds/plangIA_hamburguesa.aif
Binary file not shown.
Binary file added bin/data/banderaCatalana.mov
Binary file not shown.
4 changes: 2 additions & 2 deletions src/GameObjects/Ball.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void Ball::setup(ofxBulletWorldRigid &myWorld,
genericSetup(myWorld, *Attrib);

//specific
SoundManager::getInstance()->PlaySound(1);
//SoundManager::getInstance()->PlaySound(1);
shadow.set(getBallAttr()->radius, 0.1);
shadow.setResolution(20, 1);
m_enBallState = BALL_STATE_INIT;
Expand Down Expand Up @@ -129,7 +129,7 @@ void Ball::reset() {
body.create(world->world, this->getPosition(), getBallAttr()->mass, getBallAttr()->radius);
body.add();
//body.setData(this);
SoundManager::getInstance()->PlaySound(1);
//SoundManager::getInstance()->PlaySound(1);
m_enBallState = BALL_STATE_INIT;
}

Expand Down
16 changes: 10 additions & 6 deletions src/GameObjects/Obstacle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,19 +155,23 @@ void Obstacle::onCollision(SimpleObject* Obj){


if (0 != collisionPoints){
// the multiball object has 0 points attached
// and we don't generate the collision event becuase during multiball
// the balls collision all the time
GameStatus::getInstance()->AddPoints(collisionPoints);
//save time to show color during some time
collisionTime = ofGetElapsedTimef()*100;
//play sound
//SoundManager::getInstance()->PlaySound(0); // PLAYED in SoundManager

//Play rele //TODO After try to move this to SimpleObject ... then all objects will
eventComunication newComEvent;
newComEvent.collision = true;
newComEvent.pObject = this;
ofNotifyEvent(eventComunication::onNewCom, newComEvent);
//Play rele //TODO After try to move this to SimpleObject ... then all objects will
eventComunication newComEvent;
newComEvent.collision = true;
newComEvent.pObject = this;
ofNotifyEvent(eventComunication::onNewCom, newComEvent);

}


onCollisionSpecific(Obj);
}
Expand Down
15 changes: 13 additions & 2 deletions src/GameObjects/Teleporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,14 @@ void Teleporter::onCollisionSpecific(SimpleObject* Obj){
pMyBall->body.getRigidBody()->setActivationState(DISABLE_SIMULATION);

//create a newq ball;

m_poScenario->addOneBallMore();

if (m_iBallStuckCount > 2){
//release all the balls
m_poScenario->resetBalls();
}
else{
m_poScenario->addOneBallMore();
}

//float aux_dimZ1 = (float)m_poDestinationObject->getSimpleBody()->getRigidBody()->getCollisionShape()->getMargin();//getLocalScaling
//btVector3 aux_dimZ2 = (btVector3)m_poDestinationObject->getSimpleBody()->getRigidBody()->getCollisionShape()->getLocalScaling();//
Expand Down Expand Up @@ -107,6 +113,10 @@ void Teleporter::SetMultiBallStickyFlag(bool bFlag){
bSticky = bFlag;
if (bFlag){
m_poDestinationObject = this;
collisionPoints = 0;
}
else{
collisionPoints = 5;
}
}

Expand All @@ -133,6 +143,7 @@ void Teleporter::SetDetinationObjectId(int id){
//--------------------------------------------------------------
void Teleporter::ActivateTeleporter(bool activeFlag){
m_bTeleporterActive = activeFlag;

}

//--------------------------------------------------------------
Expand Down
14 changes: 13 additions & 1 deletion src/Managers/PinballChinoManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ void PinballChinoManager::setup(){

video.loadMovie("fachadaFiMGVideo2.mov");
video.setLoopState(OF_LOOP_NONE);

videoBandera.loadMovie("banderaCatalana.mov");
//videoBandera.setLoopState(OF_LOOP_NORMAL);
videoBandera.setLoopState(OF_LOOP_NONE);
//videoBandera.play();


// setup bullet world
Expand Down Expand Up @@ -109,11 +114,17 @@ void PinballChinoManager::setup(){
void PinballChinoManager::update(){

video.update();
videoBandera.update();
if (video.getIsMovieDone()){
video.stop();
video.setFrame(0);
}

if (videoBandera.getIsMovieDone()){
videoBandera.stop();
videoBandera.setFrame(0);
}

// Shadows
//updating shadow color using mouse position
//ofColor shadow_color = ofFloatColor(0.1);
Expand Down Expand Up @@ -208,6 +219,7 @@ void PinballChinoManager::draw(){

ofSetColor(ofColor::white);
video.draw(ofGetWidth()-400, 0);
videoBandera.draw(ofGetWidth()-400, 300);
}

void PinballChinoManager::ToggleDrawDebug(void){
Expand Down Expand Up @@ -583,7 +595,7 @@ void PinballChinoManager::listenerOnUpdateMission(eventMission & args){
//myScenario.ActivateTeleport(true);
//myScenario.ActivateGravityObjects(true);
myScenario.ActivateMultiballObjects(true);

videoBandera.play();
break;
case eventMission::MISSION_EVENT_END_MISSION:

Expand Down
2 changes: 1 addition & 1 deletion src/Managers/PinballChinoManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@ class PinballChinoManager: public InputEventManager {

bool m_bLinkInitialBallPositionToHammer;

ofVideoPlayer video;
ofVideoPlayer video, videoBandera;

};
Loading

0 comments on commit f428098

Please sign in to comment.