CheeseLord / warts

WAcky Real Time Strategy
MIT License
1 stars 0 forks source link

Support more than one type of unit #61

Open kronmillerg opened 7 years ago

kronmillerg commented 7 years ago

As soon as we have two types of unit, and therefore have at least a vague idea what things differ between unit types, we should move the unit definitions to a YAML file (or some sort of data file).

kronmillerg commented 7 years ago

Yes please YAML file. Also let's have the model be tied to the unit type instead of whether it's mine or not. Which will force us to clean up some super hacky logic which checks isExample to determine whether the unit is mine:

    if isUnit:
        # TODO[#52]: Sigh. This is a terrible hack. I guess we could pipe
        # through yet another bool for "is this my unit", but I don't want
        # to have a growing collection of bools that need to be passed into
        # the graphics for each unit. For now, "is this an example model?"
        # and "is this my unit" are equivalent, so I guess we'll just
        # piggyback off of isExample....
        if isExample:
            entity.setIndicator(self.loader.loadModel(
                getModelPath("unit-indicator-mine.egg")
            ))
        else:
            entity.setIndicator(self.loader.loadModel(
                getModelPath("unit-indicator-notmine.egg")
            ))
kronmillerg commented 7 years ago

...where does the YAML file go? Conceptually, I think it goes in a config directory, and that directory and the models directory both go in some top-level directory for data files used by the game. But "assets" seems like the wrong name for that top-level directory... maybe we should rename it?