Stephen Haney

Keep Game Sprites Organized by
Extending SKSpriteNode with a Wrapper Class

Xcode Project and Game Organization

Even a simple game can quickly explode into a rats nest if we don’t adhere to structure from the start. I’ve learned that it’s very helpful to create a Sprite class that wraps SKSpriteNode. You can extend this class with custom functions (I’ll detail creating a ‘touch’ event handler for sprites next post), and inherit down into other classes that share basic Sprite functions like enemies, the player class, and NPCs.
(more…)