mob
Login()
src.icon='Player.dmi'
src.loc=locate(1,1,1)
Move()
..()
if(src.dir==EAST)
icon.Flip(EAST)
Problem description:
I tried a bunch of variations of this, but this one seems the most logical. I want the icon to flip east if the player moves east, simple enough. However, I simply get an error saying "Test.dm:9:error: Flip: undefined proc", which it definitely isn't. Am I making some really obvious mistake? It's been a while since I last coded, so that might just be.
The issue is more that atom/icon as a variable isn't typed as an icon, so the compiler doesn't know if can even use Flip() on it. The solution is to type-cast:
The final assignment may be un-necessary, but adds a certain clarity to what's going on, I feel.