function draw()
if CurrentTouch.state == ENDED then
if CurrentTouch.x >= 850-120 and CurrentTouch.x <= 850+120 and
CurrentTouch.y >= 100-49 and CurrentTouch.y <= 100+49 then
shooting()
tween.delay(0.5, function()
nicht = true
sprite(asset.documents.Nachladen, 150, 715, 100)
end)
end
end
fill(255, 14, 0)
font("Arial-ItalicMT")
if A then
WachenX = WachenX - WachenX_sgk
B = false
tween.delay(1, function()
A = false
B = true
end)
end
if B then
WachenX = WachenX + WachenX_sgk
A = false
tween.delay(1, function()
B = true
A = true
end)
end
-- ((8.8.2023)) --
-- Spfa
if ops == "Start" then
background(46)
sprite(asset.documents.Start_buttonKJ, 800, 100, Startbtnscale)
sprite(asset.documents.Skineditor, 800, 300, Skinbtnscale) -- Telefonnieren vorbei
end
if ops == "Start11" then
background(91, 155, 64)
if CurrentTouch.state == ENDED then
if CurrentTouch.x >= 800-120 and CurrentTouch.x <= 900+120 and
CurrentTouch.y >= 50-49 and CurrentTouch.y <= 150+49 then
shooting()
tween.delay(0.5, function()
nicht = true
sprite(asset.documents.Nachladen, 150, 715, 100)
end)
end
end
if CurrentTouch.state == MOVING then
if CurrentTouch.x >= 200-120 and CurrentTouch.x <= 200+120 and
CurrentTouch.y >= 420-49 and CurrentTouch.y <= 420+49 then
y = y + 5
end
end
if CurrentTouch.state == MOVING then
if CurrentTouch.x >= 200-120 and CurrentTouch.x <= 200+120 and
CurrentTouch.y >= 100-49 and CurrentTouch.y <= 100+49 then
y = y - 5
end
end
if CurrentTouch.state == MOVING then
if CurrentTouch.x >= 300-120 and CurrentTouch.x <= 300+120 and
CurrentTouch.y >= 250-49 and CurrentTouch.y <= 250+49 then
x = x + 5
end
end
if CurrentTouch.state == MOVING then
if CurrentTouch.x >= 100-120 and CurrentTouch.x <= 100+120 and
CurrentTouch.y >= 250-49 and CurrentTouch.y <= 250+49 then
x = x - 5
end
end
if CurrentTouch.state == BEGAN then
if CurrentTouch.x >= 200-120 and CurrentTouch.x <= 200+120 and
CurrentTouch.y >= 420-49 and CurrentTouch.y <= 420+49 then
y = y + 5
end
end
if CurrentTouch.state == BEGAN then
if CurrentTouch.x >= 200-120 and CurrentTouch.x <= 200+120 and
CurrentTouch.y >= 100-49 and CurrentTouch.y <= 100+49 then
y = y - 5
end
end
if CurrentTouch.state == BEGAN then
if CurrentTouch.x >= 300-120 and CurrentTouch.x <= 300+120 and
CurrentTouch.y >= 250-49 and CurrentTouch.y <= 250+49 then
x = x + 5
end
end
if CurrentTouch.state == BEGAN then
if CurrentTouch.x >= 100-120 and CurrentTouch.x <= 100+120 and
CurrentTouch.y >= 250-49 and CurrentTouch.y <= 250+49 then
x = x - 5
end
end
if nicht then
shootX = x
shootY = y
end
background(57, 61, 69)
sprite(asset.documents.munio, shootX, shootY, 50)
if shootX > WachenX then
ServicePAD = true
end
sprite(Spieler,x,y)
sprite(asset.builtin.Blocks.Cactus_Inside, 200, 250, 250, 400)
sprite(asset.builtin.UI.Blue_Button_07, 200, 420)
sprite(asset.builtin.UI.Blue_Button_07, 300, 250)
sprite(asset.builtin.UI.Blue_Button_07, 100, 250)
sprite(asset.builtin.UI.Blue_Button_07, 200, 100)
sprite(asset.documents.Wache, WachenX, WachenY, 100, 100)
sprite(asset.documents.Angreifen, 850, 100, 100)
sprite(asset.documents.Nachladen, 150, 715, 100)
text("Nachladen", 150, 715)
--
--
if CurrentTouch.state == ENDED then
if CurrentTouch.x >= 800-120 and CurrentTouch.x <= 900+120 and
CurrentTouch.y >= 50-49 and CurrentTouch.y <= 150+49 then
shooting()
tween.delay(0.5, function()
nicht = true
sprite(asset.documents.Nachladen, 150, 715, 100)
end)
end
end
if CurrentTouch.state == BEGAN then
if CurrentTouch.x >= 800-120 and CurrentTouch.x <= 900+120 and
CurrentTouch.y >= 50-49 and CurrentTouch.y <= 150+49 then
sprite(asset.documents.angreifen_touch, 850, 100, 100)
end end
if CurrentTouch.state == BEGAN then
if CurrentTouch.x >= 75-120 and CurrentTouch.x <= 200+120 and
CurrentTouch.y >= 650-49 and CurrentTouch.y <= 750+49 then
sprite(asset.documents.Nachladen_touch, 150, 715, 100)
end
end
end
if not nicht then
shootX = shootX + 30
end
if ops == "Tuto01" then
end
-- \28:18/ Mittwoch 9.Aug. (9.8.2023)] Sofa/hh NE SPAß IM BEZT NATÜRLICH CODE 500 MAL(Xx) GÄSCHMENERT
-- Lolp)hPAPAWar da=l(Eig. wol lte cuh machen Verlosung
if ServicePAD then
if SpielerLeben < Mtest then
background(0)
end
background(128)
fill(7, 0, 255)
font("Arial-BoldMT")
text("Akku: " .. Akku, 150, 750)
sprite(asset.builtin.Small_World.Dialog_Icon, 900, 700, 200)
-- Eigggg p0 730900
sprite(Spieler, 900, 731)
Counter = Counter + 1
if Counter > math.random(60, 100) then
yourFunction()
Counter = 0
end
fill(255, 14, 0)
text("Hier siehst du, wie es am Pad aussieht, wenn du auf ein Land zugreifen willst", 500, 100)
sprite(asset.builtin.UI.Blue_Button_05, 525, 150)
fill(0)
font("Arial-BoldMT")
text("Land Zugreifen", 525, 150)
--
sprite(asset.builtin.Platformer_Art.Block_Brick, 525, 450, 300)
---
sprite(asset.Yeah_bildschirm, 525, 450,300)
-- Alle Länder
sprite(option, 525, 450, 200)
-- Mittwoch 26. Augusr
text(Brueckenburg_insel_name, 525, 725)
----- code leider : di hanze zeit : geändert leider ::: 16:35 Sonntag 13. Aug. 13.8.2034
-- ;3 (ne eigg 13.8.2023 16:37 zeit vergeeeht
end
if ops == "Box" then
end
if Training001 then
background()
sprite(Wache, 850, 500, 100)
sprite(Spieler, x, y)
sprite(asset.builtin.Blocks.Cactus_Inside, 200, 250, 250, 400)
sprite(asset.builtin.UI.Blue_Button_07, 200, 420)
sprite(asset.builtin.UI.Blue_Button_07, 300, 250)
sprite(asset.builtin.UI.Blue_Button_07, 100, 250)
sprite(asset.builtin.UI.Blue_Button_07, 200, 100)
-- --
----------
function findDistance(v1, v2)
-- v1 is WACHE, v2 is SPIELER, Calc distance
dist = math.sqrt(math.abs(v1.x-v2.x)^2+math.abs(v1.y-v2.y)^2)
count = 1
return dist
end
function shoot(dist)
--
if (v1.x - v2.x) > (v1.y - v2.y) then
-- loop on height
incY = 1
incX = (v1.x - v2.x)/(v1.y - v2.y)
sprite(asset.builtin.UI.Blue_Box_Cross, math.floor(v1.x+count*incX), v1.y+count*incY)
else
-- loop on width
incX = 1
incY = (v1.x - v2.x)/(v1.y - v2.y)
sprite(asset.builtin.UI.Blue_Box_Cross, (v1.x+count*incX), math.floor(v1.y+count*incY))
end
if count > dist then count = 0 end
end
end end
function shooting()
shootX = shootX + 10
nicht = false
end
ATTENTION
: This code has partly included CurrentToch because there is no other way.
This is the whole code. I don’t know why it doesn’t work so I want the Sprite GUARD to shoot a small “button” (on the sprite PLAYER) so that a small button is “thrown” to the sprite “PLAYER”. It’s not meant to be mean now : ) I just wanted to explain to them briefly ; )