3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

xcode spritekitのエラーについて

Posted at

現在spritkitでゲームを作っているのですが
登場キャラクターをシュミュレーターで動かしてみようと思ったときに、"consecutive declarations on a line must be separated by "
が最後の段に表示されランできません。

今までアプリを作っているときも
たまにこのエラーは表示されていたのですが
気づかないうちに直ってたりします。

何か解決法はあるでしょうか?

import SpriteKit

class GameScene: SKScene {

struct Constants {
static let PlayerImages = ["shrimp01","shrimp02","shrimp03","shrimp04","shrimp01","shrimp02","shrimp03","shrimp04"]
 func didMoveToView(view: SKView) {
        }

/// プレイヤーを構築
func setupPlayer() {
    // Playerのパラパラアニメーション作成に必要なSKTextureクラスの配列を定義
    var playerTexture = [SKTexture]()
    
    // パラパラアニメーションに必要な画像を読み込む
    for imageName in Constants.PlayerImages {
        let texture = SKTexture(imageNamed: imageName)
        texture.filteringMode = .Linear
        playerTexture.append(texture)
    }
    
    // キャラクターのアニメーションをパラパラ漫画のように切り替える
    let playerAnimation = SKAction.animateWithTextures(playerTexture, timePerFrame: 0.2)
    // パラパラアニメーションをループさせる
    let loopAnimation = SKAction.repeatActionForever(playerAnimation)
    

 func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
   /* Called when a touch begins */
    
        }

 func update(currentTime: CFTimeInterval) {
    /* Called before each frame is rendered */
}

}
func setupBackgroundSea() {
let texure = SKTexture(imageNamed: "background")
texure.filteringMode = .Nearest

}
}

3
2
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?