import SpriteKit
extension GameScene {
func addPlayer() {
player = SKSpriteNode(color: UIColor.red , size: CGSize(width: 50, height: 50))
这显示错误
无法指定类型' SKSpriteNode'的值输入' SKSpriteNode!.Type' (又名' ImplicitlyUnwrappedOptional< SKSpriteNode> .Type')
答案 0 :(得分:0)
像这样定义你的玩家:
var player = SKSpriteNode(imageNamed: "YourImageForTheNode")
// or just...
var player = SKSpriteNode()