This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
I've been experimenting at lot with how to organize my entity parent objects for flexible future use in other projects.
At the moment, I'm playing around with having state functions in a separate script, and storing their ID in a simple array, calling them with script_execute. I'm finding I like this because it lets me open the states script in a side window to the object's event window, as a way of accessing and see Step Event codes, unlike, say, a switch statement that would need to be scrolled up to see or hidden in a region.
Create:
state = ENTITY_STATES.NORMAL;
states[ENTITY_STATES.NORMAL] = functionStateNormal;
Step:
script_execute(states[state]);
I wish GM still let you store functions in enums.
What's your personal code style at the moment for states?
Subreddit
Post Details
- Posted
- 1 year ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/gamemaker/c...