In my code:
When the spacebar is pressed an enemy object is created, a corresponding enemyBox is created as well. But the enemyBox.speedMultiplier instance variable isn't getting set to the enemies.speedMutliplier value and instead is set to the default value (1). It's almost as if the enemies.speedMutliplier value hasn't been completely set in the spawnEnemy function before the 'on created' block is called.
Can someone please explain why this is happening? Maybe it's a synchronization issue? I admit I don't understand sync / async very well.
https://drive.google.com/file/d/1hOtJEhgl5agAFPPgpA222me8YH86wrU0/view?usp=sharing