forked from adoptware/pinball
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simulate behavior of flippers when the game has ended (i.e. they cann…
…ot be used) Change on-screen messages related to configuration (reset and ball launch). Also make it possible to change the "reset" key, instead of it being hard-coded. Add modification notices.
- Loading branch information
Showing
5 changed files
with
52 additions
and
7 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 |
---|---|---|
|
@@ -6,6 +6,13 @@ | |
copyright : (C) 2001 by Henrik Enqvist | ||
(C) 2013 Ben Asselstine | ||
email : [email protected] | ||
========================= Modifications ========================= | ||
Apr. 6, 2017: | ||
Send the "game_start" signal. (c30zD) | ||
***************************************************************************/ | ||
|
||
#include "Private.h" | ||
|
@@ -334,6 +341,7 @@ class GnuBehavior : public Behavior { | |
//which ball do we activate if we just locked a ball? | ||
int i = getFirstDeadBall(); | ||
if (i > -1) { | ||
if (i == 0) SendSignal(loader->getSignal("game_start"), 0, this->getParent(), NULL); | ||
SendSignal( PBL_SIG_BALL_ON, 0, this->getParent(), NULL ); | ||
table->activateBall(i, 19.5f, 0.0f, 30.0f); | ||
m_iCurrentBallSlot = i; | ||
|
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 |
---|---|---|
|
@@ -4,6 +4,15 @@ | |
begin : Wed Jan 26 2000 | ||
copyright : (C) 2000 by Henrik Enqvist | ||
email : [email protected] | ||
========================= Modifications ========================= | ||
Apr. 6, 2017: | ||
- Replace name of "m_bOn" with "m_bActive". (c30zD) | ||
- Add events for game over and game start signals. (c30zD) | ||
- Modify function doArm to also use m_bActive. (c30zD) | ||
***************************************************************************/ | ||
|
||
#include "Private.h" | ||
|
@@ -19,7 +28,7 @@ ArmBehavior::ArmBehavior(bool right) : Behavior() { | |
m_bTilt = false; | ||
m_bRight = right; | ||
m_iCount = 0; | ||
m_bOn = false; | ||
m_bActive = false; | ||
m_iSound = -1; | ||
m_bFirst = true; | ||
this->setType(PBL_TYPE_ARMBEH); | ||
|
@@ -35,15 +44,21 @@ void ArmBehavior::StdOnSignal() { | |
this->getParent()->setUserProperty(PBL_UNACTIVE_ARM); | ||
this->getParent()->unsetUserProperty(PBL_ACTIVE_ARM); | ||
this->getParent()->setRotation(0.0f, m_vtxRot.y, 0.0f); | ||
m_bOn = false; | ||
m_bActive = false; | ||
} | ||
ElseOnSignal(PBL_SIG_TILT) { | ||
m_bTilt = true; | ||
} | ||
ElseOnSignal(PBL_SIG_GAME_START) { | ||
m_bActive = true; | ||
} | ||
ElseOnSignal(PBL_SIG_GAME_OVER) { | ||
m_bActive = false; | ||
} | ||
} | ||
|
||
void ArmBehavior::doArm(EMKey key) { | ||
if (Keyboard::isKeyDown(key) && !m_bTilt) { | ||
if (Keyboard::isKeyDown(key) && !m_bTilt && m_bActive) { | ||
if (m_iCount < 10) { | ||
m_iCount++; | ||
this->getParent()->setUserProperty(PBL_ACTIVE_ARM); | ||
|
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 |
---|---|---|
|
@@ -5,6 +5,13 @@ | |
begin : Thu Mar 9 2000 | ||
copyright : (C) 2000-2016 by Henrik Enqvist | ||
email : [email protected] | ||
========================= Modifications ========================= | ||
Dec. 9, 2017: | ||
Reset key is no longer hard-coded. (c30zD) | ||
***************************************************************************/ | ||
|
||
#include <fstream> | ||
|
@@ -823,7 +830,7 @@ int main(int argc, char *argv[]) { | |
SoundUtil::getInstance()->resumeMusic(); | ||
} | ||
|
||
if (Keyboard::isKeyDown(SDLK_r)) { | ||
if (Keyboard::isKeyDown(Config::getInstance()->getKey("reset"))) { | ||
SendSignal(PBL_SIG_RESET_ALL, 0, engine, NULL); | ||
} | ||
|
||
|
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
631b4d0
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.
this change is welcome to upstream
adoptware#15