Coding A Cookie Clicker like App?


ok, problem i'm attempting put use of things i've learned in xcode tutorial use. i'm trying make cookie clicker clone sort of, basic functionality keep track of how many times click button. have far i've gotten label change based on how many times click button. have 2 problems, first time posting here, address 1 issue @ time. first issue getting app have upgrades. have issue, i'm not sure how go making , upgrade, simple doubling cookies per click. here code:import uikit

code:
class viewcontroller: uiviewcontroller {            var numberofclicks = 1            @iboutlet var score: uilabel!            @ibaction func clicks() {                  score.text = "\(numberofclicks++)"      }            }              func viewdidload() {                }

there button, connected ibaction, , label, connected outlet. want add third button add upgrade. i'm not quite sure, said, how go adding upgrade. want make cookies double per click, i'm not sure, need make numberofclicks++ variable somehow can double later on? , how connect 1 button other button when click upgrade button changes code of other button subtracts score , makes lets say, 2 cookies per click instead of 1? ideas? (i'm not sure if i'm allowed add 2 topics ignore if i'm not allowed to, how game save score after closing it? nobody want play game doesn't save score , have restart every single time. remember project myself, , i'm beginner try explain things please!) :)
 

i'm not totally sure trying do... if trying double number multiply variable 2.

can many variables , use booleans see if upgrade in place or not... hope helps. feel free pm me.
 


Forums iPhone, iPad, and iPod Touch iOS Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

Comments

Popular posts from this blog

OS X El Capitan on Unsupported Macs

[SOLVED] SFOTT usb key not bootable Mavericks

Fernando Torres: One of the all-time greats?