#tiles and entities
1 messages · Page 1 of 1 (latest)
yes, and Character : Entity
whereas it can be CoffeeSpill : TemporaryEffect TemporaryEffect : Decoration, StaticObject : Entity
however it might be rendered as a tile
So it would be
Entity
- Tile
- GrassTile - Character
- BaristaCharacter
yeah
ou sort of have this already!
i think you are already doing something similar
i just have the EntityBase atm
maybe you have composed scripts
which is
it is okay to also do
Variables
public Sprite EntitySprite;
public string EntityName;
public int EntityZIndex;
public Material defaultMat;
public TileContainer myContainer;
public GameObject myContainerGO;
public Grid myGrid;
public bool isTerrain = false;
public Vector2Int EntityPosition;
public EntityDirections EntityDirection;
i see, this is pretty tricky but usually okay
maybe they blocked all URLs
just paste it into a ``
https://tarry-salamander-64d.notion.site/EntityBase-Object-04f71006506e41439c0131e3f862a00c
okay i understand now
so the essential change you should make is separate the stuff for rendering (like the sprite rules) from the stuff for running the simulation (like the positions)
some stuff is both useful for rendering and game rules, like the positions
that should stay
but if it's exclusively rendering, pull it out
that might mean you wind up with a component for all the rendering details
or you can use an interface - interfaces are basically a way to give another view of your entities, like another way your rendering code can "just" iterate through every entity and make a decision on how to show it in the game
so from this it should be
adding another component to your prefab and doing GetComponent<T> is the same as adding an interface
so it would be rendering vs simulation properties that would need to be delegated and such?
that seems to make the most sense to me
and would reduce the pain for you the most
for example maybe you just want to put something in the simulation and have it log to console for now
and then you can deal with building a UI around it later
like TownLaw
i think this addresses how you are feeling about the burden of adding new functionality
right now you are making yourself write a lot of code to just say, "no i don't wanna render this right now, i haven't figured that out yet"
maybe we cracked this nut