Classes, Methods, Objects and organising

So I had the “Eureka” moment yesterday when I finally got the idea of Classes their functions and methods and how it all structures together. Just as Chris said in his tutorial on Classes!
But still struggling a little with syntax and the correct way to do things.

I am here calling a function in a new class called buildABlock which should generate a new SKSpriteNode. This is all in its own Swift file and is being called from my main GameScene.

Just can’t get it to work. However I try to call this function I get errors

Probably approaching this task all wrong. Ultimately I really want a function that generates blocks that I can give a unique identifier to then use in rest of my code.

i think your buildABlock should inherit from SKSpriteNode if you want to customize

maybe check tutorials or documentation on how to customize a SKSpriteNode :slight_smile:

Just a style note: since classes are types (as are enums and structs as well), they should begin with a capital letter in Swift, so:

class BuildABlock {
    ...
}