Discord
Login
Community
DARK THEME

Thanks AJiscool

I know you drew a new and better sprite for the button for the guide in my game I know this is random but a sprite just appeared in my gamed called "guide2" and to be honest it looks better then the normal button I know you did it and thank you I will ask this. Why?

oh and I'm trying to add a new button but when I add it the game freezes and when I update the code all of the sudden it unfreezes? and the button wont even show up: here is the code (its long lol)

init = function()
//loading system(Point menu) -------------------------------------------------------
  Points = storage.get("point")
  BaseUPG1 = storage.get("Base_UPG1")
  ValeurClic = storage.get("Point_Gain")
  BaseBoost = storage.get("formula_v1")
  MultiBoost = storage.get("formula_v2")
  MultiUPG1 = storage.get("Multi_UPG1")
  MultiUPG1Lvl = storage.get("Multi_UPG1Lvl")
  MultiUPG2Lvl = storage.get("MultiUPG2_Lvl")
  MultiUPG2 = storage.get("MultiUPG2")
  ExpondentalBoost = storage.get("formula_v3")
//loading system(Prestige) -------------------------------------------------------
  PrestigePoints = storage.get("prestige")
  PrestigeBought = storage.get("PUPG1")
  PrestigeBoostMulti = storage.get("formula_v4")
  PercentClick = storage.get("Automation1")
  PrestigeBought2 = storage.get("PUPG2")
  PrestigeBoughtG = storage.get("PUPG_G")
  PPMultiBoost = storage.get("PFormula_v1")
  PPExpondentalBoost = storage.get("PFormula_v2")
  PrestigeBoughtF = storage.get("PreFeature")
  ExpondentalBoostXP = storage.get("XPFormula_v1")
  MultiBoostXP = storage.get("XPFormula_v2")
  BaseBoostXP = storage.get("XPFormula_v3")
  XP = storage.get("Levels")
  MaxXp = storage.get("MaxXp")
  levels = storage.get("Levels2")
  BoostDisplayPoints = storage.get("xpboostdisplay1")
  PrestigeBought3 = storage.get("PUPG3")
  PrestigeBoughtG2 = storage.get("PUPG2_G")
  PrestigeBoughtG3 = storage.get("PUPG3_G")
  PrestigeBought4 = storage.get("PUPG4")
  PrestigeBought5 = storage.get("PUPG5")
  PrestigeBought6 = storage.get("PUPG6")
//loading system(Reincarnation)
  REMultiBoost = storage.get("REFormula_v1")
  REExpondentalBoost = storage.get("REFormula_v2")
  REMultiBoostXP = storage.get("REXPFormula_v1")
  REPPMultiBoost = storage.get("REPFormula_v1")
  ReMi = storage.get("Re_Mile")
  TierCost = storage.get("Tier")
  MultiBoostTier = storage.get("Tier2")
  XPMultiBoostTier = storage.get("Tier3")
  PPMultiBoostTier = storage.get("Tier4")
  TimeSincePrestige = storage.get("Timer")
  TimeSinceReincarnation = storage.get("Timer2")
  PrestigeBought_Persist_Rein1 = storage.get("PUPG1_Persist_REIN")
  PrestigeBought_Persist_Rein2 = storage.get("PUPG2_Persist_REIN")
  
  
  if Points == undefined then Points = 0 end
  if BaseUPG1 == undefined then BaseUPG1 = 10 end
  if ValeurClic == undefined then ValeurClic = 1 end
  if MultiUPG1 == undefined then MultiUPG1 = 250 end
  if MultiUPG1Lvl == undefined then MultiUPG1Lvl = 0 end
  if BaseBoost == undefined then BaseBoost = 0 end
  if MultiBoost == undefined then MultiBoost = 1 end
  if MultiUPG2 == undefined then MultiUPG2 = 10000 end
  if MultiUPG2Lvl == undefined then MultiUPG2Lvl = 0 end
  if ExpondentalBoost == undefined then ExpondentalBoost = 1 end
  if PrestigePoints == undefined then PrestigePoints = 0 end
  if PrestigeBought2 == undefined then PrestigeBought2 = 0 end
  if PrestigeBought == undefined then PrestigeBought = 0 end
  if PrestigeBoostMulti == undefined then PrestigeBoostMulti = 1 end
  if PercentClick == undefined then PercentClick = 0 end
  if PrestigeBoughtG == undefined then PrestigeBoughtG = 0 end
  if PPMultiBoost == undefined then PPMultiBoost = 1 end
  if PPExpondentalBoost == undefined then PPExpondentalBoost = 1 end
  if PrestigeBoughtF == undefined then PrestigeBoughtF = 0 end
  if ExpondentalBoostXP == undefined then ExpondentalBoostXP = 1 end
  if BaseBoostXP == undefined then BaseBoostXP = 0 end
  if MultiBoostXP == undefined then MultiBoostXP = 1 end
  if XP == undefined then XP = 0 end
  if MaxXp == undefined then MaxXp = 50 end
  if BoostDisplayPoints == undefined then BoostDisplayPoints = 1000 end
  if PrestigeBought3 == undefined then PrestigeBought3 = 0 end
  if PrestigeBoughtG2 == undefined then PrestigeBoughtG2 = 0 end
  if PrestigeBoughtG3 == undefined then PrestigeBoughtG3 = 0 end
  if PrestigeBought4 == undefined then PrestigeBought4 = 0 end
  if PrestigeBought5 == undefined then PrestigeBought5 = 0 end
  if PrestigeBought6 == undefined then PrestigeBought6 = 0 end
  if ReMi == undefined then ReMi = 0 end
  if REMultiBoost == undefined then REMultiBoost = 1 end
  if REExpondentalBoost == undefined then REExpondentalBoost = 1 end
  if REMultiBoostXP == undefined then REMultiBoostXP = 1 end
  if REPPMultiBoost == undefined then REPPMultiBoost = 1 end
  if levels == undefined then levels = 1 end
  if TierCost == undefined then TierCost = 10 end
  if MultiBoostTier == undefined then MultiBoostTier = 1 end
  if XPMultiBoostTier == undefined then XPMultiBoostTier = 1 end
  if PPMultiBoostTier == undefined then PPMultiBoostTier = 1 end
  if TimeSincePrestige == undefined then TimeSincePrestige = 0 end
  if PrestigeBought_Persist_Rein1 == undefined then PrestigeBought_Persist_Rein1 = 0 end
  if TimeSinceReincarnation == undefined then TimeSinceReincarnation = 0 end
  if PrestigeBought_Persist_Rein2 == undefined then PrestigeBought_Persist_Rein2 = 0 end

  
// defining importent values---------------------------------------------  
  stade = ""
  color = "rgb(0, 170, 255)"
  color2 = "rgb(0, 98, 147)"
  colorSub1 = ""
  visual = ""
  PrestigePointToPointFormatic1 = log(PrestigePoints^(1/2.3025850929940456*(PrestigeBought3*2))) + 1 
  PointToPointFormatic1 = log(Points^(1/2.3025850929940456*(PrestigeBought4/2))) + 1
  PointToPrestigePointFormatic1 = (log(Points^(1/2.3025850929940456*(PrestigeBought5/2))) + 1)^(1/1.75)
  TimeSincePrestigeToPointFormatic1 = (log(TimeSincePrestige^(1/2.3025850929940456*(PrestigeBought_Persist_Rein1/2))) + 1)^(1)
  TimeSinceReincarnationToPointFormatic1 = (log(TimeSinceReincarnation^(1/2.3025850929940456*(PrestigeBought_Persist_Rein1/1.5))) + 1)^(1/1.5)
  
  
  menu = []
  msg = ""
  msgTimer = 0
  saveTimer = 0
  UPGcooldown = 0
  sound = 0
  Music = ""
  progress = 0
  
  
  
  

//(Data object(WIP))--------------------------

//(Point Menu Button function)-----------------------------------
  
  Button = class
    constructor = function(x, y, width, height, id)
      this.x = x
      this.y = y
      this.width = width
      this.height = height
      this.id = id
      this.oldW = width
      this.oldH = height
    end
  end
  
  
  
  buttons = []
  buttons.push(new Button(-175, -75, 45, 45, "1"))
  buttons.push(new Button(175, 70, 45, 45, "2"))
  buttons.push(new Button(150, -75, 100, 40, "3")) 
  buttons.push(new Button(150, -30, 100, 40, "4")) 
  buttons.push(new Button(150, 15, 100, 40, "5"))
  buttons.push(new Button(-175, 40, 30, 30, "6"))
  buttons.push(new Button(-120, -75, 45, 45, "7"))
  buttons.push(new Button(-175, 0, 30, 30, "8"))
  buttons.push(new Button(125, 70, 45, 45, "9"))
  buttons.push(new Button(-135, 0, 30, 30, "10"))
  buttons2.push(new Button(-175, -35, 30, 30, "11"))
end
//main code--------------------------------------------------------------
update = function()
//audio ---------------------------------------------------------------------------
  sound += floor(system.time()/1000000000000)/60
  if stade == "Level" and sound > 8 then
    Music = audio.playSound("level", 1, 1, 0, 0)
    sound = 0
  elsif stade == "" then
    sound = 10000
    Music.stop()
    Music = ""
  elsif stade == "Tier" and sound > 20 then
    sound = 0
    Music = audio.playSound("tier", 1, 1, 0, 0)
  elsif stade == "Reincarnation" and sound > 30 then
    sound = 0
    Music = audio.playSound("reincarnation", 1, 1, 0, 0)
  elsif stade == "Reincarnation2" and sound > 30 then
    sound = 0
    Music = audio.playSound("reincarnation", 1, 1, 0, 0)
  end

//automation functions-------------------------------------------------------------------------
    if PercentClick >= 1 then
      Points += (ValeurClic/100/60)*PercentClick
    end
    
    if ReMi >= 5 then
      PrestigePoints += ((PrestigeGain/10000)/60)*(10^(ReMi-5))
    end
  
  if msgTimer > 0 then msgTimer -= 1 end
  if UPGcooldown > 0 then UPGcooldown -= 1 end
  
      if ReMi > 0 then 
        if Points >= BaseUPG1 then
          BaseBoost += 1
          BaseUPG1 = floor(BaseUPG1 * 1.25)
          msg = "Auto Upg"
          msgTimer = 120
        end
      end
      
      if ReMi > 1 then 
        if Points >= MultiUPG1 and MultiUPG1Lvl < 50 then
          MultiBoost *= 1.5
          MultiUPG1Lvl += 1
          if MultiUPG1 < 1e6 then
            MultiUPG1 *= 2
          elsif MultiUPG1 >= 1e6 then
            MultiUPG1 *= 5
          end
          msg = "Auto Upg"
          msgTimer = 120
        end
      end
      
      if ReMi > 2 then 
        if Points >= MultiUPG2 and MultiUPG2Lvl < 10 then
          MultiBoost *= 2
          MultiUPG2Lvl += 1
          if MultiUPG2 < 1e6 then
            MultiUPG2 *= 10
          elsif MultiUPG2 >= 1e6 then
            MultiUPG2 *= 25
          end
          msg = "Auto Upg"
          msgTimer = 120
        end
      end
      
//progress bar-----------------------------------------------      
  if Points < 1e6 and PrestigePoints == 0 and PrestigeBought == 0 and ReMi == 0 then
    progress = log(Points + 1) / log(1000001)
  elsif PrestigePoints >= 0 and PrestigeBought == 1 and PrestigeBoughtF == 0 then
    progress = log(PrestigePoints + 1) / log(51)
  elsif Points < 1e19 and PrestigeBought == 1 and PrestigeBoughtF == 1 and ReMi == 0 then
    progress = log(Points + 1) / log(1e19 + 1) 
  elsif ReMi > 0 and ReMi < 3 then
    progress = (ReMi / 3)
  elsif ReMi >= 3 and ReMi < 7 and Points < 1e38 then
    progress = log(Points+1) / log(1e38+1)
  end
  
      
//Auto Save(sub)
    if saveTimer > 0 then saveTimer -= 1
  elsif saveTimer <= 0 then
        storage.set("point", Points)
        storage.set("Base_UPG1", BaseUPG1)
        storage.set("Point_Gain", ValeurClic)
        storage.set("Multi_UPG1", MultiUPG1)
        storage.set("Multi_UPG1Lvl", MultiUPG1Lvl)
        storage.set("formula_v1", BaseBoost)
        storage.set("formula_v2", MultiBoost)
        storage.set("MultiUPG2_Lvl", MultiUPG2Lvl)
        storage.set("MultiUPG2", MultiUPG2)
        storage.set("formula_v3", ExpondentalBoost)
        storage.set("prestige", PrestigePoints)
        storage.set("PUPG1", PrestigeBought)
        storage.set("formula_v4", PrestigeBoostMulti)
        storage.set("Automation1", PercentClick)
        storage.set("PUPG2", PrestigeBought2)
        storage.set("PFormula_v1", PPMultiBoost)
        storage.set("PFormula_v2", PPExpondentalBoost)
        storage.set("PUPG_G", PrestigeBoughtG)
        storage.set("PreFeature", PrestigeBoughtF)
        storage.set("XPFormula_v1", ExpondentalBoostXP)
        storage.set("XPFormula_v2", MultiBoostXP)
        storage.set("XPFormula_v3", BaseBoostXP)
        storage.set("Levels", XP)
        storage.set("MaxXp", MaxXp)
        storage.set("xpboostdisplay1", BoostDisplayPoints)
        storage.set("PUPG3", PrestigeBought3)
        storage.set("PUPG2_G", PrestigeBoughtG2)
        storage.set("PUPG3_G", PrestigeBoughtG3)
        storage.set("PUPG4", PrestigeBought4)
        storage.set("PUPG5", PrestigeBought5)
        storage.set("PUPG6", PrestigeBought6)
        storage.set("REFormula_v1", REMultiBoost)
        storage.set("REFormula_v2", REExpondentalBoost)
        storage.set("REXPFormula_v1", REMultiBoostXP)
        storage.set("REPFormula_v1", REPPMultiBoost)
        storage.set("Re_Mile", ReMi)
        storage.set("Levels2", levels)
        storage.set("Tier", TierCost)
        storage.set("Tier2", MultiBoostTier)
        storage.set("Tier3", XPMultiBoostTier)
        storage.set("Tier4", PPMultiBoostTier)
        storage.set("Timer", TimeSincePrestige)
        storage.set("PUPG1_Persist_REIN", PrestigeBought_Persist_Rein1 )
        storage.set("PUPG2_Persist_REIN", PrestigeBought_Persist_Rein2 )
        storage.set("Timer2", TimeSinceReincarnation)
    saveTimer = 300
  end
  
//formatic systems
  ValeurClic = floor((((1 + BaseBoost) * MultiBoost * PrestigeBoostMulti * PrestigePointToPointFormatic1 * PointToPointFormatic1 * REMultiBoost * MultiBoostTier * TimeSincePrestigeToPointFormatic1) ^ ExpondentalBoost)*1000)/1000
  PrestigeGain = floor((((Points*1000)/1000)/1e6)^(1/3) * PPMultiBoost * PointToPrestigePointFormatic1 * REPPMultiBoost * PPMultiBoostTier) ^ PPExpondentalBoost
  if PrestigeBoughtG2 == 0 then
    PointBoostXP = (log(Points)^(1/3))
  elsif PrestigeBoughtG2 == 1 then
    PointBoostXP = (log(Points)^(1/1.5))
  end
  XPGain = ((1 + BaseBoostXP) * MultiBoostXP * PointBoostXP * REMultiBoostXP * XPMultiBoostTier) ^ ExpondentalBoostXP
  PrestigePointToPointFormatic1 = log(PrestigePoints^(1/2.3025850929940456*(PrestigeBought3*2))) + 1
  PointToPointFormatic1 = log(Points^(1/2.3025850929940456*(PrestigeBought4/2))) + 1
  PointToPrestigePointFormatic1 = (log(Points^(1/2.3025850929940456*(PrestigeBought5))) + 1)^(1/1.75)
  TimeSincePrestige += 1
  TimeSinceReincarnation += 1
  TimeSincePrestigeToPointFormatic1 = (log(TimeSincePrestige^(1/1.60943791*(PrestigeBought_Persist_Rein1))) + 1)^1
  TimeSinceReincarnationToPointFormatic1 = (log(TimeSinceReincarnation^(1/1.60943791*(PrestigeBought_Persist_Rein2/1.5))) + 1)^((1*(TimeSinceReincarnation/60)^0.05))
//Point Menu Buttons------------------------------------------------------  
  for b in buttons
    local targetW = b.width
    local targetH = b.height
     
    if checkRectMouseHover(b.x, b.y, b.width, b.height) then
      targetW = b.width + 15
      targetH = b.height + 15
    
      
      if b.id == "2" and stade == "" and mouse.press then 
        Points += ValeurClic 
      end
      
      if b.id == "1" and stade == "" and mouse.press then
        storage.set("point", Points)
        storage.set("Base_UPG1", BaseUPG1)
        storage.set("Point_Gain", ValeurClic)
        storage.set("Multi_UPG1", MultiUPG1)
        storage.set("Multi_UPG1Lvl", MultiUPG1Lvl)
        storage.set("formula_v1", BaseBoost)
        storage.set("formula_v2", MultiBoost)
        storage.set("MultiUPG2_Lvl", MultiUPG2Lvl)
        storage.set("MultiUPG2", MultiUPG2)
        storage.set("formula_v3", ExpondentalBoost)
        storage.set("prestige", PrestigePoints)
        storage.set("PUPG1", PrestigeBought)
        storage.set("formula_v4", PrestigeBoostMulti)
        storage.set("Automation1", PercentClick)
        storage.set("PUPG2", PrestigeBought2)
        storage.set("PFormula_v1", PPMultiBoost)
        storage.set("PFormula_v2", PPExpondentalBoost)
        storage.set("PUPG_G", PrestigeBoughtG)
        storage.set("PreFeature", PrestigeBoughtF)
        storage.set("XPFormula_v1", ExpondentalBoostXP)
        storage.set("XPFormula_v2", MultiBoostXP)
        storage.set("XPFormula_v3", BaseBoostXP)
        storage.set("Levels", XP)
        storage.set("MaxXp", MaxXp)
        storage.set("xpboostdisplay1", BoostDisplayPoints)
        storage.set("PUPG3", PrestigeBought3)
        storage.set("PUPG2_G", PrestigeBoughtG2)
        storage.set("PUPG3_G", PrestigeBoughtG3)
        storage.set("PUPG4", PrestigeBought4)
        storage.set("PUPG5", PrestigeBought5)
        storage.set("PUPG6", PrestigeBought6)
        storage.set("REFormula_v1", REMultiBoost)
        storage.set("REFormula_v2", REExpondentalBoost)
        storage.set("REXPFormula_v1", REMultiBoostXP)
        storage.set("REPFormula_v1", REPPMultiBoost)
        storage.set("Re_Mile", ReMi)
        storage.set("Levels2", levels)
        storage.set("Tier", TierCost)
        storage.set("Tier2", MultiBoostTier)
        storage.set("Tier3", XPMultiBoostTier)
        storage.set("Tier4", PPMultiBoostTier)
        storage.set('Timer', TimeSincePrestige)
        storage.set("PUPG1_Persist_REIN", PrestigeBought_Persist_Rein1 )
        storage.set("PUPG2_Persist_REIN", PrestigeBought_Persist_Rein2 )
        storage.set("Timer2", TimeSinceReincarnation)
        msg = "GAME SAVED!"
        msgTimer = 120
      end

      if b.id == "3" and stade == "" and mouse.press then 
        if Points >= BaseUPG1 then
          Points -= BaseUPG1
          BaseBoost += 1
          BaseUPG1 = floor(BaseUPG1 * 1.25)
          msg = "UPGRADE BOUGHT!"
          msgTimer = 120
        end
      end
      
    
      
       if b.id == "4" and stade == "" and BaseUPG1 >= 12 and mouse.press then
        if Points >= MultiUPG1 and MultiUPG1Lvl < 50 then
          Points -= MultiUPG1
          MultiUPG1Lvl += 1
          MultiBoost = (MultiBoost * 1.5)
          if MultiUPG1 < 1e6 then
            MultiUPG1 *= 2
          end
          if MultiUPG1 >= 1e6 then
            MultiUPG1 *= 5
          end
        end
      end
    
        if b.id == "5" and stade == "" and MultiUPG1Lvl >= 1 and mouse.press then
          if Points >= MultiUPG2 and MultiUPG2Lvl < 10 then
            Points -= MultiUPG2
            MultiUPG2Lvl += 1
            MultiBoost = (MultiBoost * 2)
            if MultiUPG2 < 1e6 then
              MultiUPG2 *= 10
            end
            if MultiUPG2 >= 1e6 then
              MultiUPG2 *= 25
            end
          end
        end

            if b.id == "6" and stade == "" and MultiUPG2Lvl > 0 and mouse.press or PrestigePoints > 0 and b.id == "6" and stade == "" and mouse.press then
              stade = "prestige_mode"
        end
          
          if b.id == "7" and stade == "" and mouse.press then
        storage.set("point", 0)
        storage.set("Base_UPG1", 0)
        storage.set("Point_Gain", 0)
        storage.set("Multi_UPG1", 0)
        storage.set("Multi_UPG1Lvl", 0)
        storage.set("formula_v1", 0)
        storage.set("formula_v2", 1)
        storage.set("MultiUPG2_Lvl", 0)
        storage.set("MultiUPG2", 0)
        storage.set("formula_v3", 1)
        storage.set("prestige", 0)
        storage.set("PUPG1", 0)
        storage.set("formula_v4", 1)
        storage.set("Automation1", 0)
        storage.set("PUPG2", 0)
        storage.set("PFormula_v1", 1)
        storage.set("PFormula_v2", 1)
        storage.set("PUPG_G", 0)
        storage.set("PreFeature", 0)
        storage.set("XPFormula_v1", 1)
        storage.set("XPFormula_v2", 1)
        storage.set("XPFormula_v3", 0)
        storage.set("Levels", 0)
        storage.set("MaxXp", 50)
        storage.set("xpboostdisplay1", 1000)
        storage.set("PUPG3", 0)
        storage.set("PUPG2_G", 0)
        storage.set("PUPG3_G", 0)
        storage.set("PUPG4", 0)
        storage.set("PUPG5", 0)
        storage.set("PUPG6", 0)
        storage.set("REFormula_v1", 1)
        storage.set("REFormula_v2", 1)
        storage.set("REXPFormula_v1", 1)
        storage.set("REPFormula_v1", 1)
        storage.set("Re_Mile", 0)
        storage.set("Levels2", 1)
        storage.set("Tier", 10)
        storage.set("Tier2" 1)
        storage.set("Tier3", 1)
        storage.set("Tier4", 1)
        storage.set("Timer", 0)
        storage.set("PUPG1_Persist_REIN", 0)
        storage.set("PUPG2_Persist_REIN", 0)
        storage.set("Timer2", 0)
        Points = 0
        BaseUPG1 = 10
        BaseBoost = 0
        MultiBoost = 1
        MultiUPG1 = 250
        MultiUPG1Lvl = 0
        MultiUPG2Lvl = 0
        MultiUPG2 = 10000
        ExpondentalBoost = 1
        PrestigePoints = 0 
        PrestigeBought = 0
        PrestigeBoostMulti = 1
        PercentClick = 0
        PrestigeBought2 = 0
        PPMultiBoost = 1
        PPExpondentalBoost = 1
        PrestigeBoughtG = 0
        PrestigeBoughtF = 0
        ExpondentalBoostXP = 1
        BaseBoostXP = 0
        MultiBoostXP = 1
        XP = 0
        MaxXp = 50
        BoostDisplayPoints = 1000
        PrestigeBought3 = 0
        PrestigeBoughtG2 = 0
        PrestigeBoughtG3 = 0
        PrestigeBought4 = 0
        PrestigeBought5 = 0
        PrestigeBought6 = 0
        REMultiBoost = 1
        REExpondentalBoost = 1
        REMultiBoostXP = 1
        REPPMultiBoost = 1
        ReMi = 0
        levels = 1
        TierCost = 10
        MultiBoostTier = 1
        XPMultiBoostTier = 1
        PPMultiBoostTier = 1
        TimeSincePrestige = 0
        PrestigeBought_Persist_Rein1 = 0
        PrestigeBought_Persist_Rein2 = 0
        TimeSinceReincarnation = 0
        msg = "GAME RESET!"
        msgTimer = 120
      end
        
      if b.id == "8" and stade == "" and PrestigeBoughtF == 1 and mouse.press then
        stade = "Level"
      end
      
      if b.id == "9" and stade == "" and mouse.press and UPGcooldown < 1 then
        stade = "Guide"
      end
      
      if b.id == "10" and stade == "" and mouse.press and UPGcooldown < 1 and Points >= 1e19 or b.id == "10" and stade == "" and UPGcooldown < 1 and ReMi > 0 and mouse.press then
        stade = "Reincarnation"
        UPGcooldown = 5
        sound = 30
      end
    end
        
  
//Prestige Menu Buttons--------------------------------------------------     
 
  if stade == "prestige_mode" then
    color = "rgb(0,26,255)"
    visual = "prestige"
    colorSub1 = "rgb(0,13,127)" 
    color2 = "rgb(0,26,255)"
    button1 = "prestige_reset"
    if mouse.pressed and mouse.y < -30 and mouse.y > -70 and abs(mouse.x) < 75 then
      prestige()
    end
    if mouse.pressed and mouse.y < 15 and mouse.y > -15 and mouse.x < 165 and mouse.x > 135 then
      Xbutton()
    end
    if mouse.pressed and mouse.y < -35 and mouse.y > -65 and mouse.x < -122.5 and mouse.x > -187.5 then
      UPGTree1()
    end
  end
  
   

  if stade == "" then
    color = "rgb(85,198,255)"
    visual = ""
  end
    
 //Guide Tab-----------------------------------------------------------------------------------------------   
  if stade == "Guide" then
    color = "rgb(255, 255, 200)"
    if mouse.pressed and mouse.y < 55 and mouse.y > 45 and mouse.x < 130 and mouse.x > 120 then
      Xbutton()
    end
    if mouse.pressed and mouse.y < 85 and mouse.y > 65 and mouse.x < -90 and mouse.x > -150 then
      GuideTabPoints()
    end
    if mouse.pressed and (PrestigePoints > 0 or PrestigeBought == 1) and mouse.y < 60 and mouse.y > 40 and mouse.x < -90 and mouse.x > -150 or mouse.pressed and ReMi > 0 and mouse.y < 60 and mouse.y > 40 and mouse.x < -90 and mouse.x > -150 then
      GuideTabPrestige()
    end
    if mouse.pressed and (PrestigePoints > 0 or PrestigeBought == 1) and mouse.y < 35 and mouse.y > 15 and mouse.x < -90 and mouse.x > -150 or mouse.press and ReMi > 0 and mouse.y < 35 and mouse.y > 15 and mouse.x < -90 and mouse.x > -150 then
      GuideTabUPGTree()
    end
    if mouse.press and PrestigeBoughtF > 0 and mouse.y < 10 and mouse.y > -10 and mouse.x < -90 and mouse.x > -150 and UPGcooldown == 0 or mouse.press and ReMi > 0 and mouse.y < 10 and mouse.y > -10 and mouse.x < -90 and mouse.x > -150 and UPGcooldown == 0 then
      GuideTabLevels()
    end
    if mouse.press and ReMi > 0 and mouse.y < -15 and mouse.y > -35 and mouse.x < -90 and mouse.x > -150 and UPGcooldown == 0 then
      GuideTabReincarnation()
    end
    if mouse.press and ReMi > 2 and mouse.y < -40 and mouse.y > -60 and mouse.x < -90 and mouse.x > -150 and UPGcooldown == 0 then
      GuideTabTiers()
    end
    if mouse.press and ReMi > 2 and mouse.y < -65 and mouse.y > -85 and mouse.x < -90 and mouse.x > -150 and UPGcooldown == 0 then
      GuideTabPersistentUPG()
    end
  end
    
  if stade == "Guide_Points" then
    color = "rgb(200, 255, 220)"
    visual = "point_coin"
    if mouse.pressed and mouse.y < 10 and mouse.y > -10 and mouse.x < -115 and mouse.x > -135 then
      ReturnToGuide()
    end
  end
    
  if stade == "Guide_Prestige" then
    color = "rgb(200, 255, 255)"
    visual = "prestige_coin"
    if mouse.pressed and mouse.y < 10 and mouse.y > -10 and mouse.x < -115 and mouse.x > -135 then
      ReturnToGuide()
    end
  end
  
  if stade == "Guide_UPGTree" then
    color = "rgb(180, 225, 255)"
    visual = "upgtree_coin"
    if mouse.pressed and mouse.y < 10 and mouse.y > -10 and mouse.x < -115 and mouse.x > -135 then
      ReturnToGuide()
    end
  end
  
  if stade == "Guide_Levels" then
    color = "rgb(180, 225, 255)"
    visual = "xp_orb"
    if mouse.press and UPGcooldown == 0 and mouse.y < 10 and mouse.y > -10 and mouse.x < -115 and mouse.x > -135 then
      ReturnToGuide()
    end
  end
  
  if stade == "Guide_Reincarnation" then
    color = "rgb(200, 150, 200)"
    visual = "reincarnation_coin"
    if mouse.press and UPGcooldown == 0 and mouse.y < 10 and mouse.y > -10 and mouse.x < -115 and mouse.x > -135 then
      ReturnToGuide()
    end
  end
  
  if stade == "Guide_Tiers" then
    color = "rgb(255, 255, 100)"
    visual = "tier_coin"
    if mouse.press and UPGcooldown == 0 and mouse.y < 10 and mouse.y > -10 and mouse.x < -115 and mouse.x > -135 then
      ReturnToGuide()
    end
  end
  
  if stade == "Guide_PersistUPG" then
    color = "rgb(200, 100, 100)"
    visual = "upgtreepersist_coin"
    if mouse.press and UPGcooldown == 0 and mouse.y < 10 and mouse.y > -10 and mouse.x < -115 and mouse.x > -135 then
      ReturnToGuide()
    end
  end
    
    
  
    
    

    
    
    
    
    
//Prestige Upgrade tree buttons-----------------------------------------
  if stade == "UPG_tree_prestige" then
    color = "rgb(0,120,150)"
    color2 = "rgb(0,0,0)"
    visual = "prestige_upgtree"
    if mouse.pressed and PrestigeBought < 1 and mouse.y < -40 and mouse.y > -80 and abs(mouse.x) < 22.5 then
      PreTree1()
    end
    if mouse.pressed and mouse.y < 55 and mouse.y > 45 and mouse.x < 130 and mouse.x > 120 then
      Xbutton()
    end
    if mouse.pressed and PrestigeBought >= 1 and PrestigeBought2 < 1 and mouse.y < 10 and mouse.y > -30 and mouse.x < 72.5 and mouse.x > 37.5 then
      PreTree2()
    end
    if mouse.pressed and PrestigeBought >= 1 and mouse.y < 10 and mouse.y > -30 and mouse.x < -37.5 and mouse.x > -72.5 then
      PreTreeG1()
    end
    if mouse.pressed and PrestigeBought2 >= 1 and PrestigeBoughtG >= 1 and PrestigeBoughtF < 1 and mouse.y < 60 and mouse.y > 20 and abs(mouse.x < 22.5) then
      PreTreeF1()
    end
    if mouse.press and UPGcooldown < 1 and PrestigeBoughtF == 1 and mouse.y < 15 and mouse.y > -15 and mouse.x < 190 and mouse.x > 170 then
      NextUPGTREETab()
    end
  end
    
  if stade == "UPG_tree_prestige2" then
    color = "rgb(0,120,150)"
    color2 = "rgb(0,0,0)"
    visual = "prestige_upgtree"
    if mouse.pressed and mouse.y < 55 and mouse.y > 45 and mouse.x < 130 and mouse.x > 120 then
      Xbutton()
    end
    if mouse.press and UPGcooldown < 1 and PrestigeBoughtF == 1 and mouse.y < 15 and mouse.y > -15 and mouse.x < -170 and mouse.x > -190 then
      BackUPGTREETab()
    end
    if mouse.pressed and PrestigeBought3 < 1 and mouse.y < -40 and mouse.y > -80 and abs(mouse.x) < 22.5 then
      PreTree3()
    end
    if mouse.pressed and PrestigeBoughtG2 < 1 and mouse.y < -40 and mouse.y > -80 and mouse.x < 97.5 and mouse.x > 53.5 then
      PreTreeG2()
    end
    if mouse.pressed and PrestigeBoughtG3 < 1 and mouse.y < -40 and mouse.y > -80 and mouse.x > -97.5 and mouse.x < -53.5 then
      PreTreeG3()
    end
    if mouse.pressed and PrestigeBought4 < 1 and PrestigeBoughtG3 == 1 and PrestigeBoughtG2 == 1 and PrestigeBought3 == 1 and mouse.pressed and mouse.y < 20 and mouse.y > -20 and mouse.x < 60 and mouse.x > 15 then
      PreTree4()
    end
    if mouse.pressed and PrestigeBought5 < 1 and PrestigeBoughtG3 == 1 and PrestigeBoughtG2 == 1 and PrestigeBought3 == 1 and mouse.y < 20 and mouse.y > -20 and mouse.x > -60 and mouse.x < -15 then
      PreTree5()
    end
    if mouse.pressed and PrestigeBought6 < 1 and PrestigeBought4 == 1 and PrestigeBought5 == 1 and mouse.y < 80 and mouse.y > 40 and abs(mouse.x) < 22.5 then
      PreTree6()
    end
    if mouse.press and UPGcooldown < 1 and PrestigeBought6 == 1 and ReMi >= 3 and mouse.y < 15 and mouse.y > -15 and mouse.x < 190 and mouse.x > 170 then
      NextUPGTREETab2()
    end
  end
  
  if stade == "UPG_tree_prestige3" then
    color = "rgb(0,120,150)"
    color2 = "rgb(0,0,0)"
    visual = "prestige_upgtree"
    if mouse.press and UPGcooldown < 1 and PrestigeBought6 == 1 and ReMi >= 3 and mouse.y < 15 and mouse.y > -15 and mouse.x < -170 and mouse.x > -190 then
      BackUPGTREETab2()
    end
    if mouse.pressed and mouse.y < 55 and mouse.y > 45 and mouse.x < 130 and mouse.x > 120 then
      Xbutton()
    end
    if mouse.pressed and PrestigeBought_Persist_Rein1 < 1 and mouse.y < -40 and mouse.y > -80 and mouse.x > 17.5 and mouse.x < 62.5 then
      PreTreePersistREIN1()
    end
    if mouse.pressed and PrestigeBought_Persist_Rein2 < 1 and mouse.y < -40 and mouse.y > -80 and mouse.x < -17.5 and mouse.x > -62.5 then
      PreTreePersistREIN2()
    end
  end
end



    
//Golden Prestige Upgrade functions----------------------------------
  if stade == "GoldUPG1" then
    color = "rgb(200,200,200)"
    if mouse.press and PrestigeBoughtG == 0 and mouse.y < -35 and mouse.y > -65 and mouse.x < 10 and mouse.x > -110 then
      PreTreeG1_Lvl1()
    elsif mouse.press and PrestigeBoughtG == 1 and mouse.y < -35 and mouse.y > -65 and mouse.x < 10 and mouse.x > -110 then
      PreTreeG1_Lvl2()
    elsif mouse.press and PrestigeBoughtG == 2 and mouse.y < -35 and mouse.y > -65 and mouse.x < 10 and mouse.x > -110 then
      PreTreeG1_Lvl3()
    elsif mouse.pressed and mouse.y < -40 and mouse.y > -60 and mouse.x < 80 and mouse.x > 20 then
      XbuttonTree()
    end
  end
  
//Level  button functions-------------------------------------------------------------  
    if stade == "Level" then
      color = "rgb(0,200,200)"
      visual = "level_menu"
      if mouse.press and PrestigeBoughtF == 1 and mouse.y < 10 and mouse.y > -10 and abs(mouse.x) < 50 then
        XP += XPGain
      end
      if XP >= MaxXp then
        LevelUp()
      end
      if mouse.pressed and mouse.y < 15 and mouse.y > -15 and mouse.x < 165 and mouse.x > 135 then
        Xbutton()
      end
      if mouse.press and ReMi >= 3 and mouse.y < 65 and mouse.y > 35 and mouse.x < -135 and mouse.x > -165 then
        stade = "Tier"
        UPGcooldown = 5
        sound = 20
        Music.stop()
      end
    end
    
    
    if stade == "Tier" then
      color = "rgb(200,100,0)"
      visual = "tier_menu"
      if mouse.pressed and mouse.y < 15 and mouse.y > -15 and mouse.x < 165 and mouse.x > 135 then
        Xbutton()
      end
      if mouse.press and ReMi >= 3 and UPGcooldown < 1 and mouse.y < 65 and mouse.y > 35 and mouse.x < -135 and mouse.x > -165 then
        stade = "Level"
        sound = 8
        Music.stop()
      end
      if mouse.press and ReMi >= 3 and levels >= TierCost and mouse.y < 10 and mouse.y > -10 and abs(mouse.x) < 50 then
        TierUp()
      end
    end
    
    if stade == "Reincarnation" then
      color = "rgb(150,0,150)"
      visual = "level_menu"
      if mouse.press and ReMi < 6 and mouse.y < -35 and mouse.y > -65 and mouse.x < -60 and mouse.x > -180 then
        Reincarnate()
      end
      if mouse.press and UPGcooldown == 0 and mouse.y < 10 and mouse.y > -10 and mouse.x < -115 and mouse.x > -135 then
        Xbutton()
      end
      if mouse.press and ReMi >= 5 and mouse.y > -40 and mouse.y < -10 and abs(mouse.x) < 10 then
        stade = "Reincarnation2"
      end
    end
    
    if stade == "Reincarnation2" then
      color = "rgb(150,0,150)"
      visual = "level_menu"
      if mouse.press and ReMi < 6 and mouse.y < -35 and mouse.y > -65 and mouse.x < -60 and mouse.x > -180 then
        Reincarnate()
      end
      if mouse.press and UPGcooldown == 0 and mouse.y < 10 and mouse.y > -10 and mouse.x < -115 and mouse.x > -135 then
        Xbutton()
      end
      if mouse.press and ReMi >= 5 and mouse.y > 10 and mouse.y < 40 and abs(mouse.x) < 10 then
        stade = "Reincarnation"
      end
    end
  
  screen.fillRect(0, -25, 20, 30, "#FFF")


            

  
    
    
    
    

    
    
  

  
  
  
//button visuals-------------------------------------------------------
      
      
    for Button in buttons
      if b.id == not "9" then 
        if b.oldW < targetW then b.oldW += 1
        end
        if b.oldW > targetW then b.oldW -= 1
        end
    
    
        if b.oldH < targetH then b.oldH += 1
        end
        if b.oldH > targetH then b.oldH -= 1
        end
      end
      
      
      
      
      
      
      if b.id == "9" then
        if b.oldW < targetW and b.oldW < 60 then b.oldW += 1
        end
        if b.oldW > targetW and b.oldW > 45 then b.oldW -= 1
        end
    
    
        if b.oldH < targetH and b.oldH < 60 then b.oldH += 1
        end
        if b.oldH > targetH and b.oldH > 45 then b.oldH -= 1
        end
      end
    end
  end
//Point Menu Button Visuals--------------------------------------------------------------------
  draw = function() 
      if stade == "" then
        screen.clear("rgb(85,198,255)")
        screen.drawText("POINTS: " + abbreviate(Points),  -120, 75, 20, "Black")
        screen.drawText(abbreviate(ValeurClic), -10, 50, 15, "")
        screen.drawText("=", -50, 50, 15, "")
        screen.drawText("Gain Per Click", -100, 50, 15, "")
        screen.drawText(system.fps + " FPS", 0, 75, 10, "#FFF")
      if PercentClick > 0 then 
        screen.drawText(abbreviate(ValeurClic/100*PercentClick), 10, 30, 15, "black")
        screen.drawText("=", -40, 30, 15, "")
        screen.drawText("Gain Per Second", -100, 30, 15, "")
      end
    

      
  if msgTimer > 0 then
    screen.drawText(msg, 0, 75, 15, "rgb(255,255,255)")
  end
  
  if Points < 1e6 and PrestigePoints == 0 and PrestigeBought == 0 and ReMi == 0 then
    screen.drawRect(0, -80, 150, 20, "#FFF")
    screen.drawText("Progress until Prestige 1M Points " + abbreviate(progress*100) + "%", 0, -60, 10, "blue")
    screen.fillRect((-75 + (progress*75)), -80, 150*progress, 20, "blue")
  elsif PrestigePoints < 50 and PrestigeBought == 1 and ReMi == 0 and PrestigeBoughtF == 0 then
    screen.drawRect(0, -80, 150, 20, "#FFF")
    screen.drawText("Progress until Levels 50 PP " + abbreviate(progress*100) + "%", 0, -60, 10, "black")
    screen.fillRect((-75 + (progress*75)), -80, 150*progress, 20, "rgb(0,255,150)")
  elsif Points < 1e19 and PrestigeBought == 1 and ReMi == 0 and PrestigeBoughtF == 1 then
    screen.drawRect(0, -80, 150, 20, "#FFF")
    screen.drawText("Progress until Reincarnation " + abbreviate(progress*100) + "%", 0, -60, 10, "black")
    screen.fillRect((-75 + (progress*75)), -80, 150*progress, 20, "rgb(255,0,150)")
  elsif ReMi < 3 and ReMi > 0 then
    screen.drawRect(0, -80, 150, 20, "#FFF")
    screen.drawText("Progress until Tiers " + abbreviate(progress*100) + "%", 0, -60, 10, "black")
    screen.fillRect((-75 + (progress*75)), -80, 150*progress, 20, "rgb(255,150,0)")
  elsif ReMi < 7 and ReMi >= 3 and Points < 1e38 then
    screen.drawRect(0, -80, 150, 20, "#FFF")
    screen.drawText("Progress until Endgame " + abbreviate(progress*100) + "%", 0, -60, 10, "black")
    screen.fillRect((-75 + (progress*75)), -80, 150*progress, 20, "rgb(255,255,0)")
  end
  
  for b in buttons
    if b.id == "2" then
      screen.drawSprite("point_upgrades", b.x, b.y, b.oldW, b.oldH)
    elsif b.id == "1" then
      screen.drawSprite("save", b.x, b.y, b.oldW, b.oldH)
    elsif b.id == "3" then
      screen.fillRect(b.x, b.y, b.oldW, b.oldH, "orange")
      screen.drawRect(b.x, b.y, b.oldW, b.oldH, "white")
      screen.drawText("+1 BaseGain: " + abbreviate(BaseUPG1), b.x, b.y, 12, "white")
    elsif b.id == "4" and BaseUPG1 >= 12 and MultiUPG1Lvl < 50 then
      screen.fillRect(b.x, b.y, b.oldW, b.oldH, "orange")
      screen.drawRect(b.x, b.y, b.oldW, b.oldH, "white")
      screen.drawText("1.5x Multiplier: " + abbreviate(MultiUPG1), b.x, b.y, 12, "white")
    elsif b.id == "5" and MultiUPG1 >= 500 and MultiUPG2Lvl < 10 then
      screen.fillRect(b.x, b.y, b.oldW, b.oldH, "orange")
      screen.drawRect(b.x, b.y, b.oldW, b.oldH, "white")
      screen.drawText("2x Multiplier:" + abbreviate(MultiUPG2), b.x, b.y, 12, "white")
    elsif b.id == "6" and (MultiUPG2 >= 100000 or PrestigePoints > 0)  then
      screen.drawSprite("prestige_menu", b.x, b.y, b.oldW, b.oldH)
    elsif b.id == "7" then
      screen.drawSprite("reset", b.x, b.y, b.oldW, b.oldH)
    elsif b.id == "8" and PrestigeBoughtF == 1 then
      screen.drawSprite("levels", b.x, b.y, b.oldW, b.oldH)
    elsif b.id == "9" then
      screen.drawSprite("guide2", b.x, b.y, b.oldW, b.oldH)
    elsif b.id == "10" and (Points >= 1e19 or ReMi > 0) then
      screen.drawSprite("reincarnation", b.x, b.y, b.oldW, b.oldH)
// I think this thing is the issue but idk how to fix it---------------------------------------
    elsif b.id == "11" and ReMi > 6 then
      screen.drawSprite("atomizer", b.x, b.y, b.oldW, b.oldH)
    end
  end
end

//Prestige(Major)----------------------------------------------------------------------------------------------
//          |
//          |
//          |
//          V

   
//Prestige Menu Visuals-----------------------------------------------------------------------
    if stade == "prestige_mode" then
          screen.clear(color)
          text = "Prestige for Prestige points to speed up progression"
          subText = "1M Points required to prestige"
        screen.drawSprite(visual,0,0, 425, 200)
        screen.drawText(text,0,50,15,color2)
        screen.drawText(subText,0,20,15,colorSub1)
        screen.fillRoundRect(0, -50, 150, 40, 5, "rgb(40,120,100)")
        if Points < 1e6 then
          screen.drawText("Prestige (1.000M)", 0, -50, 15, "#FFF")
        end
        if Points >= 1e6 then
          screen.drawText(("Prestige for: " + abbreviate(PrestigeGain) + " PP"), 0, -50, 10, "#FFF")
        end
        screen.fillRoundRect(150, 0, 30, 30, 30, "rgb(200,50,50)")
        screen.drawText("X", 151, 0, 25, "#FFF")
        screen.fillRoundRect(-150, -50, 75, 30, 30, "rgb(40,120,100")
        screen.drawText("Upgrade Tree", -150, -50, 10, '#FFF')
        screen.drawText("Formula: (Points/1M)^(1/3)", 0 ,-80, 20, "Grey")
      end
//Prestige Upgrade Tree Visual------------------------------------------------------------------------ 
    if stade == "UPG_tree_prestige" then
      screen.clear(color)
      text = "Prestige UPG Tree (tab1)"
      screen.drawSprite(visual,0,0,425,200)
      screen.drawText(text,-70,85,15,color2)
      screen.fillRoundRect(0, -60, 45, 40, 10,"rgb(40,40,255")
      screen.drawText("3x Points", 0 , -50, 10, "black")
      screen.drawText(("Prestige Points: " + abbreviate(PrestigePoints)), 90, 85, 10, "black")
      if ReMi >= 5 then
        screen.drawText(("Prestige Point Generation: " + abbreviate((PrestigeGain/10000)*(10^(ReMi-5)))), -120, 35, 10, "black")
      end
      screen.fillRoundRect(125, 50, 10, 10, 30, "rgb(200,50,50)")
      screen.drawText("X", 125.5, 50, 9, "#FFF")
      if PrestigeBought == 0 then
        screen.drawText("PP: 1", 0, -65, 10, "black")
      end
    
      if PrestigeBought == 1 then
        screen.drawText("Bought!", 0, -65, 10, "black")
        screen.fillRoundRect(50,-10, 45, 40, 10, "rgb(40,40,255)")
        screen.fillRoundRect(-50,-10, 45, 40, 10, "rgb(255,255,0)")
        screen.drawRoundRect(-50, -10, 45, 40, 10, "rgb(40,40,255")
        screen.drawRoundRect(-50, -10, 44, 39, 10, "rgb(40,40,255")
        screen.drawRoundRect(-50, -10, 43, 38, 10, "rgb(40,40,255")
        screen.setLineWidth(5)
        screen.drawLine(20, -45, 50, -30, "Black")
        screen.drawLine(-20, -45, -50, -30, "Black")
        screen.drawText("2.25x Points", 50, -5, 8.5, "black")
        screen.drawText("Auto Clicks", -50, -5, 8.5, "black")
        if PrestigeBought2 == 0 then
          screen.drawText("PP: 3", 50, -17.5, 10, "black")
        end
        if PrestigeBought2 == 1 then
          screen.drawText("Bought!", 50, -17.5, 10, "black")
        end
        if PrestigeBoughtG < 3 then
          screen.drawText(("Lvl: " + PrestigeBoughtG + "/3"), -50, -15, 10, "black") 
        end
        if PrestigeBoughtG == 3 then
          screen.drawText("Maxed!", -50,-15,10, "black")
        end
        if PrestigeBoughtG > 0 and PrestigeBought2 > 0 then
          screen.fillRoundRect(0, 40, 45, 40, 10, "rgb(50,255,0)")
          screen.drawText("Unlock", -0, 52.5, 8.5, "black")
          if PrestigeBoughtF < 1 then
            screen.drawText("PP: 50", 0, 30, 10, "black")
          end
          if PrestigeBoughtF == 1 then
            screen.drawText("Bought!", 0, 30, 10, "black")
            screen.fillRect(180, 0, 30,20, "white")
            screen.drawText(">", 182.5, 0, 20, "black")
          end
          screen.drawText("Levels", -0, 42.5, 8.5, "black")
          screen.setLineWidth(2)
          screen.drawRoundRect(0,40,45,40,10,"Blue")  
          screen.setLineWidth(5)
          screen.drawLine(50, 10, 20, 40, "black")
          screen.drawLine(-50, 10, -20, 40, "black")
        end
      end
    end
    
    if stade == "UPG_tree_prestige2" then
      screen.clear(color)
      text = "Prestige UPG Tree (tab2)"
      screen.drawSprite(visual,0,0,425,200)
      screen.drawText(("Prestige Points: " + abbreviate(PrestigePoints)), 90, 85, 10, "black")
      screen.drawText(text,-70,85,15,color2)
      if ReMi >= 5 then
        screen.drawText(("Prestige Point Generation: " + abbreviate((PrestigeGain/10000)*(10^(ReMi-5)))), -120, 35, 10, "black")
      end
      screen.fillRoundRect(125, 50, 10, 10, 30, "rgb(200,50,50)")
      screen.drawText("X", 125.5, 50, 9, "#FFF")
      screen.fillRect(-180, 0, 30,20, "white")
      screen.drawText("<", -180, 0, 20, "black")
      screen.fillRect(180, 0, 30,20, "white")
      screen.drawText(">", 180, 0, 20, "black")
      screen.fillRoundRect(0, -60, 45, 40, 10,"rgb(40,40,255")
      screen.fillRoundRect(75, -60, 45, 40, 10,"rgb(255,255,0")
      screen.drawRoundRect(75, -60, 45, 40, 10,"rgb(40,40,255)")
      screen.drawRoundRect(75, -60, 44, 39, 10,"rgb(40,40,255)")
      screen.drawRoundRect(75, -60, 43, 38,, 10,"rgb(40,40,255)")
      screen.drawText("Improve Points", 75, -50 , 6.5, "black")
      screen.drawText("To Xp Formula", 75, -55 , 6.5, "black")
      screen.drawText("^(1/3) -> ^(1/1.5)", 75, -60 , 6.5, "black")
      screen.fillRoundRect(-75, -60, 45, 40, 10,"rgb(255,255,0")
      screen.drawRoundRect(-75, -60, 45, 40, 10,"rgb(40,40,255)")
      screen.drawRoundRect(-75, -60, 44, 39, 10,"rgb(40,40,255)")
      screen.drawRoundRect(-75, -60, 43, 38,, 10,"rgb(40,40,255)")
      if ReMi < 4 then
        screen.drawText("Improve Level's", -75, -50 , 6.25, "black")
        screen.drawText("Boost To Points", -75, -55 , 6.25, "black")
        screen.drawText("1.5X -> 1.75X", -75, -62.5 , 6.5, "black")
      elsif ReMi >= 4 then
        screen.drawText("Improve Level's", -75, -50 , 6.25, "black")
        screen.drawText("Boost To Points", -75, -55 , 6.25, "black")
        screen.drawText("1.5X -> 2.25X", -75, -62.5 , 6.5, "black")
      end
      screen.drawText("Prestige Points", 0, -50, 7, "black")
      screen.drawText("Boosts Points", 0, -57.5, 7, "black")
      if PrestigeBought3 == 1 and PrestigeBoughtG2 == 1 and PrestigeBoughtG3 == 1 then
        screen.fillRoundRect(-37.5, 0, 45, 40, 10,"rgb(40,40, 255)")
        screen.fillRoundRect(37.5, 0, 45, 40, 10,"rgb(40,40,255)")
        screen.drawText("Points Boost Itself", 37.5, 10, 5.75, "black")
        screen.drawText("Slightly", 37.5, 4, 6, "black")
        screen.drawText("Points Boost", -37.5, 10, 5.75, "black")
        screen.drawText("Prestige Points", -37.5, 4, 6, "black")
        screen.drawText("Slightly", -37.5, -2, 6, "black")
        screen.setLineWidth(3)
        screen.drawLine(0, -40, 37.5, -20, "black")
        screen.drawLine(0, -40, -37.5, -20, "black")
        screen.drawLine(75, -40, 37.5, -20, "black")
        screen.drawLine(-75, -40, -37.5, -20, "black")
        if PrestigeBought4 == 0 then
          screen.drawText("PP: 2K", 37.5, -10, 10, "black")
        elsif PrestigeBought4 == 1 then
          screen.drawText(("X " + (floor(PointToPointFormatic1*1000)/1000)), 37.5, -10, 10, "black")
        end
        if PrestigeBought5 == 0 then
          screen.drawText("PP: 5K", -37.5, -10, 10, "black")
        elsif PrestigeBought5 == 1 then
          screen.drawText(("X " + (floor(PointToPrestigePointFormatic1*1000)/1000)), -37.5, -10, 10, "black")
        end
      end
      if PrestigeBought5 == 1 and PrestigeBought4 == 1 then
        screen.fillRoundRect(0, 60, 45, 40, 10, "rgb(40,40,255")
        screen.drawLine(37.5, 20, 0, 40, "black")
        screen.drawLine(-37.5, 20, 0, 40, "black")
        screen.drawText("10X Points", 0 , 70, 7.5, "black")
        screen.drawText("3X Xp", 0 , 62.5, 7.5, "black")
        if PrestigeBought6 == 0 then
          screen.drawText("PP: 35K", 0 , 50, 10, "black")
        elsif PrestigeBought6 == 1 then
          screen.drawText("Bought!", 0 , 50, 10, "black")
        end
      end
      if PrestigeBought3 == 0 then
        screen.drawText("PP: 250", 0, -70, 10, "black")
      elsif PrestigeBought3 == 1 then
        screen.drawText(("X " + (floor(PrestigePointToPointFormatic1*1000)/1000)), 0, -70, 10, "black")
      end
      if PrestigeBoughtG2 == 0 then
        screen.drawText("PP: 600", 75, -70, 10 "black")
      elsif PrestigeBoughtG2 == 1 then
        screen.drawText("Bought!", 75, -70, 10 "black")
      end
      if PrestigeBoughtG3 == 0 then
        screen.drawText("PP: 1K", -75, -70, 10 "black")
      elsif PrestigeBoughtG3 == 1 then
        screen.drawText("Bought!", -75, -70, 10 "black")
      end
    end
    
    if stade == "UPG_tree_prestige3" then
      screen.clear(color)
      text = "Prestige UPG Tree (tab3)"
      screen.drawSprite(visual,0,0,425,200)
      screen.drawText(("Prestige Points: " + abbreviate(PrestigePoints)), 90, 85, 10, "black")
      screen.drawText(text,-70,85,15,color2)
      if ReMi >= 5 then
        screen.drawText(("Prestige Point Generation: " + abbreviate((PrestigeGain/10000)*(10^(ReMi-5)))), -120, 25, 10, "black")
      end
      screen.fillRoundRect(125, 50, 10, 10, 30, "rgb(200,50,50)")
      screen.drawText("X", 125.5, 50, 9, "#FFF")
      screen.fillRect(-180, 0, 30,20, "white")
      screen.drawText("<", -180, 0, 20, "black")
      screen.fillRoundRect(40, -60, 45, 40, 10,"rgb(255,0,0")
      screen.setLineWidth(2)
      screen.drawRoundRect(40, -60, 45, 40, 10, "rgb(200,0,200)")
      screen.setLineWidth(2)
      screen.fillRoundRect(-40, -60, 45, 40, 10,"rgb(255,0,0")
      screen.drawRoundRect(-40, -60, 45, 40, 10, "rgb(200,0,200)")
      screen.fillRoundRect(40, 60, 45, 40, 10,"rgb(40,40,255")
      screen.fillRoundRect(-40, 60, 45, 40, 10,"rgb(40,40,255")
      screen.drawText("Time Since", 40, -45, 7, "black")
      screen.drawText("Prestige Boosts", 40, -52.50, 7, "black")
      screen.drawText("Points Slightly", 40, -60, 7, "black")
      screen.drawText("Time Since", -40, -45, 7, "black")
      screen.drawText("Reincarnation Boosts", -40, -52.50, 5, "black")
      screen.drawText("Points More", -40, -60, 7, "black")
      if PrestigeBought_Persist_Rein1 == 0 then
        screen.drawText("Cost: 100M PP", 41, -70, 7.5, "black")
      elsif PrestigeBought_Persist_Rein1 == 1 then
        screen.drawText(("X " + abbreviate((TimeSincePrestigeToPointFormatic1*1000)/1000)), 40, -70, 10, "black")
      end
      if PrestigeBought_Persist_Rein2 == 0 then
        screen.drawText("Cost: 5B PP", -40, -70, 8, "black")
      elsif PrestigeBought_Persist_Rein2 == 1 then
        screen.drawText(("X " + abbreviate((TimeSinceReincarnationToPointFormatic1*1000)/1000)), -40, -70, 10, "black")
      end
      if PrestigeBought_Persist_Rein2 == 1 and PrestigeBought_Persist_Rein1 == 1 then
        screen.drawLine(-40, -40, 0, -20)
        screen.drawLine(40, -40, 0, -20)
        screen.fillRoundRect(0, 0, 45, 40, 10,"rgb(40,40,255")
      end
      screen.drawSprite("endgame", 0, 55, 200,50)
    end
    
    
    

//Golden Upgrade Prestige Visuals---------------------------------------------------------------------------------------      
      if stade == "GoldUPG1" then
        screen.clear(color)
        screen.drawText("Lvl 1: 1+ CPS, 3x Points, 1.5x PP", 0,40,10,"black")
        screen.drawRect(0,0,420,195,"black")
        screen.drawRect(0,30,300, 50,"black")
        screen.drawText("Lvl 2: 1+ CPS, 2x Points, 1.25x PP", 0,30,10,"black")
        screen.drawText("Lvl 3: 1+ CPS", 0,20,10,"black")
        screen.fillRoundRect(-50,-50,120,30,5 "Green")
        screen.drawText("Auto Clicks", 0 ,75, 30, "Black")
        screen.fillRoundRect(50,-50,60,20,5,"rgb(200,0,0")
        screen.drawText("Back", 50, -50, 15, "black")
        if PrestigeBoughtG == 0 then
          screen.drawText("5: Prestige Points", -50, -50, 12.5, "black")
        end
        if PrestigeBoughtG == 1 then
          screen.drawText("15: Prestige Points", -50, -50, 12.5, "black")
        end
        if PrestigeBoughtG == 2 then
          screen.drawText("50: Prestige Points", -50, -50, 12.5, "black")
        end
        if PrestigeBoughtG == 3 then
          screen.drawText("Maxed", -50, -50, 12.5, "black")
        end
      end

//Level Menu visuals----------------------------------------------------------------------------      
      if stade == "Level" then
        screen.clear(color)
        screen.drawSprite(visual, 0, 0, 425, 200)
        screen.drawText(("XP: " + abbreviate(XP) + "/" + abbreviate(MaxXp)), 0, 50, 20, "black")
        screen.fillRoundRect(0, 0, 100, 20, 4, "rgb(200,200,200)")
        screen.drawText("XP", 0, 1, 20, "Black")
        screen.fillRoundRect(150, 0, 30, 30, 30, "rgb(200,50,50)")
        screen.drawText("X", 151, 0, 25, "#FFF")
        screen.drawText(("Level: " + levels), 0, 75, 20, "black")
        
        if PrestigeBoughtG3 == 0 and ReMi < 4 then
          screen.drawText("points Multiplyed by 1.5 each level", 100, 30, 10, "black")
        elsif PrestigeBoughtG3 == 1 and ReMi < 4 then
          screen.drawText("points Multiplyed by 1.75 each level", 100, 30, 10, "black")
        elsif PrestigeBoughtG3 == 1 and ReMi >= 4 then
          screen.drawText("points Multiplyed by 2.25 each level", 100, 30, 10, "black")
        end
        screen.drawText("XP boosted by points by " + floor(PointBoostXP*1000) / 1000, 0, -30, 10, "rgb(0,100,0)")
        if PrestigeBoughtG2 == 0 then
          screen.drawText("Formula: log(Points)^(1/3)", 0 ,-60, 20, "grey")
        elsif PrestigeBoughtG2 == 1 then
          screen.drawText("Formula: log(Points)^(1/1.5)", 0 ,-60, 20, "grey")
        end
        if BoostDisplayPoints > 1000 and BoostDisplayPoints < 10000 then
          screen.drawText(("Points are multiplyed by " + (BoostDisplayPoints/1000)), -100 ,30 ,10, "rgb(0,200,200)")
        end
        if BoostDisplayPoints > 10000 then
          screen.drawText(("Points are multiplyed by " + abbreviate(BoostDisplayPoints/1000)), -100, 30, 10, "rgb(0,200,200)")
        end
        if ReMi >= 3 then
          screen.drawSprite("tier", -150, 50, 30,)
        end
      end
      
      if stade == "Tier" then
        screen.clear(color)
        screen.drawSprite(visual, 0, 0, 425, 200)
        screen.drawText(("Levels: " + abbreviate(levels) + "/" + abbreviate(TierCost)), 0, 50, 20, "black")
        screen.fillRoundRect(0, 0, 100, 20, 4, "rgb(200,200,200)")
        screen.drawText("Tier Up", 0, 1, 20, "Black")
        screen.fillRoundRect(150, 0, 30, 30, 30, "rgb(200,50,50)")
        screen.drawText("X", 151, 0, 25, "#FFF")
        screen.drawText("Tier: " + (TierCost/5 - 1), 0, 75, 20, "black")
        screen.drawText("Each Tier Increases >PP< by 1.25x, Points by 5x, and XP by 3x.", 0, -30, 10, "Black")
        screen.drawSprite("levels", -150, 50, 30,)
        screen.drawText(("Points are boosted by: " + abbreviate(MultiBoostTier) + "x"), 0, -50, 10, "rgb(100,100,100)")
        screen.drawText(("XP are boosted by: " + abbreviate(XPMultiBoostTier) + "x"), 0, -60, 10, "rgb(150,255,100)")
        screen.drawText((" Prestige Points are boosted by: " + abbreviate(PPMultiBoostTier*100)/1000*10 + "x"), 0, -70, 10, "rgb(50,200,255)")
      end
//Guide Visuals--------------------------------------------------------------------------     
      if stade == "Guide" then
        screen.clear(color)
        screen.drawRect(0,0,325,190 "black")
        screen.fillRoundRect(-120, 75, 60, 20, 5, "rgb(200,200,200")
        screen.drawText("Points", -120, 75, 15, "black")
        screen.fillRoundRect(125, 50, 10, 10, 30, "rgb(200,50,50)")
        screen.drawText("X", 125.5, 50, 9, "#FFF")
        if PrestigePoints == 0 and PrestigeBought == 0 then
          screen.drawText("Reach 1 Million Points",60, -75, 10, "black")
        end
        if PrestigePoints > 0 or ReMi > 0 or PrestigeBought == 1 then
          screen.fillRoundRect(-120, 50, 60, 20, 5, "rgb(100,500,255")
          screen.fillRoundRect(-120, 25, 60, 20, 5, "rgb(100,500,255")
          screen.drawText("Prestige", -120, 50, 15, "black")
          screen.drawText("UPG Tree", -120, 25, 13, "black")
          if PrestigeBoughtF == 0 then
            screen.drawText("Unlock Levels",60, -75, 10, "black")
          end
        end
        if PrestigeBoughtF > 0 or ReMi > 0 then
          screen.fillRoundRect(-120, 0, 60, 20, 5, "rgb(100,500,255")
          screen.drawText("Levels", -120, 0, 15, "black")
          if ReMi == 0 then
            screen.drawText("Reach 10 Quintrillion Points",60, -75, 10, "black")
          end
        end
        if ReMi > 0 then
          screen.fillRoundRect(-120, -25, 60, 20, 5, "rgb(255,100,255")
          screen.drawText("Reincarnation", -120, -25, 10, "black")
          if ReMi < 3 then
            screen.drawText("Reach 1 Septillion Points for Tiers",60, -75, 10, "black")
          end
        end
        if ReMi >= 3 then
          screen.fillRoundRect(-120, -50, 60, 20, 5, "rgb(255,100,255")
          screen.drawText("Tiers", -120, -50, 15, "black")
          screen.fillRoundRect(-120, -75, 60, 20, 5, "rgb(255,100,255")
          screen.drawText("Persistent Upgrades", -120, -75, 7, "black")
          screen.drawText("Reach 100 Undecillion Points for Endgame",60, -75, 10, "black")
        end
      end
      
      if stade == "Guide_Points" then
        screen.clear(color)
        screen.drawSprite(visual, -125 ,57.5, 50, 50)
        screen.drawRect(0,0,325,190 "black")
        screen.drawRect(-125,57.5,65,65 "black")
        screen.drawRect(50,0,200,170 "black")
        screen.drawText("The Point Menu is stage 1 of the game consisting of a few-", 50, 75, 7.5, "black")
        screen.drawText("-Upgrades, The Clicker, and the first main currency Points.", 50, 65, 7.5, "black")
        screen.drawText("------Points and Upgrades------", 50, 45, 15, "black")
        screen.drawText("To gain Points click the red button and to buy upgrades-", 50, 25, 7.5, "black")
        screen.drawText("get enough points you can click the upgrades once you do", 50, 15, 7.5, "black")
        screen.drawText("Its that simple", 50, 0, 10, "black")
        screen.drawText("1M Points for next guide", 50, -15, 15, "black")
        screen.drawText("--------------------------------", 50, -7.5, 15, "black")
        screen.fillRoundRect(-125, 0, 20, 20, 30, "rgb(200,50,50)")
        screen.drawText("X", -124, 0, 18, "#FFF")
      end
        
        
      if stade == "Guide_Prestige" then
        screen.clear(color)
        screen.drawSprite(visual, -125 ,57.5, 50, 50)
        screen.drawRect(0,0,325,190 "black")
        screen.drawRect(-125,57.5,65,65 "black")
        screen.drawRect(50,0,200,170 "black")
        screen.drawText("You Reached Stage 2 it only gets harder from here", 50, 77, 9, "Red")
        screen.drawText("----------------------------------------------------------------", 50, 70, 7.5, "black")
        screen.drawText("Prestige is the first main reset layer where points are-", 50, 65, 7.5, "black")
        screen.drawText("-Converted to <Prestige Points> for stronger upgrades.", 50, 55, 7.5, "black")
        screen.drawText("----------------------------------------------------------------", 50, 50, 7.5, "black")
        screen.fillRoundRect(-125, 0, 20, 20, 30, "rgb(200,50,50)")
        screen.drawText("X", -124, 0, 18, "#FFF")
      end
      
      
      if stade == "Guide_UPGTree" then
        screen.clear(color)
        screen.drawSprite(visual, -125 ,57.5, 50, 50)
        screen.drawRect(0,0,325,190 "black")
        screen.drawRect(-125,57.5,65,65 "black")
        screen.drawRect(50,0,200,170 "black")
        screen.drawText("The Upgrade Tree Button Types", 50, 75, 12, "black")
        screen.drawText("--------------------------------", 50, 65, 15, "black")
        screen.drawText("Normal Buttons:", 50, 55, 10, "black")
        screen.drawText("Generic boosts like 3x Points, formatic boosts like Logarithms, or", 50, 45, 7, "black")
        screen.drawText("Double Boosts like 2x Points and 1.5x Prestige Points in 1 UPG.", 50, 35, 7, "black")
        screen.drawText("--------------------------------", 50, 30, 15, "black")
        screen.drawText("Golden Buttons:", 50, 25, 10, "black")
        screen.drawText("Unique boosts like CPS +1, MultiLevel Upgrades, Powerful Boosts,", 50, 15, 7, "black")
        screen.drawText("and double or triple boosts.", 50, 5, 7, "black")
        screen.drawText("--------------------------------", 50, 0, 15, "black")
        screen.drawText("Feature Buttons:", 50, -5, 10, "black")
        screen.drawText("Perhaps the most simple and yet most importent button type", 50, -15, 7, "black")
        screen.drawText("Feature Buttons unlock More Features like >levels< but will", 50, -25, 7, "black")
        screen.drawText("Rarely give other boosts", 50, -35, 7, "black")
        screen.drawText("--------------------------------", 50, -40, 15, "black")
        screen.drawText("Goal: Unlock Levels", 50, -50, 15, "black")
        screen.fillRoundRect(-125, 0, 20, 20, 30, "rgb(200,50,50)")
        screen.drawText("X", -124, 0, 18, "#FFF")
      end
      
      if stade == "Guide_Levels" then
        screen.clear(color)
        screen.drawSprite(visual, -125 ,57.5, 50, 50)
        screen.drawRect(0,0,325,190 "black")
        screen.drawRect(-125,57.5,65,65 "black")
        screen.drawRect(50,0,200,170 "black")
        screen.drawText("Levels", 50, 75, 12, "black")
        screen.drawText("--------------------------------", 50, 65, 15, "black")
        screen.drawText("Levels is a stage 2 mechanic that Boosts Points Apon Level up", 50, 55, 7.5, "black")
        screen.drawText("by 1.5 the cost of Leveling up doubles each time and Points", 50, 45, 7.5, "black")
        screen.drawText("Boost Xp gain by a significantly reduced rate. some upgrades", 50, 35, 7.5, "black")
        screen.drawText("can boost the effects of Levels others can boost Xp Gain as well", 50, 25, 7.5, "black")
        screen.drawText("as the formula that increases based on Points some upgrades", 50, 15, 7.5, "black")
        screen.drawText("might even reduce the scaling of Xp cost.", 50, 5, 7.5, "black")
        screen.drawText("--------------------------------", 50, 0, 15, "black")
        screen.drawText("Goal: Reach 10Qi Points for", 50, -10, 15, "black")
        screen.drawText("Reincarnation", 50, -25, 15, "")
        screen.fillRoundRect(-125, 0, 20, 20, 30, "rgb(200,50,50)")
        screen.drawText("X", -124, 0, 18, "#FFF")
      end
      
      if stade == "Guide_Reincarnation" then
        screen.clear(color)
        screen.drawSprite(visual, -125 ,57.5, 50, 50)
        screen.drawRect(0,0,325,190 "black")
        screen.drawRect(-125,57.5,65,65 "black")
        screen.drawRect(50,0,200,170 "black")
        screen.drawText("You Reached Stage 3 this will be fun", 50, 75, 12, "red")
        screen.drawText("--------------------------------", 50, 65, 15, "black")
        screen.drawText("Reincarnation", 50, 55, 15, "black")
        screen.drawText("--------------------------------", 50, 45, 15, "black")
        screen.drawText("Reincarnation Resets Everything Prestige does as well as", 50, 35, 7.5, "black")
        screen.drawText("Prestige Points and Prestige Upgrades in exchange for", 50, 25, 7.5, "black")
        screen.drawText("Very Powerful Boosts and even some QOL. unlike Prestige", 50, 15, 7.5, "black")
        screen.drawText("Reincarnation does not use normal Upgrades, instead it uses", 50, 5, 7.5, "black")
        screen.drawText("Milestones it gets more expensive each time.", 50, -5, 7.5, "black")
        screen.drawText("--------------------------------", 50, -20, 15, "black")
        screen.drawText("Milestones", 50, -30, 10, "black")
        screen.drawText("Each reincarnation you gain a new milestone, these milestones", 50, -40, 7.5, "black")
        screen.drawText("give unique buffs but they get more diffcult to get", 50, -50, 7.5, "black")
        screen.drawText("--------------------------------", 50, -55, 15, "black")
        screen.drawText("Goal: Reach Milestone 3 for", 50, -65, 15, "black")
        screen.fillRoundRect(-125, 0, 20, 20, 30, "rgb(200,50,50)")
        screen.drawText("X", -124, 0, 18, "#FFF")
        screen.drawText("Tiers", 50, -75, 15, "black")
      end
      
      if stade == "Guide_Tiers" then
        screen.clear(color)
        screen.drawSprite(visual, -125 ,57.5, 50, 50)
        screen.drawRect(0,0,325,190 "black")
        screen.drawRect(-125,57.5,65,65 "black")
        screen.drawRect(50,0,200,170 "black")
        screen.drawText("Tiers is a secondary Leveling system", 50, 75, 10, "black")
        screen.drawText("--------------------------------", 50, 65, 15, "black")
        screen.drawText("Boosts", 50, 55, 15, "black")
        screen.drawText("--------------------------------", 50, 45, 15, "black")
        screen.drawText("Tiers are located in the levels tab each tier boosts Points", 50, 35, 7.5, "black")
        screen.drawText("By 5x XP by 3x and Prestige Points by 1.25x", 50, 25, 7.5, "black")
        screen.drawText("Upon Tiering up Levels along with its boosts will be reset", 50, 15, 7.5, "black")
        screen.drawText("--------------------------------", 50, 10, 15, "black")
        screen.drawText("Traits", 50, 0, 15, "black")
        screen.drawText("--------------------------------", 50, -10, 15, "black")
        screen.drawText("Scaling: Every 5 tiers the boost is increased by an addictive 20%", 50, -20, 7.5, "black")
        screen.drawText("Example 5x points > 6x Points at tier 5 > 7x at tier 10.", 50, -30, 7.5, "black")
        screen.drawText("Persistance Tier 1: Will not be reset upon prestige.", 50, -40, 7.5, "black")
        screen.drawText("--------------------------------", 50, -50, 15, "black")
        screen.drawText("Goal: Reach Endgame for", 50, -60, 15, "black")
        screen.fillRoundRect(-125, 0, 20, 20, 30, "rgb(200,50,50)")
        screen.drawText("X", -124, 0, 18, "#FFF")
        screen.drawText("$%@^#^%", 50, -75, 15, "black")
      end
      
      
      if stade == "Guide_PersistUPG" then
        screen.clear(color)
        screen.drawSprite(visual, -125 ,57.5, 50, 50)
        screen.drawRect(0,0,325,190 "black")
        screen.drawRect(-125,57.5,65,65 "black")
        screen.drawRect(50,0,200,170 "black")
        screen.drawText("This is the First Addition to UPG Tree", 50, 75, 10, "black")
        screen.drawText("--------------------------------", 50, 65, 15, "black")
        screen.drawText("Appearance", 50, 55, 15, "black")
        screen.drawText("--------------------------------", 50, 45, 15, "black")
        screen.drawText("Persistent Upgrade Tree buttons will appear red", 50, 35, 7.5, "black")
        screen.drawText("with a outline that shows what reset it persists on", 50, 25, 7.5, "black")
        screen.drawText("Ex: purple outline = save on reincarnation", 50, 15, 7.5, "black")
        screen.drawText("--------------------------------", 50, 10, 15, "black")
        screen.drawText("Traits", 50, 0, 15, "black")
        screen.drawText("--------------------------------", 50, -10, 15, "black")
        screen.drawText("Expensive: Much higher pricing", 50, -20, 7.5, "black")
        screen.drawText("Versitallity: could be combined with Gold or feature upgs", 50, -30, 7.5, "black")
        screen.drawText("Later game there will be different colored outlines", 50, -40, 7.5, "black")
        screen.drawText("--------------------------------", 50, -50, 15, "black")
        screen.drawText("Goal: Reach Endgame for", 50, -60, 15, "black")
        screen.fillRoundRect(-125, 0, 20, 20, 30, "rgb(200,50,50)")
        screen.drawText("X", -124, 0, 18, "#FFF")
        screen.drawText("$%@^#^%", 50, -75, 15, "black")
      end
      
      
      
      
      
      if stade == "Reincarnation" then
        screen.clear(color)
        screen.drawRect(120,0,175,200, "blue")
        screen.fillRect(-120, 0, 175, 200, "rgb(200,200,200)")
        screen.fillRoundRect(-120,50,100,50,7.5, "rgb(255,255,190)")
        screen.setLineWidth(4)
        screen.drawRoundRect(-120,50,100,50,7.5, "rgb(127.5,127.5,95)")
        screen.drawText("Reincarnate for new Milestones", -120, 65, 7, "Black")
        screen.drawText("Each Milestone gives unique", -120, 57.5, 7, "Black")
        screen.drawText("rewards but they get harder to", -120, 50, 7, "Black")
        screen.drawText("obtain.", -120, 42.5, 7, "Black")
        screen.drawText(("Current Milestone: " + ReMi), -120, 35, 7, "Black")
        screen.fillRoundRect(-120,-50,120,30,7.5, "rgb(100,0,100)")
        screen.setAlpha(0.5)
        screen.fillRect(120, 0, 175, 200, "rgb(150,200,150)")
        screen.setAlpha(1)
        screen.fillRoundRect(-125, 0, 20, 20, 30, "rgb(200,50,50)")
        screen.drawText("X", -124, 0, 18, "#FFF")
        if ReMi == 0 then
          screen.drawText(("Reincarnate: 10Qi"), -120, -50, 12.5, "#FFF")
          screen.setAlpha(0.5)
          screen.fillRoundRect(120, 80, 175, 40, 10, "rgb(0,0,255)")
          screen.fillRoundRect(120, 37.5, 175, 40, 10, "rgb(0,0,255)")
          screen.setAlpha(1)
          screen.drawText(("Milestone 1"), 120, 90, 10, "#FFF")
          screen.drawText(("10X Points, ^1.01 Points, 3x Xp, 2x Prestige Points"), 120, 80, 7.5, "#FFF")
          screen.drawText(("Unlock Automation for the first UPG"), 120, 70, 7.5, "#FFF")
          screen.drawText(("Milestone 2"), 120, 52.5, 10, "#FFF")
          screen.drawText(("???"), 120, 42.5, 10, "#FFF")
        elsif ReMi == 1 then
          screen.drawText(("Reincarnate: 10Sx"), -120, -50, 12.5, "#FFF")
          screen.setAlpha(1)
          screen.fillRoundRect(120, 80, 175, 40, 10, "rgb(0,0,255)")
          screen.drawText(("Milestone 1"), 120, 90, 10, "#FFF")
          screen.drawText(("10X Points, ^1.01 Points, 3x Xp, 2x Prestige Points"), 120, 80, 7.5, "#FFF")
          screen.drawText(("Unlock Automation for the first UPG"), 120, 70, 7.5, "#FFF")
          screen.setAlpha(0.5)
          screen.fillRoundRect(120, 37.5, 175, 40, 10, "rgb(0,0,255)")
          screen.fillRoundRect(120, -5, 175, 40, 10, "rgb(0,0,255)")
          screen.setAlpha(1)
          screen.drawText(("Milestone 2"), 120, 52.5, 10, "#FFF")
          screen.drawText(("4X Points, 1.5x Prestige Points, 2x XP"), 120, 42.5, 10, "#FFF")
          screen.drawText(("Automate the Second UPG"), 120, 32.5, 10, "#FFF")
          screen.drawText(("Milestone 3"), 120, 10, 10, "#FFF")
          screen.drawText(("???"), 120, 0, 10, "#FFF")
        elsif ReMi == 2 then
          screen.drawText(("Reincarnate: 1Sp"), -120, -50, 12.5, "#FFF")
          screen.setAlpha(1)
          screen.fillRoundRect(120, 80, 175, 40, 10, "rgb(0,0,255)")
          screen.drawText(("Milestone 1"), 120, 90, 10, "#FFF")
          screen.drawText(("10X Points, ^1.01 Points, 3x Xp, 2x Prestige Points"), 120, 80, 7.5, "#FFF")
          screen.drawText(("Unlock Automation for the first UPG"), 120, 70, 7.5, "#FFF")
          screen.fillRoundRect(120, 37.5, 175, 40, 10, "rgb(0,0,255)")
          screen.drawText(("Milestone 2"), 120, 52.5, 10, "#FFF")
          screen.drawText(("4X Points, 1.5x Prestige Points, 2x XP"), 120, 42.5, 10, "#FFF")
          screen.drawText(("Automate the Second UPG"), 120, 32.5, 10, "#FFF")
          screen.setAlpha(0.5)
          screen.fillRoundRect(120, -5, 175, 40, 10, "rgb(0,0,255)")
          screen.fillRoundRect(120, -47.5, 175, 40, 10, "rgb(0,0,255)")
          screen.setAlpha(1)
          screen.drawText(("Milestone 3"), 120, 10, 10, "#FFF")
          screen.drawText(("Unlock Tiers"), 120, 0, 10, "#fcd105")
          screen.drawText(("Automate the Third UPG"), 120, -10, 10, "#FFF")
          screen.drawText(("Unlock more prestige UPGS"), 120, -20, 7.5, "#FFF")
          screen.drawText(("Milestone 4"), 120, -32.5, 10, "#FFF")
          screen.drawText(("???"), 120, -42.5, 10, "#FFF")
        elsif ReMi == 3 then
          screen.drawText(("Reincarnate: 1.000 Oc"), -120, -50, 12.5, "#FFF")
          screen.setAlpha(1)
          screen.fillRoundRect(120, 80, 175, 40, 10, "rgb(0,0,255)")
          screen.drawText(("Milestone 1"), 120, 90, 10, "#FFF")
          screen.drawText(("10X Points, ^1.01 Points, 3x Xp, 2x Prestige Points"), 120, 80, 7.5, "#FFF")
          screen.drawText(("Unlock Automation for the first UPG"), 120, 70, 7.5, "#FFF")
          screen.fillRoundRect(120, 37.5, 175, 40, 10, "rgb(0,0,255)")
          screen.drawText(("Milestone 2"), 120, 52.5, 10, "#FFF")
          screen.drawText(("4X Points, 1.5x Prestige Points, 2x XP"), 120, 42.5, 10, "#FFF")
          screen.drawText(("Automate the Second UPG"), 120, 32.5, 10, "#FFF")
          screen.fillRoundRect(120, -5, 175, 40, 10, "rgb(0,0,255)")
          screen.drawText(("Milestone 3"), 120, 10, 10, "#FFF")
          screen.drawText(("Unlock Tiers"), 120, 0, 10, "#fcd105")
          screen.drawText(("Automate the Third UPG"), 120, -10, 10, "#FFF")
          screen.drawText(("Unlock more prestige UPGS"), 120, -20, 7.5, "#FFF")
          screen.setAlpha(0.5)
          screen.fillRoundRect(120, -47.5, 175, 40, 10, "rgb(0,0,255)")
          screen.fillRoundRect(120, -90.5, 175, 40, 10, "rgb(0,0,255)")
          screen.setAlpha(1)
          screen.drawText(("Milestone 4"), 120, -32.5, 10, "#FFF")
          screen.drawText(("-Increase the effect of prestige upg 5"), 120, -42.5, 10, "#FFF")
          screen.drawText(("from 0.25 to 0.75"), 120, -50, 10, "#FFF")
          screen.drawText(("-Every Milestone starting from 4"), 120, -56.5, 7, "#FFF")
          screen.drawText(("Boosts Points and XP by 2x"), 120, -62.5, 7, "#FFF")
          screen.drawText(("Milestone 5"), 120, -75.5, 10, "#FFF")
          screen.drawText(("???"), 120, -85.5, 10, "#FFF")
        elsif ReMi == 4 then
          screen.drawText(("Reincarnate: 50.000 No"), -120, -50, 12.5, "#FFF")
          screen.setAlpha(1)
          screen.fillRoundRect(120, 80, 175, 40, 10, "rgb(0,0,255)")
          screen.drawText(("Milestone 1"), 120, 90, 10, "#FFF")
          screen.drawText(("10X Points, ^1.01 Points, 3x Xp, 2x Prestige Points"), 120, 80, 7.5, "#FFF")
          screen.drawText(("Unlock Automation for the first UPG"), 120, 70, 7.5, "#FFF")
          screen.fillRoundRect(120, 37.5, 175, 40, 10, "rgb(0,0,255)")
          screen.drawText(("Milestone 2"), 120, 52.5, 10, "#FFF")
          screen.drawText(("4X Points, 1.5x Prestige Points, 2x XP"), 120, 42.5, 10, "#FFF")
          screen.drawText(("Automate the Second UPG"), 120, 32.5, 10, "#FFF")
          screen.fillRoundRect(120, -5, 175, 40, 10, "rgb(0,0,255)")
          screen.drawText(("Milestone 3"), 120, 10, 10, "#FFF")
          screen.drawText(("Unlock Tiers"), 120, 0, 10, "#fcd105")
          screen.drawText(("Automate the Third UPG"), 120, -10, 10, "#FFF")
          screen.drawText(("Unlock more prestige UPGS"), 120, -20, 7.5, "#FFF")
          screen.fillRoundRect(120, -47.5, 175, 40, 10, "rgb(0,0,255)")
          screen.drawText(("Milestone 4"), 120, -32.5, 10, "#FFF")
          screen.drawText(("-Increase the effect of prestige upg 5"), 120, -42.5, 10, "#FFF")
          screen.drawText(("from 0.25 to 0.75"), 120, -50, 10, "#FFF")
          screen.drawText(("-Every Milestone starting from 4"), 120, -56.5, 7, "#FFF")
          screen.drawText(("Boosts Points and XP by 2x"), 120, -62.5, 7, "#FFF")
          screen.setAlpha(0.5)
          screen.fillRoundRect(120, -90.5, 175, 40, 10, "rgb(0,0,255)")
          screen.setAlpha(1)
          screen.drawText(("Milestone 5"), 120, -75.5, 10, "#FFF")
          screen.drawText(("Prestige Points are Automated with"), 120, -85.5, 10, "#FFF")
          screen.drawText(("0.01%/s each second. 3x XP"), 120, -95.5, 10, "#FFF")
        elsif ReMi == 5 then
          screen.drawText(("Reincarnate: 2.000 De"), -120, -50, 12.5, "#FFF")
          screen.setAlpha(1)
          screen.fillRoundRect(120, 80, 175, 40, 10, "rgb(0,0,255)")
          screen.drawText(("Milestone 1"), 120, 90, 10, "#FFF")
          screen.drawText(("10X Points, ^1.01 Points, 3x Xp, 2x Prestige Points"), 120, 80, 7.5, "#FFF")
          screen.drawText(("Unlock Automation for the first UPG"), 120, 70, 7.5, "#FFF")
          screen.fillRoundRect(120, 37.5, 175, 40, 10, "rgb(0,0,255)")
          screen.drawText(("Milestone 2"), 120, 52.5, 10, "#FFF")
          screen.drawText(("4X Points, 1.5x Prestige Points, 2x XP"), 120, 42.5, 10, "#FFF")
          screen.drawText(("Automate the Second UPG"), 120, 32.5, 10, "#FFF")
          screen.fillRoundRect(120, -5, 175, 40, 10, "rgb(0,0,255)")
          screen.drawText(("Milestone 3"), 120, 10, 10, "#FFF")
          screen.drawText(("Unlock Tiers"), 120, 0, 10, "#fcd105")
          screen.drawText(("Automate the Third UPG"), 120, -10, 10, "#FFF")
          screen.drawText(("Unlock more prestige UPGS"), 120, -20, 7.5, "#FFF")
          screen.fillRoundRect(120, -47.5, 175, 40, 10, "rgb(0,0,255)")
          screen.drawText(("Milestone 4"), 120, -32.5, 10, "#FFF")
          screen.drawText(("-Increase the effect of prestige upg 5"), 120, -42.5, 10, "#FFF")
          screen.drawText(("from 0.25 to 0.75"), 120, -50, 10, "#FFF")
          screen.drawText(("-Every Milestone starting from 4"), 120, -56.5, 7, "#FFF")
          screen.drawText(("Boosts Points and XP by 2x"), 120, -62.5, 7, "#FFF")
          screen.setAlpha(0.5)
          screen.setAlpha(1)
          screen.fillRoundRect(120, -90.5, 175, 40, 10, "rgb(0,0,255)")
          screen.drawText(("Milestone 5"), 120, -75.5, 10, "#FFF")
          screen.drawText(("Prestige Points are Automated with"), 120, -85.5, 10, "#FFF")
          screen.drawText(("0.01%/s each second. 3x XP"), 120, -95.5, 10, "#FFF")
          screen.fillRect(0, -25, 20, 30, "#FFF")
          screen.drawText("↓", 0, -25, 30, "black")
         elsif ReMi == 6 then
          screen.drawText(("Reincarnate: (WIP)"), -120, -50, 12.5, "#FFF")
          screen.setAlpha(1)
          screen.fillRoundRect(120, 80, 175, 40, 10, "rgb(0,0,255)")
          screen.drawText(("Milestone 1"), 120, 90, 10, "#FFF")
          screen.drawText(("10X Points, ^1.01 Points, 3x Xp, 2x Prestige Points"), 120, 80, 7.5, "#FFF")
          screen.drawText(("Unlock Automation for the first UPG"), 120, 70, 7.5, "#FFF")
          screen.fillRoundRect(120, 37.5, 175, 40, 10, "rgb(0,0,255)")
          screen.drawText(("Milestone 2"), 120, 52.5, 10, "#FFF")
          screen.drawText(("4X Points, 1.5x Prestige Points, 2x XP"), 120, 42.5, 10, "#FFF")
          screen.drawText(("Automate the Second UPG"), 120, 32.5, 10, "#FFF")
          screen.fillRoundRect(120, -5, 175, 40, 10, "rgb(0,0,255)")
          screen.drawText(("Milestone 3"), 120, 10, 10, "#FFF")
          screen.drawText(("Unlock Tiers"), 120, 0, 10, "#fcd105")
          screen.drawText(("Automate the Third UPG"), 120, -10, 10, "#FFF")
          screen.drawText(("Unlock more prestige UPGS"), 120, -20, 7.5, "#FFF")
          screen.fillRoundRect(120, -47.5, 175, 40, 10, "rgb(0,0,255)")
          screen.drawText(("Milestone 4"), 120, -32.5, 10, "#FFF")
          screen.drawText(("-Increase the effect of prestige upg 5"), 120, -42.5, 10, "#FFF")
          screen.drawText(("from 0.25 to 0.75"), 120, -50, 10, "#FFF")
          screen.drawText(("-Every Milestone starting from 4"), 120, -56.5, 7, "#FFF")
          screen.drawText(("Boosts Points and XP by 2x"), 120, -62.5, 7, "#FFF")
          screen.setAlpha(0.5)
          screen.setAlpha(1)
          screen.fillRoundRect(120, -90.5, 175, 40, 10, "rgb(0,0,255)")
          screen.drawText(("Milestone 5"), 120, -75.5, 10, "#FFF")
          screen.drawText(("Prestige Points are Automated with"), 120, -85.5, 10, "#FFF")
          screen.drawText(("0.01%/s each second. 3x XP"), 120, -95.5, 10, "#FFF")
          screen.fillRect(0, -25, 20, 30, "#FFF")
          screen.drawText("↓", 0, -25, 30, "black")
        end
      end
      
      if stade == "Reincarnation2" then
        screen.clear(color)
        screen.drawRect(120,0,175,200, "blue")
        screen.fillRect(-120, 0, 175, 200, "rgb(200,200,200)")
        screen.fillRoundRect(-120,50,100,50,7.5, "rgb(255,255,190)")
        screen.setLineWidth(4)
        screen.drawRoundRect(-120,50,100,50,7.5, "rgb(127.5,127.5,95)")
        screen.drawText("Reincarnate for new Milestones", -120, 65, 7, "Black")
        screen.drawText("Each Milestone gives unique", -120, 57.5, 7, "Black")
        screen.drawText("rewards but they get harder to", -120, 50, 7, "Black")
        screen.drawText("obtain.", -120, 42.5, 7, "Black")
        screen.drawText(("Current Milestone: " + ReMi), -120, 35, 7, "Black")
        screen.fillRoundRect(-120,-50,120,30,7.5, "rgb(100,0,100)")
        screen.setAlpha(0.5)
        screen.fillRect(120, 0, 175, 200, "rgb(150,200,150)")
        screen.setAlpha(1)
        screen.fillRoundRect(-125, 0, 20, 20, 30, "rgb(200,50,50)")
        screen.drawText("X", -124, 0, 18, "#FFF")
        screen.fillRect(0, 25, 20, 30, "#FFF")
        screen.drawText("↑", 0, 25, 30, "black")
        if ReMi == 5 then
          screen.drawText(("Reincarnate: 2.000 De"), -120, -50, 12.5, "#FFF")
          screen.setAlpha(0.5)
          screen.fillRoundRect(120, 80, 175, 40, 10, "rgb(0,0,255)")
          screen.fillRoundRect(120, 37.5, 175, 40, 10, "rgb(0,0,255)")
          screen.setAlpha(1)
          screen.drawText(("Milestone 6"), 120, 90, 10, "#FFF")
          screen.drawText(("-Increase Prestige Generation by 10x per reset until 100%"), 120, 80, 7., "#FFF")
          screen.drawText(("current power 0.01%. 3x Points, 3x XP."), 120, 72.5, 7.5, "#FFF")
          screen.drawText(("-Raise Points exponent by +0.02. " + "(" + ExpondentalBoost + "^ " + "> " + (ExpondentalBoost+0.02) + "^" + ")"), 120, 65, 7.5, "#FFF")
          screen.drawText(("Milestone 7"), 120, 52.5, 10, "#FFF")
          screen.drawText(("???"), 120, 42.5, 10, "#FFF")
        elsif ReMi == 6 then
          screen.drawText(("Reincarnate: (WIP)"), -120, -50, 12.5, "#FFF")
          screen.fillRoundRect(120, 80, 175, 40, 10, "rgb(0,0,255)")
          screen.drawText(("Milestone 6"), 120, 90, 10, "#FFF")
          screen.drawText(("-Increase Prestige Generation by 10x per reset until 100%"), 120, 80, 7., "#FFF")
          screen.drawText(("current power 0.1% 3x Points, 3x XP." ), 120, 72.5, 7.5, "#FFF")
          screen.drawText("-Raise Points exponent by +0.02 " + "(" + ExpondentalBoost + "^" + ")", 120, 65, 7.5, "#FFF")
          screen.setAlpha(0.5)
          screen.fillRoundRect(120, 37.5, 175, 40, 10, "rgb(0,0,255)")
          screen.fillRoundRect(120, -5, 175, 40, 10, "rgb(0,0,255)")
          screen.setAlpha(1)
          screen.drawText(("Milestone 7"), 120, 52.5, 10, "#FFF")
          screen.drawText(("???"), 120, 42.5, 10, "#FFF")
        end
      end
    end

I think this the issue

elsif b.id == "11" and ReMi > 6 then
      screen.drawSprite("atomizer", b.x, b.y, b.oldW, b.oldH)
    end

ill take a look and i added the button cuz i was bored

i believe ive fixed it do ReMi = 7 in the console to make the button appear and to test it its centered in the middle of the screen also to add new buttons simply set the b.id to whatever you set it to at the begining i fixed it in your code also the issue want rlly your button code there was another error in the code that messed up some other code i fixed it tho if you plan on making this game even bigger i recommend tidying the code or reimplemeting it entirely to make it faster and more effiecent

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community