u/FirmSupermarket6933

Code organisation

Hello everyone! I'm new to game development and trying to create my first game. I want to create it without using existing engines. I have a question about code organization. How do I properly store the state of an object when its position in the engine and on the screen don't match?

For example, each chess piece can only be in one of 64 positions. But when a piece moves, I want to see an animation of that piece's movement. When the animation plays, the piece's position in the engine and on the screen are different.

Also, in card games, a card can be enlarged when you hover over it, but its position doesn't change.

Also, in card games, cards in a hand can move apart to reveal where a card can be placed.

Please give me some tips on code organization. Are there any books on this topic you could recommend (except game programming patterns)?

reddit.com
u/FirmSupermarket6933 — 27 days ago