October 8th
October 8th
Project description: I used functions to improve the organization of the project making it easier to
understand.
import Cocoa
import Tin
//
// viewWillAppear will be called once, just before the view is placed on screen.
//
override func viewWillAppear() {
view.window?.title = "Bounce Objects"
makeView(width: 800.0, height: 600.0)
let scene = Scene()
present(scene: scene)
scene.view?.showStats = false
}
var b1 = Ball ()
var b2 = Ball ()
var b3 = Ball ()
//
// The update function is called to draw the view automatically.
//
override func update() {
background(gray: 0.5)
b1.move()
b1 . render()
b2 . move()
b2 . render()
b3 .move()
b3 .render()