Advertisement
SwiftTut

Swift TUTORIAL PLAYGROUND #3

Aug 3rd, 2015
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.65 KB | None | 0 0
  1. // Agar.io SWIFT
  2. class blob {
  3.     var mass = 10
  4.     var minMassToShoot = 30 // Change to get diffrent results
  5.     var minMassToSplit = 50 // Change to get diffrent results
  6. }
  7. var points = 1
  8. struct mapSize {
  9.     var width = 18000
  10.     var height = 18000
  11. }
  12.     var b = blob()
  13.     func Split() {
  14.         if b.mass > 49 {
  15.            b.mass = b.mass / 2
  16.         } else {
  17.             println("Error! you can't split yet")
  18.         }
  19.      }
  20.          func Shoot() {
  21.         if b.mass > 29 {
  22.            b.mass = b.mass - 10
  23.         } else {
  24.             println("Error! you can't shoot mass out yet")
  25.         }
  26.      }
  27.      //To try this SwiftStub.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement