-- karakter konumu
px = 64
py = 100
-- kalpler listesi
hearts = {}
score = 0
game_over = false
function spawn_heart()
local heart = {
x = flr(rnd(120)) + 4,
y = -8
}
add(hearts, heart)
end
function _update()
if game_over then return end
if btn(0) then px -= 2 end
if btn(1) then px += 2 end
px = mid(0, px, 120)
if time() % 1 < 0.02 then
spawn_heart()
end
for i=#hearts,1,-1 do
local h = hearts[i]
h.y += 1
if abs(px - h.x) < 8 and abs(py - h.y) < 8 then
del(hearts, h)
score += 1
if score == 28 then
game_over = true
end
elseif h.y > 128 then
del(hearts, h)
end
end
end
function _draw()
cls()
rectfill(px, py, px+7, py+7, 8)
for h in all(hearts) do
spr(1, h.x, h.y)
end
print("kalpler: "..score, 2, 2, 7)
if game_over then
rectfill(10, 50, 118, 78, 0)
print("seni cook seviyorummmm", 16, 56, 11)
print("askimmmm <3", 40, 64, 11)
end
end
[Please log in to post a comment]