View Single Post
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 07-26-2020 , 23:50   Re: Trying to compile snake
Reply With Quote #2

An enum struct acts similarly to a struct or class from an OOP language. It replaces the old method of indexing arrays using an enum because that was extremely obtuse.

So in your second code link, it doesn't make sense to use just Mode_Snake1 on the right side of an assignment since it's the name of a property/field on an object (using OOP terms). You have WormMode g_iSnakeMode[MAXPLAYERS+1]; so each thing in that array is-a WormMode. With that declaration, you can do something like g_iSnakeMode[1].Mode_Snake1 = 42;.
Fyren is offline