If you want to start right away, we provide you with a simple snippet of code to include in your project. It shows how to connect with the MyOWO App and how to send a sensation.
Our API: To integrate our technology in your project code.
Optionally, you could also use our Sensations Creator to create and modify your own Sensations.
publicasyncTaskMain(){await Connect();await SendBakedSensation(); SendDynamicSensation();OWO.Disconnect();}TaskConnect(){ //Here we declare two baked sensations, Ball(0) and Dart(1)var auth =GameAuth.Parse("0~Ball~100,1,100,0,0,0,Impact|0%100,1%100,2%100,3%100,4%100,5%100~impact-0~#1~Dart~12,1,100,0,0,0,Impact|5%100~impact-1~");OWO.Configure(auth);returnOWO.AutoConnect(); //This operation can be awaited}voidSendDynamicSensation() =>OWO.Send(Sensation.Dagger);TaskSendBakedSensation(){OWO.Send("0"); //This ID belongs to the Ball sensation in the GameAuthreturnTask.Delay(100); //We wait for the baked sensation to finish}
//This UDPNetwork will only work on windows
std::shared_ptr<OWOGame::OWO> owo = OWO::Create<UDPNetwork>();
void Connect()
{
//Here we declare two baked sensations, Ball(0) and Dart(1)
auto auth = GameAuth::Parse("0~Ball~100,1,100,0,0,0,Impact|0%100,1%100,2%100,3%100,4%100,5%100~impact-0~#1~Dart~12,1,100,0,0,0,Impact|5%100~impact-1~");
owo->Configure(auth);
owo->AutoConnect();
while (owo->State() != ConnectionState::Connected)
{
//We call UpdateStatus here only for the connection,
//but it also must be called in your application main loop
//for more information read the Connection page in our documentation
uint64_t timeInMs = std::clock();
owo->UpdateStatus(timeInMs);
}
}
void SendDynamicSensation()
{
owo->Send(SensationsFactory::Create(100, 0.1f, 100, 0, 0, 0, "Dagger"));
}
void SendBakedSensation()
{
//This ID belongs to the Ball sensation in the GameAuth
owo->Send(SensationsParser::Parse("0"));
//We wait for the baked sensation to finish
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
void Main()
{
Connect();
SendBakedSensation();
SendDynamicSensation();
owo->Disconnect();
}