//Flappy Birds Start

   
var tTubeX=CGFloat() var birdY=CGFloat() @IBOutlet weak var topTube: UIImageView! @IBOutlet weak var botTube: UIImageView! @IBOutlet weak var bird: UIImageView! func sizeObjects(){ var screenWidth:CGFloat=0.0; var screenHeight:CGFloat=0.0; var screenSize: CGRect = UIScreen.mainScreen().bounds screenWidth = screenSize.width; screenHeight = screenSize.height; tTubeX=screenWidth-50; birdY=100 topTube.frame.size=CGSizeMake(30, 500) topTube.frame.origin = CGPoint(x: screenWidth-50, y: 0) self.view.addSubview(topTube)//you may need to add outlet to view again. botTube.frame.size=CGSizeMake(30, 500) botTube.frame.origin = CGPoint(x: screenWidth-50, y: 530 ) self.view.addSubview(botTube)//you may need to add outlet to view again. } override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. self.view.backgroundColor = UIColor(patternImage: UIImage(named: "sky.png")!) sizeObjects() moveThings() }