An attempt by the SKSpriteNode subclass to make my game code cleaner, and I obviously donโt understand anything. Here is a very simple example: I create a new Swift file called Alien.swift with the following contents:
import SpriteKit class Alien: SKSpriteNode { }
In my game, I:
let alienSprite: Alien = Alien() print("It an \(alienSprite)")
and I get:
This is the name (SKSpriteNode): '(null) ...'
Even Xcode says it is "aliensSprite":

Why doesn't it print at run time that it is "alienSprite"?
Edit: including one of my comments here - I really collect the sprite from my .sks file, where I put it in the scene editor and set its own class. I'm trying to pick it up:
let alien = childNodeWithName("alien") as! alienSprite
but I get the error:
Cannot cast SKSpriteNode to alientSprite
source share