Merge branch '42-explosion-animation-beim-angriff' into 'development'
Resolve "Explosion Animation beim Angriff" Closes #42 See merge request marcel.schwarz/software-projekt-2!107
This commit is contained in:
commit
c68ed6ea97
@ -22,6 +22,7 @@
|
||||
3EAD889524801B6A0048A10A /* RoundTimer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EAD889424801B6A0048A10A /* RoundTimer.swift */; };
|
||||
3EBD242E245D9332003CECE7 /* Team.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EBD242D245D9332003CECE7 /* Team.swift */; };
|
||||
3F745DF0246F48FC00CE7375 /* PlayerMoveType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F745DEF246F48FC00CE7375 /* PlayerMoveType.swift */; };
|
||||
3F79FFE02486F7CD003F79C3 /* Explosion.sks in Resources */ = {isa = PBXBuildFile; fileRef = 3F79FFDF2486F7CD003F79C3 /* Explosion.sks */; };
|
||||
3FE19DB5246C7A22004827AB /* RoundCalculatorService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FE19DB4246C7A22004827AB /* RoundCalculatorService.swift */; };
|
||||
8BB6FF402472B8F000162BBD /* SingeClickButtonNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BB6FF3F2472B8F000162BBD /* SingeClickButtonNode.swift */; };
|
||||
9E0E459724796262009817A6 /* GameCenterManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E0E459624796262009817A6 /* GameCenterManager.swift */; };
|
||||
@ -85,6 +86,7 @@
|
||||
3EAD889424801B6A0048A10A /* RoundTimer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoundTimer.swift; sourceTree = "<group>"; };
|
||||
3EBD242D245D9332003CECE7 /* Team.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Team.swift; sourceTree = "<group>"; };
|
||||
3F745DEF246F48FC00CE7375 /* PlayerMoveType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerMoveType.swift; sourceTree = "<group>"; };
|
||||
3F79FFDF2486F7CD003F79C3 /* Explosion.sks */ = {isa = PBXFileReference; lastKnownFileType = file.sks; path = Explosion.sks; sourceTree = "<group>"; };
|
||||
3FE19DB4246C7A22004827AB /* RoundCalculatorService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoundCalculatorService.swift; sourceTree = "<group>"; };
|
||||
8BB6FF3F2472B8F000162BBD /* SingeClickButtonNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SingeClickButtonNode.swift; sourceTree = "<group>"; };
|
||||
9E0E459624796262009817A6 /* GameCenterManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameCenterManager.swift; sourceTree = "<group>"; };
|
||||
@ -233,6 +235,7 @@
|
||||
9E11FF74245CD79100EED3BE /* Partikels */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3F79FFDF2486F7CD003F79C3 /* Explosion.sks */,
|
||||
9E11FF77245CD81100EED3BE /* Fire.sks */,
|
||||
);
|
||||
path = Partikels;
|
||||
@ -369,6 +372,7 @@
|
||||
110360E0244B101B008610AF /* Assets.xcassets in Resources */,
|
||||
110360E3244B101B008610AF /* LaunchScreen.storyboard in Resources */,
|
||||
C04783EE2468583F004961FB /* intro-music.mp3 in Resources */,
|
||||
3F79FFE02486F7CD003F79C3 /* Explosion.sks in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -143,6 +143,22 @@ class EntityManager {
|
||||
base.ownershipPlayer = nil
|
||||
}
|
||||
if getOwnerBySnapBase != nil {
|
||||
if base.ownershipPlayer != getOwnerBySnapBase {
|
||||
//TODO: Outsource following with a AnimationManager
|
||||
let explosion = SKEmitterNode(fileNamed: "Explosion")!
|
||||
scene.addChild(explosion)
|
||||
explosion.zPosition = 2
|
||||
explosion.position = base.position
|
||||
explosion.name = "explosion"
|
||||
explosion.particleColorSequence = nil
|
||||
explosion.particleColorBlendFactor = 1.0
|
||||
let wait = SKAction.wait(forDuration: 1)
|
||||
let removeParticle = SKAction.removeFromParent()
|
||||
let sequence = SKAction.sequence([wait, removeParticle])
|
||||
explosion.run(sequence)
|
||||
}
|
||||
|
||||
|
||||
if getOwnerBySnapBase == GKLocalPlayer.local {
|
||||
base.component(ofType: DefaultBaseComponent.self)?.labelNode.text = "\(base.unitCount)"
|
||||
} else {
|
||||
|
BIN
GoldWars/GoldWars/Partikels/Explosion.sks
Normal file
BIN
GoldWars/GoldWars/Partikels/Explosion.sks
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user