parent
5b73c5584f
commit
6340d1ba5c
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "bokeh.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
After Width: | Height: | Size: 8.8 KiB |
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "spark.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
After Width: | Height: | Size: 5.1 KiB |
@ -0,0 +1,38 @@
|
|||||||
|
//
|
||||||
|
// Actions.swift
|
||||||
|
// ArkitDoushiQi
|
||||||
|
//
|
||||||
|
// Created by Johan LACHENAL on 12/06/2024.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
import SpriteKit
|
||||||
|
|
||||||
|
func actionRemove(size : CGSize, node : SpriteMoople, scene : SKScene) {
|
||||||
|
|
||||||
|
// Action d'étincelle
|
||||||
|
let spark = SKAction.run {
|
||||||
|
createSpark(at: node.position,on: scene)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Séquence des actions
|
||||||
|
let sequence = SKAction.sequence([spark, SKAction.removeFromParent()])
|
||||||
|
|
||||||
|
node.run(sequence)
|
||||||
|
}
|
||||||
|
|
||||||
|
func createSpark(at position: CGPoint,on scene: SKScene) {
|
||||||
|
// Créer un effet de particule pour l'étincelle
|
||||||
|
if let sparkEmitter = SKEmitterNode(fileNamed: "Spark.sks") {
|
||||||
|
sparkEmitter.position = position
|
||||||
|
scene.addChild(sparkEmitter)
|
||||||
|
|
||||||
|
// Retirer l'étincelle après une courte durée
|
||||||
|
let wait = SKAction.wait(forDuration: 1.0)
|
||||||
|
let remove = SKAction.removeFromParent()
|
||||||
|
let sequence = SKAction.sequence([wait, remove])
|
||||||
|
sparkEmitter.run(sequence)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,42 @@
|
|||||||
|
//
|
||||||
|
// actionEndGame.swift
|
||||||
|
// ArkitDoushiQi
|
||||||
|
//
|
||||||
|
// Created by Johan LACHENAL on 12/06/2024.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
import SpriteKit
|
||||||
|
|
||||||
|
func actionEndGame(scene : SKScene) {
|
||||||
|
let size = scene.size
|
||||||
|
for _ in 0..<5 {
|
||||||
|
// Créer un effet de particule pour les feux d'artifice
|
||||||
|
if let fireworkEmitter = SKEmitterNode(fileNamed: "Spark.sks") {
|
||||||
|
// Position aléatoire pour chaque feu d'artifice
|
||||||
|
let randomX = CGFloat.random(in: 0..<size.width)
|
||||||
|
let randomY = CGFloat.random(in: 0..<size.height / 2) + size.height / 2
|
||||||
|
|
||||||
|
fireworkEmitter.position = CGPoint(x: randomX, y: randomY)
|
||||||
|
|
||||||
|
// Changer la couleur des particules
|
||||||
|
fireworkEmitter.particleColor = randomColor()
|
||||||
|
fireworkEmitter.particleColorBlendFactor = 1.0
|
||||||
|
|
||||||
|
scene.addChild(fireworkEmitter)
|
||||||
|
|
||||||
|
// Retirer le feu d'artifice après une courte durée
|
||||||
|
let wait = SKAction.wait(forDuration: 2.0)
|
||||||
|
let remove = SKAction.removeFromParent()
|
||||||
|
let sequence = SKAction.sequence([wait, remove])
|
||||||
|
fireworkEmitter.run(sequence)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func randomColor() -> UIColor {
|
||||||
|
let red = CGFloat.random(in: 0...1)
|
||||||
|
let green = CGFloat.random(in: 0...1)
|
||||||
|
let blue = CGFloat.random(in: 0...1)
|
||||||
|
return UIColor(red: red, green: green, blue: blue, alpha: 1.0)
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "bokeh.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
After Width: | Height: | Size: 8.8 KiB |
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "spark.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
After Width: | Height: | Size: 5.1 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue