swift


Why does my SKAction run twice even after removing parent node?


I have a class of spawning enemies who all inherit certain features. One of these enemies in my game has a repeat action forever loop, but for some reason it gets executed twice everytime, even after I remove the node from it's parent. Does anyone know why this happens?
enemy.run(SKAction.repeatForever(SKAction.sequence([
SKAction.wait(forDuration: 0.1),
SKAction.run{
if enemy.position == CGPoint(x: sceneto.frame.midX, y:sceneto.frame.midY) {
enemy.removeFromParent()
gameSettings.health -= self.damage[type]
player.hit(scene: sceneto)
sceneto.countText.text = "x \(sceneto.levelCount)"
} }
])))

Related Links

Cleaner way to access superview in Swift?
Does not delete marked annotations
How to make a generic class conform to a protocol for specific type?
Adding values to dictionary does not go correctly
osx macOS public key import to keychain duplicate
How to Call Func to Other Func in Swift [closed]
iOS 9.3 memory issue
Swift 3: UITabBarController error: '*** -[__NSArray0 objectAtIndex:]: index 1 beyond bounds for empty NSArray'
Separating a String from a CSV file
Perfect + SQLiteStORM, how to multiple insert
How to ensure a query happens before another query within the same function?
NSUserDefaults are sometimes cleared
Swift lazy var inconsistent behavior
How to get string case name of a enum whose rawType is Int [duplicate]
jump to page PDF in iOS Swift 3
STRUCT Array To UserDefaults

Categories

HOME
textwatcher
firebase-app-indexing
laravel-5.3
d
parse-server
travis-ci
defragmentation
xtext
devstack
metronic
flann
data-analysis
mongodb-query
phoenix
multiple-monitors
lenskit
zope
alfresco-share
cairo
plupload
flexboxgrid
nmake
google-maps-android-api-2
kitematic
delete-file
jquery-waypoints
ui5
mef2
nesc
positioning
xor
outsystems
skygear
swiftcharts
npm-shrinkwrap
precedence
google-guava-cache
installshield-2012
ddms
knockout-3.0
bing-translator-api
distributed-transactions
matlab-cvst
proof
amazon-machine-learning
seamless-immutable
applepayjs
dwarf
ruby-on-rails-2
tcserver
paas
emoticons
addin-express
adler32
barcode-printing
gradle-script-kotlin
ebtables
picasa
excon
gameanalytics
database-backups
kendo-combobox
mfc-feature-pack
yoothemes
insertion-sort
urn
twitter-rest-api
bridge
es2015
c++-actor-framework
symfony-2.6
temp-tables
adcolony
formvalidation-plugin
outline
sgml
initialization-vector
chrome-for-android
document-database
windows-mobile-6
ftp4j
surveyor-gem
awesomeprint
qt4.6
xml-libxml
shim
isolatedstorage
userid
visual-web-gui
datacontract
curljs
posting
scalaxb
smooth
openvg
configurable

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App