Game conceptualization March 31, 2010 04:58AM | Registered: 14 years ago Posts: 118 |
class Event{ public: virtual bool start() = 0; bool done; //Tells us when to move to the next event }; class Speech : public Event{ Speech(PersonObject person, string text); bool start(){ // Display text } } class Sound : public Event{ Sound(string soundFile); bool start(){ // Play sound } } class Pose : public Event{ Pose(PersonObject person, string whichPose); bool start(){ //Change the person's emotional state and play that animation } } queue.enqueue (new Speech(PersonA, "I enjoy fun...") ); queue.enqueue (new Speech(PersonB, "I know man...") ); queue.enqueue (new Sound( "laundrybag.ogg") ); queue.enqueue (new Pose( PersonA, "yuck") );
Re: Game conceptualization April 01, 2010 03:01PM | Registered: 15 years ago Posts: 384 |
Re: Game conceptualization April 01, 2010 05:57PM | Registered: 14 years ago Posts: 379 |
Say(PersonA, "Bla bla bla..."); Say(PersonB, "Bla bla bla..."); Play("Soundfile!"); SetPose(PersonA, "Cheer"); if ChooseAction("Run away", "Kick in the nuts") == "Run away" then SetPose(PersonA, "Win"); else SetPose(PersonA, "Death"); endWhere each of the functions waits till that action was completed.
Re: Game conceptualization April 02, 2010 10:43PM | Registered: 14 years ago Posts: 118 |
Re: Game conceptualization April 03, 2010 11:14AM | Registered: 14 years ago Posts: 379 |
Re: Game conceptualization April 06, 2010 05:58PM | Registered: 14 years ago Posts: 379 |
print("Start!"); sleep(10); print("End!");And it will print Start!, wait 1 second and then print End! but during the 1 second sleep you can still do processing in the main loop.
Re: Game conceptualization April 06, 2010 08:32PM | Registered: 14 years ago Posts: 118 |