Posts

Post not yet marked as solved
17 Replies
3.8k Views
Hello thereI began coding for iOS after a few year and, though I like how it works in Xcode, I can't help but getting suspicious at how something doesn't seem to work properly, for exemple, in this snippet, the tiles will go were I expect them to, but won't fade away by a half.: addChild(shape) let placeIt = SKAction.group( [ SKAction.fadeAlpha(by: 0.5, duration: 2), SKAction.move(to: CGPoint(x: CGFloat(x) * (SIZE + SPACE) + dX, y: CGFloat(y) * (SIZE + SPACE) + dY), duration: 2)]) placeIt.timingMode = SKActionTimingMode.easeInEaseOut NSLog("moving %@", shape.name!) shape.run(placeIt, withKey: "placeIt \(shape.name!)") NSLog("%@ moved", shape.name!)Even stranger, I invoke a function just after this loops which targets 2 specific shapes in order to fade them back in, then rotate them. Of course, they've not been faded, but they won't rotate and even the NSLog statements won't be anywhere to see.Later in the game it works if I rotate once (on touchEnd), but If I want to also rotate the surrounding, it does stop to rotate aven once by further attempts.These shapes use Physics. I know the bitmasks are right but there never seem to have a contact even though it should happen. Show physics is relevant: there's a border when expected and rotating the shapes should trigger a contact which used to happen, but not anymore. I also never got the scaling to get properly.Seriously, I don't understand what is going here 😟Should the SKActions only be run in a specific context?Please help!Mirx
Posted
by mirxvid.
Last updated
.