Discord
Login
Community
DARK THEME

Shopkeeper functions and title screen

Hello guys, I would like to request some help please. My shopkeeper and Title screen don’t. Work properly and I would like to know why.

Shopkeeper

shopStart = function()
  if shop_status == true then
    shopUpdate()
    end
  end
shopKeeper = function()
  if keyboard.press.L then
    shop_status == true
  end
  if keyboard.press.J then
    shop_statues == false
    end
end
shopUpdate = function()
  if keyboard.1 then
    end
  end
shopDraw = function()
  if shop_status == true then
    screen.clear("brown")
    screen.drawSprite("billy_buttah_fingers_aka_buns",100,-15,40)
    end
  end

Title Screen

titleScreenInit = function()
  mode = "title"
end
titleScreenUpdate = function()
  if keyboard.R then
    mode = "nothing"
    end
end
titleScreenDraw = function()
  if mode == "title" then
    screen.clear("orange")
    screen.drawSprite("icon",0,0,100)
    screen.drawText("Muquan and Thamas",0,0,40)
    screen.drawText("TD: The Chosen One",0,-20,20)
    end
  end

from what i can see, you only activate shopUpdate() once with shopStart() (assuming you only run shopStart() once) in order to update constantly, you'd need to call it in a function that activates every frame

Do "shop_status = true" instead of "shop_status == true" for your variable statements.

"==" is used for conditional statements, "=" is used for changing the state or value of a variable.

Thanks guys it works now! :D

You're welcome, and good luck on the rest of your project

Post a reply

Progress

Status

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