Sign In Register

How can we help you today?

Start a new topic

Slots for building

I want to implement a system of slots for construction.

This can be seen in many games.

It is not real time game.


I have something like this:


{

"slot1" : {"buildID" : 1, "time" : 385767, "empty" : false},

"slot2" : {"buildID" : 0, "time" : 0, "empty" : true},

"slot3" : {"buildID" : 0, "time" : 0, "empty" : true}

}


buildID - Building identifier

time - Time to completion of construction (ms)

empty - Slot is empty


I sometimes check "time" and 

if (time == 0) {empty = true Building Finished()  and other actions}


How will this affect performance?


Does this method have the right to life?


Thank so much )

slots.png
(52.3 KB)
Login to post a comment