Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Logan

Hey guys,
I've been trying to add a time event in my game. I'll elaborate now about what I'm talking about.

If the clients time = 12:01 p.m. Make a trigger active that moves the player to another map? How would I accomplish this?

Couldn't find anything about REAL time events on the forums or the documentation, any help is greatly appreciated :D

1 decade ago by y0ungb0b

Use a Date object for the time, check it and just load in the required level?

var date = new Date()
if (date.getHours() >== 12 && date.getMinutes() >== 01)
    console.log("Do something because the time is over 12:01pm!")

1 decade ago by Logan

Thanks y0ungb0b!

Would this be executed inside the main.js? Should I check the seconds too?

1 decade ago by Joncom

Quote from Logan
Thanks y0ungb0b!

Would this be executed inside the main.js? Should I check the seconds too?
Execute it where ever you'd like. You could do it in main.js if you want.

1 decade ago by Logan

Hello Joncom!

Thanks for the reply, it works! :)
Page 1 of 1
« first « previous next › last »