Killer Jo Farm
function setup()
-- Buttons "vorzeichnen"
BGcolor = color(0, 229, 255)
StartBTN = readImage(asset.builtin.UI.Green_Button_00)
SkinBTN = readImage(asset.builtin.SpaceCute.Beetle_Ship)
FarmBTN = readImage(asset.builtin.Platformer_Art.Block_Grass)
BoxBTN = readImage(asset.builtin.Small_World.Watch_Tower)
Character01 = readImage(asset.builtin.Planet_Cute.Character_Pink_Girl)
-- Texte "vorzeichnen"
StartTXT = "Start"
SkinTXT = "Box"
FarmTXT = "Farm (Island)"
BoxTXT = "Your 2. Box"
-- Coins
Coins = 0
end
function draw()
Start11=true
-- Buttons Zeichnen
-- Sprites
function StST()
background(BGcolor)
sprite(StartBTN, 800, 150)
sprite(SkinBTN, 800, 300)
sprite(FarmBTN, 550, 700)
sprite(BoxBTN, 200, 200)
sprite(Character01, 550, 500)
sprite(asset.documents.Monster, 550, 790, 50, 50)
sprite(asset.builtin.Planet_Cute.Chest_Closed, 150, 500)
-- Texte Zeichnen
fill(255, 27, 0)
font("ArialRoundedMTBold")
text(StartTXT, 800, 150)
text(SkinTXT, 800, 300)
text(FarmTXT, 550, 700)
text(BoxTXT, 200, 200)
fill(130, 30, 109)
font("Arial-BoldMT")
fontSize(50)
text("Killer Jo", 150, 750)
fontSize(20)
end
-- Die Touches
if CurrentTouch.state == BEGAN then
if CurrentTouch.x >= 800-75 and CurrentTouch.x <= 800+75 and
CurrentTouch.y >= 150-19 and CurrentTouch.y <= 150+19 then
Start= true
end
end
if CurrentTouch.state == BEGAN then
if CurrentTouch.x >= 800-75 and CurrentTouch.x <= 800+75 and
CurrentTouch.y >= 300-19 and CurrentTouch.y <= 300+19 then
Skin = true
end
end
if CurrentTouch.state == BEGAN then
if CurrentTouch.x >= 550-75 and CurrentTouch.x <= 550+75 and
CurrentTouch.y >= 700-19 and CurrentTouch.y <= 700+19 then
Farm = true
end
end
if CurrentTouch.state == BEGAN then
if CurrentTouch.x >= 200-75 and CurrentTouch.x <= 200+75 and
CurrentTouch.y >= 200-19 and CurrentTouch.y <= 200+19 then
Box = true
end
end
if CurrentTouch.state == BEGAN then
if CurrentTouch.x >= 150-75 and CurrentTouch.x <= 150+75 and
CurrentTouch.y >= 500-19 and CurrentTouch.y <= 500+19 then
Shop = true
end
end
if Shop then
background(62)
if CurrentTouch.state == ENDED then
if Coins > 99 then
print("Item Buyed")
end
end
end
if Start then
background(128)
text("Hier! Ein paar Coins!", 550, 700)
sprite(asset.builtin.Blocks.Glass, 550, 500)
Coins = 0
if CurrentTouch.state == ENDED then
Middion01=true
end
if Middion01 then
Coins = Coins + 5
background(233, 147, 80)
text("Sxhlage So oft du kannst den Charakter um ihn FREIZUSCHALTEN!!!", 550, 700)
end
end
if Skin then
background(85, 130, 61)
text("Deine Skin-Box", 550, 700)
sprite(asset.builtin.Planet_Cute.Character_Boy, 550, 500)
end
if Farm then
background(138, 83, 79)
text("Das ist deine Farm (Island)", 550, 700)
sprite(asset.builtin.Blocks.Dirt, 550, 500)
text("Warte 1 Min um grass zu erhalten!", 550, 300)
tween.delay(60, function()
pp=true
end)
if pp then
background(138, 83, 79)
end
end
if Box then
background(169, 149, 73)
text("Das ist deine 2. Box", 550, 700)
sprite(asset.builtin.Blocks.Dirt_Snow, 550, 510)
text("Erledige 1 Mission!", 550, 400)
end
fill(255, 245, 0)
text(Coins, 1000, 750)
text("Coins:", 800, 750)
sprite(asset.builtin.UI.Blue_Box_Cross, 900, 650)
if CurrentTouch.state == ENDED then
if CurrentTouch.x >= 900-75 and CurrentTouch.x <= 900+75 and
CurrentTouch.y >= 650-19 and CurrentTouch.y <= 650+19 then
StST()
end
end
end
I changed the code but when you open a menu and then go out again (my problem was that when you clicked on the back button that you donāt return to the main menu) that if you click again you come back to the same menu