Theoretical Question

Discussion in 'Plugin Development' started by ThatOneDev123, May 20, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    ThatOneDev123

    Hello Fellow Developers!
    I am working on a hunger game type of plugin and had a theoretical question about the implementation.
    How would you go back tracking each game that is currently going on, and checking for winners, etc...
    Because at any given time, there could be 'x' amount of games in progress, how would you keep track of the events in each game (a user won the game, etc...)
    Thank you!
    Regards,
    TOD.
     
  2. Offline

    cfil360

  3. cfil360
    Arenas actually don't have much to do with this, but they sure are essential in minigame plugins.

    ThatOneDev123
    It depends on how you want to do it. If you e.g have a score limit of 50, and you earn a score by killing an enemy player, you would probably want to use PlayerDeathEvent and check if the score now is the score limit, then end the game. If you want, you can start a conversation with me and I'll do my best to answer any questions you have about minigames.
     
  4. Offline

    cfil360

    Assist ThatOneDev123 he is asking how to keep his score variables from conflictting with each other. The best way is by having different but similar objects aka arenas. I think this would be your best bet to solving this and it helps with future plugins.
     
  5. Offline

    jthort

    ThatOneDev123 Take advantage of OOP in this case, create a new instance class with something along the lines of "arena". Keep values in it such as participants, lobby location, anything you want. Then you can just create a new object of that class.
     
    SnipsRevival likes this.
  6. Offline

    gkovalecyn

  7. Offline

    ThatOneDev123



    First of all thank you everyone for the replies, I appreciate it. In response to your reply, I had actually thought of this, but how would it keep checking that object? Would I need to schedule tasks, that keep going through each running game every 1 second and then checking its stats? Or is there like some loop in that arena object that is always running?
     
Thread Status:
Not open for further replies.

Share This Page