Swift is a programming language for iOS, OS X, and watchOS. Use this tag is code in question is written in Swift.
0
votes
1answer
43 views
Where should I save game object's attributes (hp, score) in Swift?
Scenario: I have a game with several game objects on screen. Each can have different score and hitpoints. When I use collision detection for cannonball vs. ship (example) I need to know which ship is ...
0
votes
0answers
21 views
How to use objects with different attribute values in Swift?
I think this is a really basic question and to make it easier to understand what I do not understand, I use the following scenario.
Scenario: I have two or more ships in my game. They should have ...
0
votes
1answer
17 views
How can I avoid a delay with continues touch detection in swift?
I want control a character on my screen with a continuous swipe gesture. As soon as I do a swipe +x or -x my character moves left or right. And as long as I hold my finger it continuous to move to the ...
0
votes
1answer
37 views
Is it possible to detect contact with every frame change when using an animation in SpriteKit?
Is it possible to detect contact with every frame change when using an animation in SpriteKit? For example, if I have two nodes of a person walking, I want to detect contact with the ground each time ...
0
votes
1answer
32 views
How to choose a SKSpriteNode randomly?
I want to choose from 4 enemies using random and present it on scene. For that purpose I've made this:
func enemyPicker() -> SKSpriteNode {
var enemyArray = [mouse, robot, drone, block, bird]
var ...
0
votes
0answers
6 views
How to assign a button in the main storyboard to launch the GameViewController.swift file
I am quite new to swift and I have constructed a main menu in the main.storyboard file, how do I assign the 'Play Now' button to launch the GameViewController.swift file where I actually plan to ...
0
votes
1answer
97 views
problem with SCNTransaction in Scene Kit
I'm trying to move an object over a period of ten seconds from y coordinate 0 to y coordinate 10. the object is created at y coordinate 0. The problem is when the animation starts, the object pops ...