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

How to update both Email and Password with new Firebase in swift
Create Rounded Corner focusRing NSTextField
Why adding action to button in UICollectionViewCell not working well?
TextFields are not showing in storyboard?
Drag GoogleMaps-Marker via swiping over map
NSUTF8StringEncoding not working when decoding the same message
Where to add `addPersistentStoreWithType:configuration:URL:options:error:` in Swift Core Data Application?
I need to set a notification on a specific day every week.. but I don`t care the day of the month
Xcode Swift Quick Help Closures
Swift Inherited Protocols and Conformance Checking for the Parent-Protocol
Copy NSTableView row greyed out
How to find out if card was declined in Braintree Payments
how to create a class and return something. Swift
Call custom action in spritekit around 100 times in 3 seconds
Firebase Storage Upload Error: FIRStorageErrorDomain Code=-13000
Use of instance member 'meow' on type 'Cat' did you mean to use a value of type 'Cat' instead?

Categories

HOME
cntk
ember.js
mql4
nuxeo
vs-team-services
reportportal
search-engine
chaiscript
vlc
wampserver
laravel-4
dataframe
urlencode
spring-cloud-contract
dropbox
octopus-deploy
uiactivityviewcontroller
wicket
wordpress-theming
dlib
cloudflare
uisplitviewcontroller
titan
riak
medium-editor
opera-mini
python-unicode
apache-karaf
arm-template
grub2
aws-cognito
dspic
nsmenuitem
header-files
yosys
continuous-deployment
cep
mef2
classpath
clockwork
helix-3d-toolkit
initializer
haskell-pipes
s3cmd
ical-dotnet
pytest-django
ttcn
uiviewpropertyanimator
gist
spell-checking
heroku-postgres
httplib2
uicollectionviewlayout
ingres
restivejs
xib
icefaces
chessboard.js
children
firepath
image-editing
mongo-c-driver
elastix
distribute
test-class
programming-paradigms
calibration
bridge
pylearn
hg-git
ultrawingrid
mser
ember-components
log4cplus
libssh2
colt
help-viewer
magicalrecord-2.2
bfd
fogbugz-api
loop-invariant
sttwitter
abnf
code-conversion
wcf-web-api
newsstand-kit
ihttphandler
sendfile
ruby-debug
gethashcode
msn
hardware-acceleration
unreachable-code
external-assemblies
communicationexception
idictionary
database-diagramming

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