Parallel event

This commit is contained in:
2023-04-23 21:43:17 -07:00
parent 3be64a40e7
commit 6bc6917b0c
8 changed files with 98 additions and 33 deletions

View File

@ -10,6 +10,6 @@
using namespace Dawn;
Scene * Dawn::dawnGameGetInitialScene(DawnGame *game) {
// return new HelloWorldScene(game);
return new TestScene(game);
return new HelloWorldScene(game);
// return new TestScene(game);
}

View File

@ -13,6 +13,8 @@
#include "games/vn/events/VNPositionEvent.hpp"
#include "games/vn/events/VNSetEvent.hpp"
#include "games/vn/events/VNChoiceEvent.hpp"
#include "games/vn/events/VNParallelEvent.hpp"
#include "games/vn/events/VNWaitEvent.hpp"
namespace Dawn {
class HelloWorldScene : public Scene {
@ -55,12 +57,21 @@ namespace Dawn {
choiceEvent->choices["state2"] = "State 2";
choiceEvent->choices["state3"] = "State 3";
auto parallelEvent = vnManager->createEvent<VNParallelEvent>();
auto wait0 = vnManager->createEvent<VNWaitEvent>();
wait0->duration = 1.0f;
parallelEvent->events.push_back(wait0);
auto wait1 = vnManager->createEvent<VNWaitEvent>();
wait1->duration = 3.0f;
parallelEvent->events.push_back(wait1);
eventTest
->then(parallelEvent)
->then(positionEvent)
->then(vnTextEvent)
->then(setPropertyEvent)
->then(choiceEvent)
// ->then(vnTextEvent)
// ->then(setPropertyEvent)
// ->then(choiceEvent)
;
vnManager->setEvent(eventTest);
}